Ch. 13.2: Mathematical Expectation Random Variables Very often, we are interested in sample spaces in which the outcomes are distinct real numbers. For example, in the experiment of rolling two dice, we found last section that we could define the sample space as: Sample Space for Rolling 2 Dice: Outcomes: 2 3 4 5 6 7 8 9 10 11 12 Probabilities: 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36 We can think of the specific outcome of any given roll as a random variable, X, that can take any integer value between 2 and 12. Along with the associated probability values, this table defines what s called a probability distribution for the variable X. (More precisely, a random variable is a function that assigns a real number to each possible outcome of a given sample space, and a probability distribution is a function that assigns probabilities to subsets of those numbers in some way. As usual, the precise mathematical definitions are not very intuitive.) Mathematical Expectation To motivate this discussion, let us start with an example: Example 1: Suppose we roll a fair, 6-sided die100 times (keeping trackof theresults), and at the end, we add up all the results of each roll. What would be the likely value of this sum? ANSWER: The sample space for a single roll can be described by the following random variable: Random Variable, X Outcomes: 1 2 3 4 5 6 Probabilities: 1/6 1/6 1/6 1/6 1/6 1/6 1
Since 100 is much bigger than 6 (the total number of possible outcomes), by the Law of Large Numbers, we should expect 1 /6th of the outcomes to be a 1, 1 /6th of the outcomes to be a 2, and so on. Thus, the total sum should be about: s = 100 1 6 (1)+100 1 6 (2)+100 1 6 (3)+100 1 6 (4)+100 1 6 (5)+100 1 6 (6) ( 1 = 100 6 (1)+ 1 6 (2)+ 1 6 (3)+ 1 6 (4)+ 1 6 (5)+ 1 ) 6 (6) = 100 3.5 = 350. We call the quantity 1 (1) + 1 (2) + 1 (3) + 1 (4) + 1 (5) + 1 (6) the expectation of the 6 6 6 6 6 6 random variable X, and denote it by X. It is simply the average number of dots we get on each roll (note, however, that we can never roll exactly 3.5). In general, we use the following definition: Expectation of a Random Variable Suppose a random variable, X, can take finitely-many possible values, (x 1,x 2,...,x n ), each with associated probabilities (p 1,p 2,...,p n ). The expectation of X is then defined as... X = x 1 p 1 + x 2 p 2 +... + x n p n. As we see, an expectation is nothing more than a weighted average of all possible outcomes (when those outcomes are real numbers). In this chapter, most of the examples deal with simple games-of-chance in which one can either lose or win money. In a simple game of chance, whether you win or lose depends purely on luck, and there are few (if any) meaningful strategies to consider. An example might be a state lottery. In these contexts, we can speak of the expected winnings for a game, which is just the average amount of money won per play (i.e, an expectation). 2
Example 2: Consider a game in which you roll a pair of dice. If you roll a double, then you win $5. If you roll an odd number, then you win $2. Otherwise, you lose $5. What are your expected winnings? Up to how much should you be willing to pay to play each game? ANSWER: Remember the sample space for rolling 2 dice, in which each outcome is equally-likely: Sample Space, U There are 36 possible outcomes, and we need to consider 3 mutually-exclusive events: (1) rolling a double, (2) rolling an odd number, (3) rolling neither double nor odd. We can find the probability of each event by counting the number of favourable outcomes above: P(rolling a double) = 6 36 = 1 6 P(rolling an odd) = 18 36 = 1 2 P(rolling neither double nor odd) = 12 36 = 1 3 Thus, ifweareonlyinterestedinoutcomesdefinedbytheamountofmoneywewin/lose in a game, we have the following random variable: Winnings, X Values: $5 $2 $5 Probabilities: 1/6 1/2 1/3 3
Our expected winnings is then just the expectation of this variable: X = 1 6 ($5)+ 1 2 ($2)+ 1 ( $5) $0.17. 3 What this tells us is that we would win an average of about 17 per game, if we kept on playing it many many times. If we had to pay a fee for each game, then we would not want it to be more than 17, otherwise we would eventually end up losing money. Example 3: Consider a lottery with a single JACKPOT prize of $500,000. If a ticket costs $3, and the probability of it being a winning ticket is approximately 1/1,000,000, then what is the expected winnings? ANSWER: Here, we consider only two mutually-exclusive events: Event Winnings, X Probability win $500, 000 $3 1/1,000,000 lose $3 999,999/1,000,000 The expected winnings is: X = 1 999,999 ($499,997) + ( $3) = $2.50 1,000,000 1,000,000 In this example, we subtracted the ticket cost ($3) from the possible prizes before we calculated the expectation, X. However, we could have just as well done it after. If the tickets cost nothing, then we d have: Event Winnings, Y Probability win $500,000 1/1,000,000 lose $0 999,999/1,000,000 and the expected winnings is now: Y = 1 999,999 ($500,000) + ($0) = $0.50 1,000,000 1,000,000 4
Now, if the tickets cost $3 each, then we can simply subtract $3 from the above result: X = Y $3 = $2.50 which is the same result as before. This example illustrates the following property of expectations: If X is a random variable, and a,b are constants for each possible value of X, then ax +b is also a random variable, and ax +b = a X +b. 5
Example 4: Imagine there is a raffle contest being held at your local community center. Suppose there is one grand prize worth $5,000, and two 2nd prizes each worth $500. If a raffle ticket costs $2, and 800 tickets are sold, what is the expected winnings on one ticket? (Assume that the grand-prize winner is selected first, followed by the 2nd prize winners, without repetition, and that all tickets are equally-likely to be drawn). ANSWER: Fromtheperspective ofasingle ticket, say ticket #001, there are3events to consider: Event Winnings, X win the grand prize $5000 $2 win the 2nd prize $500 $2 not a winner $2 We need to determine the probability for each of these events. Note that from the perspective of the raffle picker, there are literally millions of possible outcomes. For instance, an arbitrary outcome could be represented as the ordered pair(#238,{#591,#642}), where ticket #238 is the grand prize winner, and #591 / #642 are the 2nd prize winners. By the Fundamental Counting Principle, there are then ( ) 799 800 2 = 400 799 798 = 255,040,800 possible outcomes. This is far too many to list in a table like we did in Example 2. Fortunately, the events above are easy to analyse: P(win the grand prize) = 1 800 P(win the 2nd prize) = 798 P(not a winner) = 797 800 /( 799 2 ) = 2 799 Thus, the expected winnings for a single ticket is: X = 1 800 ($4998)+ 2 797 ($498)+ ( $2) $5.50 799 800 6
Notice in this example, our expected winnings is positive; and yet, we would lose the raffle over 99% of the time. Thus, playing a game in which your expected winnings is positive does not mean that you are more likely to win. We would have to play the game at least several thousand times before we started to see an average winning of $5.50 per game, and most raffles are one-time events! This is an important lesson: an expectation value is typically only useful when the corresponding experiment can be repeated enough times. Example 5: Consider the following game in which two players each spin a fair wheel in turn: Player A Player B 4 12 2 6 5 The player that spins the higher number wins, and the loser has to pay the winner the difference of the two numbers (in dollars). Who would win more often? What is that player s expected winnings? ANSWER: Assuming 3 equally-likely outcomes for spinning A s wheel, and 2 equallylikely outcomes for B s wheel, there are then 3 2 = 6 possible equally-likely outcomes for this game: Sample Space A\B 5 6 2 (2,5) (2,6) 4 (4,5) (4,6) 12 (12,5) (12,6) 7
We see here that player A wins in 2/6 games, and player B wins in 4/6 games, so player B wins the most often. But, let s compute the expected winnings for player B: Winnings, X, for Player B A\B 5 6 2 $3 $4 4 $1 $2 12 $7 $6 Each of these possible amounts won has the same probability (1/6). The expected winnings for player B is then simply: X = 1 6 ($3)+ 1 6 ($4)+ 1 6 ($1)+ 1 6 ($2)+ 1 6 ( $7)+ 1 6 ( $6) = 1 6 ($3+$4+$1+$2 $7 $6) = $0.50 Hence, we see that even though player B is more likely to win on a single game, his expected winnings is actually negative. If he keeps on playing the game (maybe 20 or so rounds), he will eventually start losing money! 8