Topic 8: Jue 6, 20 The simplest summary of quatitative data is the sample mea. Give a radom variable, the correspodig cocept is called the distributioal mea, the epectatio or the epected value. We begi with the case of discrete radom variables where this aalogy is more apparet. The formula for cotiuous radom variables is obtaied by approimatig with a discrete radom ad oticig that the formula for the epected value is a Riema sum. Discrete Radom Variables Recall for a data set takig values, 2,...,, oe of the methods for computig sample mea of a fuctio of the data is accomplished by evaluatig a weighted average. Eample. For data -,,,2,3,3,3,3,4,4,4,4,4, we have the followig table We ca use this to compute the average of h() = 2 Thus 2 = 23/3. p() 3/3 2 /3 3 4/3 4 5/3 p() 2 2 p() 3/3 3/3 2 /3 4 4/3 3 4/3 9 36/3 4 5/3 6 80/3 sum 23/3 For the fuctio h(), we ca fid the mea of h() ca be determied by for each value of, multiplyig h() by p(), where p() is the proportio of observatios takig the value. addig up these products. It symbols, h() = h()p() Whe the mea is computed by appealig to a mass fuctio f X for a discrete radom variable, we perform the same actio to fid the mea. I this case the mea is called the epectatio or epected value ad writte Eh(X) = h()f X () Three properties of epectatio are: c 20 Joseph C. Watkis
. If a is a costat, Ea = a. 2. If h(x(ω)) 0 for every ω Ω, the every term i the sum is oegative ad cosequetly their sum Eh(X) 0. 3. Let X ad X 2 be two radom variables ad c, c 2 the E[c h (X ) + c 2 h 2 (X 2 )] = c Eh(X ) + c 2 Eh 2 (X 2 ). EX is ofte called to the mea of X ad is writte µ. The most frequetly fuctio for h() = ( µ) 2. I aalogy with the sample variace, E(X µ) 2 is called the variace ad is writte Var(X) or σ 2. A alterative epressio for the variace is σ 2 = Var(X) = E(X µ) 2 = E[X 2 2µX + µ 2 ] = EX 2 2µEX + µ 2 = EX 2 2µ 2 + µ 2 = EX 2 µ 2. Oe frequetly used idetity cocerig the variace is Var(aX + b) = E[((aX + b) (aµ + b)) 2 ] = E[(aX aµ) 2 ] = a 2 E(X µ) 2 = a 2 Var(X). () Thus, the shift by a amout b does ot chage the variace. Multiplicatio by a chages the variace by a factor of a 2. The variace of a sum of radom variables is more comple. As with computig the variace from a data set, the variace of the sum of X ad X 2 is the sum of three terms Var(X ), Var(X 2 ), ad a term that has as a factor the correlatio of X ad X 2. If X ad X 2 are idepedet, the correlatio is 0 ad we have a Pythagorea theorem for the sum of the variaces. Var(X + X 2 ) = Var(X ) + Var(X 2 ) σ 2 X +X 2 = σ 2 X + σ 2 X 2 (2) We will soo have eed for both the idetities () ad (2). Notice that eve though we have these aalogies, the two formulas come from very differet startig poits. The value of h() is derived from data whereas o data are ivolved i computig Eh(X). The startig poit for the epected value is a probability model. Eample 2. Roll oe die. The Ω = {, 2, 3, 4, 5, 6}. Let X be the value o the die. So, X(ω) = ω. If the die is fair, the the probability model has P {ω} = /6 for each outcome ω ad the epected value f X () f X () /6 /6 2 /6 2/6 3 /6 3/6 4 /6 4/6 5 /6 5/6 6 /6 6/6 sum 2/6=7/2 A eample of a ufair dice would have a o-uiform mass fuctio. For eample, 2
Eercise 3. Fid EX 2 for these two eamples. f X () f X () /4 3/2 2 /4 6/2 3 /4 9/2 4 /2 4/2 5 /2 4/2 6 /2 6/2 sum 32/2=8/3 Eample 4. If X ad X 2 are the values o two rolls of a fair die, the the epected value of the sum E[X + X 2 ] = EX + EX 2 = 7 2 + 7 2 = 7. Eample 5. Flip a biased coi twice ad let X be the umber of heads. The, to compute the epected value of X ad X 2 we costruct a table to prepare to use (??). f X () f X () 2 f X () 0 ( p) 2 0 0 2p( p) 2p( p) 2p( p) 2 p 2 2p 2 4p 2 sum 2p 2p + 2p 2 Thus, µ = EX = 2p ad EX 2 = 2p + 2p 2. The variace Var(X) = EX 2 µ 2 = 2p + 2p 2 (2p) 2 = 2p + 2P 2 4p 2 = 2p 2p 2 = 2p( p). 2 Beroulli Trials Beroulli trials are the simplest ad amog the most commo eperimetal procedures. Each trial has two possible outcomes, variously called, heads-tails, yes-o, up-dow, left-right, wi-lose, female-male, gree-blue, domiat-recessive, or success-failure. depedet o the circumstaces. We will use the priciples of coutig ad the properties of epectatio to aalyze Beroulli trials. From the poit of view of statistics, the data have a ukow success parameter p. Thus, the goal of statistical iferece is to make as precise a statemet as possible for the value of p behid the productio of the data. Cosequetly, ay eperimet that uses Beroulli trials as a model ought to possess its properties. Eample 6 (Beroulli trials). Radom variables X, X 2,..., X are called a sequece of Beroulli trials provided that:. Each X i takes o two values 0 ad. We call the value a success ad the value 0 a failure. 2. Each trial has the same probability for success, i.e., P {X i = } = p for each i. 3. The outcomes o each of the trials is idepedet. For each trial i, the epected value EX i = 0 P {X i = 0} + P {X i = } = 0 ( p) + p = p 3
is the same as the success probability. Let S = X + X 2 + + X be the total umber of successes. Usig the liearity of epectatio, we see that ES = E[X + X 2 + X ] = p + p + + p = p, the epected umber of successes i Beroulli trials is p. Also, if we look at the mea of the sample mea [ ] E X = E S = ES = p = p. I words, if the probability of success for oe Beroulli trial is p, the the mea for the sample mea is also p. I additio, we ca use our ability to cout to determie the probability mass fuctio for S. Begiig with a cocrete eample, let = 8, ad the outcome success, fail, fail, success, fail, fail, success, fail. Usig the idepedece of the trials, we ca compute the probability of this outcome: p ( p) ( p) p ( p) ( p) p ( p) = p 3 ( p) 5. Moreover, ay of the possible ( 8 3) particular sequeces of 8 Beroulli trials havig 3 successes also has probability p 3 ( p) 5. Each of the outcomes are mutually eclusive, ad, take together, their uio is the evet {S 8 = 3}. Cosequetly, by the aioms of probability, we fid that P {S 8 = 3} = ( ) 8 p 3 ( p) 5. 3 Returig to the geeral case, we replace 8 by ad 3 by to see that ay particular sequece of Beroulli trials havig successes has probability p ( p). I additio, we kow that we have ( ) mutually eclusive sequeces of Beroulli trials that have successes. Thus, we have the mass fuctio The fact that the sum f S () = P {S = } = f S () = =0 =0 ( ) p ( p), = 0,,...,. ( ) p ( p) = (p + ( p)) = = follows from the biomial theorem. Cosequetly, S is called a biomial radom variable. Eercise 7. Fid the variace of a sigle Beroulli trial. Eercise 8. Compute the variace for the two types of dice i Eercise. 4
ruig average 2.0 2.5 3.0 3.5 4.0 ruig average 2.0 2.5 3.0 3.5 4.0 0 20 40 60 80 00 0 20 40 60 80 00 Figure : Four simulatios of the ruig average S /, =, 2,..., 00 for the fair dice (left) with mea µ = 7/2 ad ad ufair dice (right) with mea µ = 8/3. 3 Simple Radom Samples A simple radom sample is a collectio of idepedet radom variables X, X 2,..., X that each have the same distributio. The eamples that we have see are the two types of die - both fair ad ufair, ad Beroulli. For the die, the radom variables are are the values o each of the rolls of the die. For these sequeces X, X 2,... of idepedet rolls of the die, we plot four realizatios of the ruig average. Notice that the plots appear to be covergig to the mea µ ad fluctuate less ad less as icreasig S = (X + X 2 + + X ). If the commo mea for the X i s is µ, the by the liearity property of epectatio, E[ S ] = (EX + EX 2 + + EX ) = (µ + µ + + µ) = µ = µ (3) If the commo variace of the X i s is σ 2, the by the two idetities () ad (2) for the variace, Var( S ) = 2 (Var(X ) + Var(X 2 ) + + Var(X )) = 2 (σ2 + σ 2 + + σ 2 ) = 2 σ2 = σ2. (4) So the mea of these ruig averages remais at µ but the variace is decreasig to 0 at a rate iversely proportioal to the umber of terms i the sum. These two facts eplai the two features i the graphs i Figure. We will soo lear about the distributio of the deviatios of the ruig averages from the mea. 4 Aswers to Selected Eercises 2. For the fair die EX 2 = 2 6 + 22 6 + 32 6 + 42 6 + 52 6 + 62 = ( + 4 + 9 + 6 + 25 + 36) 6 6 = 9 6. 5
For the ufair dice EX 2 = 2 4 + 22 4 + 32 4 + 42 2 + 52 2 + 62 = ( + 4 + 9) 2 4 + (6 + 25 + 36) 2 = 9 2. 3. Let X be a Beroulli radom variable. µ = EX = p. Note that because X takes o oly the values 0 ad, X = X 2 ad so EX 2 = p. Thus, Var(X) = EX 2 µ 2 = p p 2 = p( p). 4. For the fair die, the mea µ = EX = 7/2 ad the secod momet EX 2 = 9/6. Thus, Var(X) = EX 2 µ 2 = 9 6 ( 7 2 ) 2 = 82 47 2 = 35 2. For the ufair die, the mea µ = EX = /4 ad the secod momet EX 2 = 9/2. Thus, Var(X) = EX 2 µ 2 = 9 2 ( ) 2 476 363 = = 3 4 48 48. 6