Exercses of Chapter Chuang-Cheh Ln Department of Computer Scence and Informaton Engneerng, Natonal Chung Cheng Unversty, Mng-Hsung, Chay 61, Tawan. Exercse.6. Suppose that we ndependently roll two standard sx-sded dce. Let X 1 be the number that shows on the frst de, X the number on the second de, and X the sum of the numbers on the two dce. (a) What s E[X X 1 s even]? (b) What s E[X X 1 X ]? (c) What s E[X 1 X 9]? (d) What s E[X 1 X X k] for k n the range [, 1]? Soluton. (a) E[X X 1 s even] 1 Pr[X X 1 s even] 1 Pr[{X } {X 1 {, 4, 6}}] Pr[X 1 {, 4, 6}] 1 0 + 0 + 3 1/36 1/ + 4 1/36 1/ + 5 /36 1/ + 6 /36 1/ + 7 3/36 1/ +8 3/36 1/ + 9 /36 /36 1/36 1/36 + 10 + 11 + 1 1/ 1/ 1/ 1/ 135 18 15. Emal address: lncc@cs.ccu.edu.tw 1
(b) Pr[X X 1 X ] 6 () Pr[X X 1 X ] 1/36 6/36 + 4 1/36 6/36 + 6 1/36 6/36 + 8 1/36 6/36 7. 1/36 1/36 + 10 + 1 6/36 6/36 (c) E[X 1 X 9] 6 Pr[X 1 X 9] 1 18 4 9. 0 4/36 + 0 4/36 + 3 1/36 4/36 + 4 1/36 4/36 + 5 1/36 4/36 + 6 1/36 4/36 (d) By the lnearty of condtonal expectaton, we have Note that So we have E[X 1 X X k] E[X 1 X k] E[X X k]. Pr[X 1 X j] Pr[X 1 ] Pr[X j] (snce X 1 and X are ndependent) 1 6 1 6 Pr[X 1 j] Pr[X ] Pr[X 1 j X ].
Pr[X 1 X k] Pr[{X 1 } {X k } X k] Pr[{X 1 } {X k } {X k}] Pr[X k] Pr[{X 1 } {X k }] Pr[X k] Pr[{X 1 k } {X }] Pr[X k] Pr[{X 1 k } {X } {X k}] Pr[X k] Pr[X X k]. Therefore, E[X 1 X X k] E[X 1 X k] E[X X k] 6 6 Pr[X 1 X k] Pr[X X k] 0. Exercse.7. Let X and Y be ndependent geometrc random varables, where X has parameter p and Y has parameter q. (a) What s the probablty that X Y? (b) What s E[max(X, Y )]? (c) What s Pr[mn(X, Y ) k]? (d) What s E[X X Y ]? Soluton. (a) Note that {X Y } 1 ({X } {Y }), and ({X 1} {Y 1}), ({X 3
} {Y }),... are mutually dsjont. Then we have the followng deducton: [ ] Pr[X Y ] Pr ({X } {Y }) 1 Pr[{X } {Y }] 1 Pr[{X }] Pr[{Y }] (snce X, Y are ndependent) 1 1(1 p) 1 p (1 q) 1 q pq 1 ((1 p)(1 q)) 1 1 pq 1 (1 p)(1 q) pq p + q pq. (snce (1 p)(1 q) < 1) (b) E[max(X, Y )] x 1 y 1 xpr[{x x} {Y y}] + ypr[{x x} {Y y}] x1 y1 y1 x1 + x 1 xpr[{x x} {Y x}] x 1 x(1 p) x 1 p(1 q) y 1 q + x1 y1 + pq p x(1 p) x 1 p(1 q) x 1 q x1 +pq x 1 x(1 p) x 1 (1 q) y 1 + pq x1 y1 x((1 p)(1 q)) x 1 x1 x(1 p) x 1 (1 (1 q) x 1 ) + q x1 pq + (p + q pq) A + B + C, y 1 y(1 p) x 1 p(1 q) y 1 q y1 x1 y 1 y(1 q) y 1 (1 p) x 1 y1 x1 y(1 q) y 1 (1 (1 p) y 1 ) y1 4
where ( A p x(1 p) x 1 x1 ( B q y(1 q) y 1 C y1 pq (p + q pq). ) x[(1 p)(1 q)] x 1 x1 ) y[(1 p)(1 q)] y 1 y1 A Smlarly we have B 1 q 1. p+q pq x(1 p) x 1 1 p p (p + q pq) x1 1 p p (p + q pq). q (p+q pq). Thus E[max(X, Y )] A + B + C 1 p + 1 q (c) Pr[mn(X, Y ) k] Pr[{X k} {Y k + 1}] + Pr[{Y k} {X k + 1}] +Pr[{Y k} {X k}] p(1 p) k 1 (1 q) k + q(1 q) k 1 (1 p) k + ((1 p) k 1 p) ((1 q) k 1 q) (1 p) k 1 (1 q) k 1 (p + q pq). (d) Thanks for Dr. Ton Kloks for gvng us the followng arguments. Frst we note that Pr[{X x} {Y x}] Pr[{X x} {Y y}] (Law of total probabllty) y x Pr[X x] Pr[Y y] y x Pr[X x] Pr[Y y] y x Pr[X x] Pr[Y x]. Hence we have 5
E[X X Y ] x Pr[X x Y x] x1 x x1 x x1 Pr[{X x} {Y x}] Pr[Y x] Pr[X x] Pr[Y x] Pr[Y x] x Pr[X x] x1 1 p. (snce X, Y are ndependent) Actually, we can smply derve E[X X Y ] E[X] 1/p snce X and Y are ndependent random varables. Exercse.8. (a) Alce and Bob decde to have chldren untl ether they have ther frst grl or they have k 1 chldren. Assume that each chld s a boy or grl ndependently wth probablty 1/ and that there are no multple brths. What s the expected number of female chldren that they have? What s the expected number of male chldren that they have? (b) Suppose that Alce and Bob smply decde to keep havng chldren untl they have ther frst grl. Assumng that ths s possble, what s the expected umber of boys that they have? Soluton. Let X, X g, X b be random varables denotng the number of chldren they have, the number of grls they have, and the number of boys they have respectvely (untl ether they have ther frst grl or they have k 1 chldren). Hence t s clear that X X g +X b. (a) From the descrpton of the problem, we know that Pr[X g ] 0 for. Let G be the event that ther th chld s a grl, and let B be the event that ther th chld s a boy. So we know {X g 1} k ({X } G ). Thus we obtan that E[X g ] 0 Pr[X g 0] + 1 Pr[X g 1] 1 (1 k ) (1 k ). Before calculate E[X b ], we calculate E[X b ] so that E[X b ] can be obtaned by E[X b ] E[X] E[X g ]. Note that ( k 1 p 1 d k 1 ) p dp d ( ) p(1 p k 1 ) dp 1 p 1 kpk 1 + (k 1)p k (1 p). 6
When p 1/, from the above equalty we have k 1 ( ) 1 1 k 1 ( Now t s clear that k E[X] Pr[X ] ) 1 ( 1 1 ( ) k 3 1 4 k + (k 1) ( ) k 1 1 (k + 1). ( ) ) k 1 k 1 Pr[{frst 1 are boys and the th one s a grl}] + k Pr[{frst k 1 are boys and the kth one s a boy or a grl}] ( k 1 ( ) 1 ( ) ) ( ) k 1 1 1 1 + k ( ) k 1 1. Hence we derve that E[X b ] E[X] E[X g ] (1/) k 1 (1 k ) 1 k. (b) By the assumpton that t s possble for Alce and Bob to have ther frst grl whle keepng havng chldren, we calculate E[X b ] as follows. E[X b ] Pr[X b ] Pr[X + 1] ( ) 1 ( ) 1 1. ( ) +1 1 0 ( ) 1 1 1 (1 1/) Note that when x < 1, we have 0+1+x+3x +... d dx (1+x+x +x 3 +...) 1 (1 x). We can also use the result of (a) and take ts lmt when k, then we wll have lm k (1 k ) 1. 7
Exercse.18. The followng approach s often called reservor samplng. Suppose we have a sequence of tems passng by one at a tme. We want to mantan a sample of one tem wth the probablty that t s unformly dstrbuted over all the tems that we have seen at each step. Moreover, we want to accomplsh ths wthout knowng the total number of tems n advance or storng all of the tems that we see. Consder the followng algorthm, whch stores just one tem n memory at all tmes. when the frst tem appears, t s stored n the memory. When the kth tem appears, t replaces the tem n memory wth probablty 1/k. Explan why ths algorthm solves the problem. Soluton. Let p be the probablty that the th tem s stored n the memory when k tems have been seen. For 1 k, we have p 1 1 1 3... k 1 1 k k p 1 3 3 4... k 1 1 k k. p 1 + 1 + 1 +... k 1 k 1 k. Thus each of the k tems we have seen has the same probablty of beng stored n the memory,.e., they are unformly dstrbuted over all the tems we have seen. Snce each tme only one tem s stored by the algorthm, the algorthm really solves the problem. Exercse.5. A blood test s beng performed on n ndvduals. Each person can be tested separately, but ths s expensve. Poolng can decrease the cost. The blood samples of k people can be pooled and analyzed together. If the test s negatve, ths one test suffces for the group of k ndvduals. If the test s postve, then each of the k persons must be tested separately and thus k + 1 total tests are requred for the k people. Suppose that we create n/k dsjont groups of k people (where k dvdes n) and use the poolng method. Assume that each person has a postve result on the test ndependently wth probablty p. (a) What s the probablty that the test for a pooled sample of k people wll be postve? (b) What s the expected number of tests necessary? (c) Descrbe how to fnd the best value of k. (d) Gve an nequalty that shows for what values of p poolng s better than just testng every ndvdual. Soluton. (a) Snce a pooled sample has a negatve result of testng only when everyone n the pooled sample has a negatve result of testng, we obtan the probablty that the test for a pooled sample of k people s postve s 1 (1 p) k. 8
(b) Let X be a random varable denotng the number of tests for group, where 1,,..., n/k. Let X be a random varable denotng the total number of test necessary. We can derve that Pr[X k +1] 1 (1 p) k and Pr[X 1] (1 p) k. Hence we have n/k E[X] E X n/k E[X ] n/k ( (k + 1)[1 (1 p) k ] + 1 (1 p) k) (k + 1)(n/k) n(1 p) k n (1 + 1k ) (1 p)k. (c) Let g(p, k) 1 + 1/k (1 p) k. The dervatve of g wth respect to k s f(p, k) d 1 g(p, k) dk k (1 p)k ln(1 p). Our goal s to fnd the mnmum of g(p, k), and ths can be done by settng the frst dervatve of g(p, k) wth respect to k equal to 0. Consder the case that p s very small. Recall that the Taylor seres (Maclaurn seres) for ln(1 x) s ln(1 x) x, for x 1, x 1, so ln(1 p) can be approxmated by p. Besdes, (1 p) k s close to 1 snce p s small. We can approxmate ln(1 p) and (1 p) k by p and 1 respectvely, so we can approxmate f(p, k) by 1/k + p. Let f(p, k) 0 we have the equalty k (1 p) k ln(1 p)+1 0. By the prevous approxmatons of some terms, we have k 1 ( p) + 1 0, hence we obtan that k 1/ p. Snce 1/k + p s smaller than 0 when k < 1/ p and greater than 0 when k > 1/ p, t s clear that we can obtan a mnmum value of E[X] by takng 1/ p to be the value of k. As to further dscussons, for example, the cases about the value of p, please refer to [1, ] for more detaled analyss. (d) Let h(k, n, p) n ( 1 + 1 k (1 p)k) n n ( 1 k (1 p)k). That s, h(k, n, p) s the dfference between the poolng method and just testng every ndvdual. Let h(k, n, p) < 0 we have 1 k (1 p)k < 0. Therefore, we derve that p < 1 (1/k) 1/k. 9
References [1] W. Feller: An Introducton to Probablty Theory and Its Applcatons, Vol. I, 3rd edton, John Wley, New York, 1968. [] D. W. Turner, F. E. Tdmore, and D. M. Young: A calculus based approach to the blood testng problem. SIAM Revew 30 (1988) 119 1. 10