Math 224 Fall 2017 Homework 4 Drew Armstrog Problems from 9th editio of Probability ad Statistical Iferece by Hogg, Tais ad Zimmerma: Sectio 2.3, Exercises 16(a,d),18. Sectio 2.4, Exercises 13, 14. Sectio 4.1, Exercises 3, 4. Sectio 4.2, Exercises 3(a). Sectio 5.3, Exercises 2, 5. Solutios to Book Problems. 2.3-16. Let X be the umber of flips of a fair coi that are required to observe the same face o cosecutive flips. (a) Fid the pmf of X. Solutio: The evet X 1 is empty, so that P (X 1) 0. The evet X 2 cosists of the sequeces T T ad HH so that X 2 {T T, HH} P (X 2) P (T T ) + P (HH) 1/4 + 1/4 1/2. The evet X 3 cosists of the sequeces HT T ad T HH so that X 3 {HT T, T HH} P (X 3) P (HT T ) + P (T HH) 1/8 + 1/8 1/4. The evet X 4 cosists of the sequeces T HT T ad HT HH so that X 4 {T HT T, HT HH} P (X 4) P (T HT T ) + P (HT HH) 1/16 + 1/16 1/8. I geeral, the evet X k cosists of exactly two sequeces: } HT {{ H} T T ad } T{{ HT} HH. k 2 flips k 2 flips Sice the coi is fair, each of these sequeces has probability 1/2 k, so that P (X k) 1 2 k + 1 2 k 2 2 k 1 2 k 1. The geometric series guaratees that this is, ideed, a probability mass fuctio: P (X 2) k2 1 2 k 1 1 2 + 1 4 + 1 8 + 1. 1
2 (d) Fid the values of P (X 3), P (X 5) ad P (X 3). Solutio: We already saw that P (X 3) 1/4. To fid P (X 3) we add up all the ways this ca happe: P (X 3) k 3 P (X k) P (X 2) + P (X 3) 1 2 + 1 4 3 4. We ca compute P (X 5) by summig a geometric series: P (X 5) k5 1/2 k 1 1/2 4 + 1/2 5 + 1/2 6 + 1/2 7 + 1/2 4 [1 + 1/2 + 1/4 + 1/8 + ] 1/2 4 2 1/2 3 1/8. Alteratively, we ca compute the probability of the complemet: P (X 5) 1 P (X 4) 1 [P (X 2) + P (X 3) + P (X 4)] 1 [1/2 + 1/4 + 1/8] 1 7/8 1/8. /// Remark: I did t ask you to solve 2.3-16 (b) ad (c) because we did t talk eough about momet geeratig fuctios i class. Here are the solutios ayway. To compute the mgf of X we use aother geometric series: M X (t) E[e tx ] e tk P (X k) k2 e tk 1/2 k 1 k2 e t (e t /2) k 1 k2 e t [e t /2 + (e t /2) 2 + (e t /2) 3 + ] e t (e t /2) [1 + (e t /2) 1 + (e 2 /2) 2 + ] e t (e t /2) e2t 2 e t. 1 1 e t /2
Now we ca use this to compute the mea ad variace. The oly trick is to remember the quotiet rule for derivatives: µ E[X] d dt M X(t) t0 d ( ) e 2t dt 2 e t0 t (2 et )(e 2t ) (e 2t )(2 e t ) (2 e t ) 2 (2 et )(2e 2t ) (e 2t )( e t ) (2 e t ) 2 (2 e0 )(2e 0 ) (e 0 )( e 0 ) (2 e 0 ) 2 (2 1)(2) (1)( 1) (2 1) 2 3. t0 t0 Alright, that was eough fu. My computer did the rest of the work: E[X 2 ] d2 dt 2 M X(t) 11, t0 σ 2 Var(X) E[X 2 ] E[X] 2 11 (3) 2 2 σ 2 1.414. Here is a picture summarizig the results of Exercise 2.3-16: 3 2.3-18. Let X have a geometric distributio, i.e., P (X k) p(1 p) k 1. Show that for ay o-egative itegers j ad k we have P (X > k + j X > k) P (X > j).
4 Proof: We recall from HW3 that for all o-egative itegers l we have P (X > l) p(1 p) l 1 kl+1 p(1 p) l + p(1 p) l+1 + p(1 p) l+2 + p(1 p) l [1 + (1 p) 1 + (1 p) 2 + ] p(1 p) l (1 p) l. 1 1 (1 p) Next we ote that the evet X > k + j ad X > k is the same as X > k + j. Fially, we use the defiitio of coditioal probability: P (X > k + j X > k) P (X > k + j ad X > k)/p (X > k) P (X > k + j)/p (X > k) (1 p) k+j /(1 p) k (1 p) j P (X > j). What does it mea? A geometric radom variable meas we are waitig for somethig to happe. The umber P (X > j) is the probability that it will take at least j uits of time for the thig to happe. Now suppose that we have bee waitig for k uits of time ad the thig still has t happeed. What is the chace that we will have to wait at least j more uits of time? Aswer: P (X > j). Reaso: A geometric radom variable does t kow how log we ve bee waitig because it has o memory. This is why we model it with a coi flip. 2.4-13. It is claimed that i a particular lottery, 1/10 of the 50 millio tickets will wi a prize. What is the probability of wiig at least oe prize if you purchase (a) 10 tickets? Solutio: Let X i be the evet defied by { 1 if your ith ticket wis a prize, X i 0 if your ith ticket does ot wi a prize. These evets are ot idepedet. (For example, if your first ticket wis a prize, the your secod ticket is slightly less likely to wi a prize.) However, they are approximately idepedet because the umber 50, 000, 000 is so big. Therefore we will assume that P (X i 1) 1/10 ad P (X i 0) 9/10 for all i. Uder these assumptios, the total umber of prizes X X 1 + X 2 + + X 10 is approximately biomial with 10 ad p 1/10. Therefore the probability of wiig at least oe prize is P (X 1) 1 P (X 0) 1 (1 p) 10 1 (9/10) 10 65.13%. (b) 15 tickets? Solutio: Usig the same simplifyig assumptios, the umber of prizes X that we wi is approximately biomial with 15 ad p 1/10. Therefore the probability of wiig at least oe prize is P (X 1) 1 (1 p) 15 1 (9/10) 15 79.41%. ///
2.4-14. Cotiuig from the previous problem, suppose that we buy tickets. The the umber of prizes X that we wi is approximately biomial with p 1/10. (I reality it is hypergeometric.) Therefore the probability of wiig at least oe prize is approximately P (X 1) 1 (1 p) 1 (9/10). Here is a plot of the probability P (X 1) for values of from 1 to 50: 5 It looks like the probability crosses 0.5 betwee 6 ad 7, ad the probability crosses 0.95 whe is aroud 30. To be precise, we have 6 P (X 1) 46.86% 7 P (X 1) 52.17% 28 P (X 1) 94.77% 29 P (X 1) 95.29%. Remark: I the previous two exercises we approximated the umber of prizes X by a biomial distributio where is the umber of tickets we buy ad p 1/10 is the proportio of tickets that are wiers. I reality X has a hypergeometric distributio. To see this, ote that there are 5, 000, 000 wiig tickets ad 45, 000, 000 losig tickets i a ur. We reach i ad grab tickets at radom. The probability of gettig exactly k wiig tickets is ( )( ) ( ) 5, 000, 000 45, 000, 000 50, 000, 000 P (X k) /, k k ad the probability of gettig at least oe wiig ticket is ( ) ( 45, 000, 000 50, 000, 000 P (X 1) 1 P (X 0) 1 / ). ///
6 Therefore we are assumig for simplicity that ( ) ( ) 45, 000, 000 50, 000, 000 / (9/10). It turs out that this approximatio 1 is quite good for small values of. Ideed, I ra all the calculatios agai with the exact formula ad I got the same aswers up to several decimal places. 4.1-3. Let X ad Y be radom variables with S X {1, 2} ad S Y {1, 2, 3, 4} ad with joit pmf give by the formula f XY (x, y) x + y 32. Solutio: For (a) ad (b) we draw the joit pmf as a table ad the we sum the rows ad colums to get the margial pmfs: For (c) through (f) we add the probabilities i the relevat cells of the table: P (X > Y ) 3/32 P (Y 2X) 3/32 + 6/32 9/32 P (X + Y 3) 3/32 + 3/32 6/32 P (X + Y 3) P (X 3 Y ) 2/32 + 3/32 + 3/32 8/32. (g): We ote that X ad Y are ot idepedet because, for example, the joit probability P (X 1, Y 1) 2/32 is ot equal to the product of the margial probabilities P (X 1)P (Y 1) (14/32)(5/32). (h): We use tables to compute the 1st ad 2d momets of X ad Y. Here is the table for X: P (X k) 14/32 18/32 k 1 2 k 2 1 4 E[X] 1(14/32) + 2(18/32) 25/16 E[X 2 ] 1(14/32) + 4(18/32) 43/16 1 We ll talk more about these ideas after Exam2.
7 Ad here is the table for Y : 5 7 P (Y l) 32 32 9 32 11 32 l 1 2 3 4 l 2 1 4 9 25 Fially, we compute the variaces: E[Y ] 1 5 32 + 2 7 32 + 3 9 32 + 4 11 32 45/16 E[Y 2 ] 1 5 32 + 4 7 32 + 9 9 11 32 + 16 32 145/16 Var(X) E[X 2 ] E[X] 2 (43/16) (25/16) 2 63/256, Var(Y ) E[Y 2 ] E[Y ] 2 (145/16) (45/16) 2 295/256. 4.1-4. Let X be a radom umber from the set {0, 2, 4, 6, 8} ad let Z be a radom umber from the set {0, 1, 2, 3, 4}. We obseve that X ad Z are idepedet ad that each possible pair of umbers has equal probability 1/5 2 1/25. Now let Y X + Z. We expect that X ad Y are ot idepedet. To verify this we will compute the joit pmf of X ad Y. First ote that S Y {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}. We observe that each possible value of Y either has probability 0 (because it is impossible) or 1/25 (because there is exactly oe way it ca happe). Thus we obtai the followig table showig the joit ad margial pmfs of X ad Y (to save space we write P 1/25): x \ y 0 1 2 3 4 5 6 7 8 9 10 11 12 0 P P P P P 0 0 0 0 0 0 0 0 5P 2 0 0 P P P P P 0 0 0 0 0 0 5P 4 0 0 0 0 P P P P P 0 0 0 0 5P 6 0 0 0 0 0 0 P P P P P 0 0 5P 8 0 0 0 0 0 0 0 0 P P P P P 5P P P 2P 2P 3P 2P 3P 2P 3P 2P 2P P P To see that X ad Y are ot idepedet, we oly eed to observe, for example, that the joit probability P (X 2, Y 0) 0 is ot equal to the product of the margial probabilities: P (X 2)P (Y 0) (5/25)(1/25) 0. 4.2-3(a). Roll a fair 4-sided die twice. Let X equal the outcome o the first roll ad let Y equal the sum of the two rolls. Here is a table showig the margial ad joit pmfs of X ad Y (to save space we write P 1/16): x \ y 2 3 4 5 6 7 8 1 P P P P 0 0 0 4P 2 0 P P P P 0 0 4P 3 0 0 P P P P 0 4P 4 0 0 0 P P P P 4P P 2P 3P 4P 3P 2P P To compute µ X ad σ 2 x we use the margial distributio of X: E[X] 1(4P ) + 2(4P ) + 3(4P ) + 4(4P ) 5/2,
8 To compute µ Y ad σ 2 Y E[X 2 ] 1 2 (4P ) + 2 2 (4P ) + 3 2 (4P ) + 4 2 (4P ) 15/2, σ 2 X E[X 2 ] E[X] 2 (15/2) (5/2) 2 5/4. we use the margial distributio of Y : E[Y ] 2(P ) + 3(2P ) + 4(3P ) + 5(4P ) + 6(3P ) + 7(2P ) + 8(P ) 5, E[Y 2 ] 2 2 (P ) + 3 2 (2P ) + 4 2 (3P ) + 5 2 (4P ) + 6 2 (3P ) + 7 2 (2P ) + 8 2 (P ) 55/2 σ 2 Y E[Y 2 ] E[Y ] 2 (55/2) (5) 2 5/2. To compute Cov(X, Y ) we could use the joit pmf table to fid E[XY ] ad the compute Cov(X, Y ) E[XY ] µ X µ Y, but there s a better way: We will use the fact that Y X + Z where X is the umber that shows up o the first roll ad Z is the umber that shows up o the secod roll. Sice Z is idetically distributed with X we kow that Var(Z) Var(X) σx 2 5/4, as show above. The we ca use the fact that X ad Z are idepedet to compute It follows that ad hece Var(X + Y ) Var(X + X + Z) Var(2X + Z) Var(2X) + Var(Z) 2 2 Var(X) + Var(Z) 4(5/4) + (5/4) 25/4. Var(X + Y ) Var(X) + Var(Y ) + 2 Cov(X, Y ) 25/4 5/4 + 5/2 + 2 Cov(X, Y ) 10/4 2 Cov(X, Y ) 5/4 Cov(X, Y ), ρ XY Cov(X, Y ) σ X σ Y 5/4 2 5/4 5/2 2 0.707. /// What does it mea? If you flip the pmf table upside-dow (so it looks like a typical x, y- plae) the the diagoal cluster of P s is reasoably close to a straight lie with positive slope. That s why the correlatio ρ XY 0.707 is reasoably close to +1. 5.3-2. Let X 1 ad X 2 be idepedet radom variables with biomial distributios b(3, 1/2) ad b(5, 1/2), respectively. Determie (a) P (X 1 2, X 2 4). Aswer: Sice X 1 ad X 2 are idepedet we have P (X 1 2, X 2 4) P (X 1 2)P (X 2 4) ( ) ( ) 3 5 (1/2) 2 (1/2) 1 (1/2) 4 (1/2) 1 2 4 (3/2 3 )(5/2 3 ) 15/2 6 5.86%.
9 (b) P (X 1 +X 2 7). Aswer: For this oe it s helpful to draw the full pmf table. Sice X 1 ad X 2 are idepedet we compute their margial distributios ad the multiply them as follows: The evet X 1 + X 2 7 correspods to the two circled etries, so that P (X 1 + X 2 7) 3 256 + 5 256 8 256 1 32. 2.3-5. Let X 1 ad X 2 be observatios of a radom sample of size 2 from a distributio with pmf f(x) x/6 ad support x 1, 2, 3. Fid the pmf of Y X 1 + X 2. Determie the mea ad variace of Y i two differet ways. Solutio: We assume that X 1 ad X 2 are idepedet ad that each has the margial distributio x 1 2 3 P (X i x) 1/6 2/6 3/6 Thus their joit pmf is give by the followig table:
10 To compute the pmf of Y X 1 + X 2 we circle the evet Y y for each possible value of y: Ad them we add up the probabilities i each blob to obtai: Thus we have P (Y y) 1/36 4/36 10/36 12/36 9/36 y 2 3 4 5 6 y 2 4 9 16 25 36 E[Y ] 2 1 36 + 3 4 36 + 410 36 + 512 36 + 6 9 36 14 3 E[Y 2 ] 2 2 1 36 + 4 10 12 32 + 42 + 52 36 36 36 + 9 62 36 206 9 Var(Y ) E[Y 2 ] E[Y ] 2 (206/9) (14/3) 2 10 9. Alteratively, we ca first compute the mea ad variace of X 1 ad X 2 : E[X i ] 1 1 6 + 22 6 + 33 6 7 3, E[X 2 i ] 1 2 1 6 + 22 2 6 + 32 3 6 6, Var(X i ) E[X 2 i ] E[X i ] 2 6 (7/3) 2 5 9. Ad the we ca use the algebraic properties of mea ad variace to obtai E[Y ] E[X 1 + X 2 ] E[X 1 ] + E[X 2 ] 7 3 + 7 3 14 3, Var(Y ) Var(X 1 + X 2 ) Var(X 1 ) + Var(X 2 ) 5 9 + 5 9 10 9.
I the secod equatio we used the fact that X 1, X 2 are idepedet, which implies that Cov(X 1, X 2 ) 0. The fact that we got the same aswer both times meas that our aswer is correct. Also, it agrees with the aswer i the back of the book. Additioal Problems. 1. Collectig Coupos. Each box of a certai brad of cereal comes with a toy. If there are possible toys ad if they are distributed radomly, how may boxes of cereal do you expect to buy before you get them all? (a) Let X be a geometric radom variable with pmf P (X k) p(1 p) k 1. Use a geometric series to compute the momet geeratig fuctio: M(t) E[e tx ] e tk p(1 p) k 1 e t [ p e t (1 p) ] k 1? k1 (b) Compute the derivative of M(t) to fid the expected value of X: E[X] M (0)? (b) Assumig that you already have l of the toys, let X l be the umber of boxes of cereal that you buy util you get a ew toy. Observe that X l is geometric ad use this fact to compute E[X l ]. (d) Let X be the umber of boxes that you buy util you see all toys. The we have k1 X X 0 + X 1 + + X 1. Use this to compute the expected value E[X]. [Hit: See Example 2.5-5 i the textbook for the case 6.] Solutio: Suppose X has pmf P (X k) p(1 p) k 1 for k 1. The the mgf is M X (t) E[e tx ] k 1 kp (X k) e tk p(1 p) k 1 k1 e t p [ e t (1 p) ] k 1 k1 e t p [1 + e t (1 p) + (e t (1 p)) 2 + ] [ ] e t 1 p 1 e t (1 p) e t p 1 e t (1 p). To compute the expected value, we use the quotiet rule to differetiate the mgf ad the we substitute t 0: E[X] d dt M X(t) d ( e t p t0 dt 1 e t (1 p)) t0 (1 et (1 p))(e t p) (e t p)(1 e t (1 p)) (1 e t (1 p)) 2 t0 11
12 (1 et (1 p))(e t p) (e t p)( e t (1 p)) (1 e t (1 p)) 2 (1 e0 (1 p))(e 0 p) (e 0 p)( e 0 (1 p)) (1 e 0 (1 p)) 2 (1 1(1 p))(1p) (1p)( 1(1 p)) (1 1(1 p)) 2 (p)(p) p(p 1) (p) 2 p(p (p 1)) p 2 p/p 2 1/p. What does it mea? Suppose you have a coi with P (H) p. If you cotiue to flip the coi the you are most likely to see the first head o the (1/p)-th flip. Now suppose you are collectig radom toys from cereal boxes ad you already have l of the toys. Let X l be the umber of boxes you buy before you see a ew toy. I this situatio we ca thik of each cereal box as a coi flip with H ew toy ad T old toy. Sice the toys are radomly distributed this meas that P (H) ( l)/ ad P (T ) l/. Thus X l is a geometric radom variable with p ( l)/ ad we coclude that E[X l ] 1 p l. Fially, let X be the umber of cereal boxes we buy before we see all toys. This radom variable is ot geometric, but it is a sum of geometric radom variables. Sice X is the total umber of boxes ad sice X l is the umber of boxes from the l-th toy to the (l + 1)-st toy we coclude that X X 0 + X 1 + X 2 + + X 1 E[X] E[X 0 ] + E[X 1 ] + E[X 2 ] + + E[X 1 ] 0 + 1 + 2 + + + 1 + 2 + + 1. ( 1) For example, suppose we cotiue to roll a fair 6 sided die ad let X be the umber of rolls util we see all six faces. The o average we will perform t0 That was a fu problem. E[X] 6 6 + 6 5 + 6 4 + 6 3 + 6 2 + 6 1 14.7 rolls.