 Suppose the final grades for a class are given in the table. To compute the average grade for the class, we can assign a point value to each letter, grade, and compute. For example, we might use a equals 4, b equals 3, z equals 2, d equals 1, and f equals 0, and so we can compute the mean grade as... Now let's consider a different situation. Suppose we choose a student at random where we assume that all students are equally likely to be chosen. The probability they get an a, b, c, d, or f... Well, we have the date of value, so we can compute these empirical probabilities. And let's consider our computation for the mean grade. The thing to notice here is if we multiply each of these probabilities by the value of the letter grade and add them all up, we get the mean grade. And this sum of the product of the value of a random quantity with the probability of obtaining it is called the expected value. So let's begin with discrete random variables. Let x be a discrete random variable. The expected value is given by this formula. In other words, the sum of the product of a value with the probability of obtaining that value. And you can think about the expected value as the average value of our random quantity. So for example, suppose you played the following game. A fair die is rolled. If the result is prime, you get five times the value shown of the die. Otherwise, you get nothing. Find and interpret the expected value. So to find the expected value, we sum the product of the outcomes and their probabilities. So let x be the value shown on the die. The probability that x is 1, 2, 3, 4, 5, or 6 is the same. 1, 6. And so we compute the expected value, the sum of the product of the outcomes with their probabilities. And so we find, and this is the expected value. If our outcomes are 1, 2, 3, 4, 5, or 6, the value shown of the die. So on average, the die will show 3.5. And here's an important idea in life. Always report what you've found and compare it to what you want to find. And in this case, while we've technically answered the question, we are probably more interested in how much we've won. And in that case, our outcomes are different. We want our outcomes to be the amount that we win. So if the result is prime, we get 5 times the value shown of the die, otherwise we get nothing. So we get 0 if we roll a 1, 4, or 6. And the probability that occurs is 3, 6. If we roll a 2, we get 10. And that occurs with probability 1, 6. We get 15 if we roll a 3, probability 1, 6. And 25 if we roll a 5, probability 1, 6. So again, we sum the product of the outcomes with their probabilities. And we get... Now this time, since our outcomes are the amounts that we actually win, on average, you could expect to win $8.33 every time you roll the die. So why do we care? One use of expected values is to calculate the cost to play a game. In the game, we've described the player could expect to win $8.67 every time they play, but how much should they be charged to play the game? This is what we call the ante. In a fair game, the expected value of the ante should be equal, but if you're running the game for profit, you charge more than the ante. And so this leads to the great secret of how to win at casinos. To win at casinos, be the owner of the casino. Now, we can introduce a slight variation. We had to be careful in our choice of the random variable. Now, we can use the obvious choice of random variable, the actual die rolls, if we incorporate a payoff function, g of xi. That's the amount we'd get if we got a roll of xi. So in our computation, the random variable was the payoff 0, 10, 15, or 25, but instead we can use the payoffs of 0, 10, 15, or 25 times the probability of the outcome that resulted in that payoff, namely that we got a 1, 4, or 6, a 2, a 3, or a 5. And the computation works out in exactly the same way. The only difference is what we're using as our random variable. So for example, suppose you flip a coin three times. If you get a payoff of $5 for each head, what's the expected payoff? So our outcome should be a payoff of 0, 5, 10, or 15. Instead, we'll use the probability of getting 0, 1, 2, or 3 heads and the payoff amounts. So our expected value will be 0 times the probability we get 0 heads plus 5 times the probability we get 1 plus 10 times the probability we get 2 heads plus 15 times the probability we get 3 heads. And these are all binomial probabilities so we can compute and find our expected value. So on average, you'd expect a payoff of $7.50 every time you pay the gain.