7-5 Random Variables, Probability Distributions, Expected Value RANDOM VARIABLES Experiment: flip a coin twice Sample space: {HH, HT, TH, TT} Game: if we get HH or TT, I pay you $1 if we get TH, you pay me $2 if we get HT, I pay you $.50 assign a numerical value X to each outcome: outcome HH HT TH TT X (my earnings) -1 -.50 2 -1 X is called a random variable (r.v. for short) A random variable is an assignment of a real number to each outcome of a sample space 7-5 p. 1 if we define a r.v. X on a sample space it makes sense to talk about the probability of various values of the r. v. X, as opposed to the probability of outcomes: P(X = -1) = ½ P(X = -.5) = ¼ P(X = 2) = ¼ can describe the probabilities using functional notation call our function p: p(-1) = ½ p(-.5) = ¼ p(2) = ¼ p is called the probability function or probability distribution of random variable X it is often useful to graph the probability distribution here we show the graph in histogram form: p(x) 1 .5 x -1 7-5 -.5 2.0 p. 2 EXPECTED VALUE Returning to our “game”: Flip a coin twice: if we get HH or TT, I pay you $1 if we get TH, you pay me $2 if we get HT, I pay you $.50 Our probability function is: p(-1) = ½ p(-.5) = ¼ p(2) = ¼ because this is a game of chance sometimes I will lose $1 sometimes I will lose 50 cents sometimes I will win $2 Question: what will be my average winnings (or loss) per game if we play the game many times? we can’t just average the -$1, -$.50 and $2 because they have different probabilities instead, we compute a weighted average: we will weight (multiply) each value of the r.v. by its probability, and add them up: (-1)( ½ ) + (-.5)( ¼ ) + 2( ¼ ) = $.125 on the average, I will lose 12 ½ cents per game so if we play long enough, you will wipe me out! Such a weighted average is called the expected value of the r.v. X 7-5 p. 3 Expected value of a random variable Suppose random variable X has probability function p: p(x1) = p1, p(x2) = p2, . . . , p(xn) = pn then the expected value of r.v. X is E(x) = x1p1 + x2p2 + . . . + xnpn If the Texas State Lottery pays $8,000,000 (as it does, on average), what are your expected winnings on a $1 bet? E(X) = 15,890,699 1 (7,999,999) + (-1.00) 15,890,700 15,890,700 = .503 - 1 = -$.50 if 8,000,000 people play: the lottery can expect to pay out (8,000,000)(.50) = $4,000,000 (sometimes no winner!) but there were $8,000,000 in bets where'd the other $4,000,000 go? 7-5 p. 4