Homework 4 Solution, due July 23 Random Variables Problem 1. Let X be the random number on a die: from 1 to. (i) What is the distribution of X? (ii) Calculate EX. (iii) Calculate EX 2. (iv) Calculate Var X. (v) Calculate EX 3. (vi) Calculate E sin(πx). (vii) Calculate E cos(πx). (viii) Calculate E(2X 4). Solution. (i) (ii) (iii) (iv) (v) P(X = 1) = P(X = 2) = P(X = 3) = P(X = 4) = P(X = 5) = P(X = ) = 1. EX = 1 1 + 2 1 + 3 1 + 4 1 + 5 1 + 1 = 7 2 EX 2 = 1 2 1 + 22 1 + 32 1 + 42 1 + 52 1 + 2 1 = 91 Var X = EX 2 (EX) 2 = 91 EX 3 = 1 ( ) 2 7 = 35 2 12 ( 1 3 + 2 3 + 3 3 + 4 3 + 5 3 + 3) = 441 = 147 2 (vi) We have: sin(πx) 0, so E sin(πx) = 0 (vii) For odd k, we have: cos(πk) = 1. For even k, we have: cos(πk) = 1. Therefore, cos(πx) = ±1 with equal probabilities 1/2, and E cos(πx) = 1 2 1 + 1 2 ( 1) = 0 (viii) E(2X 4) = 2EX 4 = 2 7 2 4 = 3 Problem 2. Throw a die twice and let X, Y be the results. (i) What is the distribution of X + Y? (ii) Calculate E(X + Y ). (iii) Calculate E(2X 3Y ). (iv) Calculate E(XY ). (v) Calculate E(X 2 Y 2 ). (vi) Calculate Var(X + Y ). (vii) Calculate Var(XY ). (viii) Find Cov(X, X + Y ). 1
(ix) Find Cov(X Y, X + Y ). (x) Are X and Y independent? (xi) Are X and X + Y independent? Solution. (i) The table of values of X and Y (each pair of values with probability 1/3, horizontal rows correspond to the values of X, vertical rows correspond to the values of Y, inside the table: values of X + Y ): X, Y 1 2 3 4 5 1 2 3 4 5 7 2 3 4 5 7 8 3 4 5 7 8 9 4 5 7 8 9 10 5 7 8 9 10 11 7 8 9 10 11 12 Therefore, the random variable X + Y has the following distribution: Values 2 3 4 5 7 8 9 10 11 12 Probabilities 1/3 2/3 3/3 4/3 5/3 /3 5/3 4/3 3/3 2/3 1/3 (ii) E(X + Y ) = EX + EY = 7/2 + 7/2 = 7 (iii) E(2X 3Y ) = 2EX 3EY = 2(7/2) 3(7/2) = 7/2 (iv) Since X and Y are independent, E(XY ) = EXEY = (7/2) 2 = 49/4 We also used that X and Y have the same distribution, so EX = EY = 7/2. ( ) 2 91 (v) Since X and Y are independent, E(X 2 Y 2 ) = EX 2 EY 2 = We also used that X and Y have the same distribution, so EX 2 = EY 2 = 91/. (vi) Since X and Y are independent, and identically distributed, so they have the same variance, Var(X + Y ) = Var X + Var Y = 35 + 35 = 35 12 12 (vii) Var(XY ) = E(XY ) 2 [E(XY )] 2 = (91/) 2 (49/4) 2 = 11515/144 (viii) Cov(X, X + Y ) = Cov(X, X) + Cov(X, Y ). But Cov(X, Y ) = 0, because X and Y are independent, and Cov(X, X) = Var X = 35/12. Therefore, Cov(X, X + Y ) = 35/12 (ix) Cov(X Y, X + Y ) = Cov(X, X) Cov(Y, X) + Cov(X, Y ) Cov(Y, Y ) = Var X Var Y = 0 (x) Yes, by the setting of the problem (because a die does not have a memory). (xi) No, because Cov(X, X + Y ) 0. Problem 3. Show that for every random variable X and every real numbers a, b, we have: E(aX + b) = aex + b and Var(aX + b) = a 2 Var X. Solution. For random variable X defined on a probability space Ω, if p(ω) is the probability of an elementary outcome ω Ω, we have: E(aX + b) = ω Ω (ax(ω) + b)p(ω) = ω Ω (ax(ω)p(ω) + bp(ω)) 2
= a X(ω)p(ω) + b p(ω) = aex + b, ω Ω ω Ω because probabilities of all elementary outcomes add up to 1: p(ω) = 1. Moreover, ω Ω Var(aX + b) = E((aX + b) E(aX + b)) 2 = E(aX + b aex b) 2 = a 2 E(X EX) 2. Problem 4. Toss a fair coin 3 times. Let X be the total number of heads. (i) What is the probability space Ω? (ii) What is the distribution of X? Solution. (i) Ω = {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT}. (ii) P(X = 0) = 1/8, P(X = 1) = 3/8, P(X = 2) = 3/8, P(X = 3) = 1/8. Problem 5. (A game from the Wild West) You bet one dollar and throw three dice. If at least one of them is six, then I return you your dollar and give you as many dollars as the quantity of dice which resulted in six. For example, if there are exactly two dice which gave us six, then you win two dollars. If you do not get any dice with six, then you lose your dollar. So you either lose 1$ or win 1$, 2$ or 3$. What is the expected value of the amount you win? Solution. Let X be the amount you win. X = 1 if there are no six; X = 1 if there is exactly one six; X = 2 if there are two six; X = 3 if all three dice are six. Therefore, X = 1 if at each of the three die, there is one of five numbers 1, 2, 3, 4, 5. So P(X = 1) = ( 5 ) 3 = 125 21. Similarly, X = 1 if one die has six (this die can be chosen in ( 3 1) ways), and two other dice have one of five numbers 1, 2, 3, 4, 5. Therefore, ( ) 3 5 5 1 P(X = 1) = 1 = 75 21. Similarly, X = 2 if two dice have six (these dice can be chosen in ( 3 2) ways), and one other die has one of five numbers 1, 2, 3, 4, 5. Therefore, ( ) 3 5 1 1 P(X = 2) = 2 = 15 21. Finally, X = 3 if all three dice have six. So Thus, P(X = 3) = ( ) 3 1 = 1 21. EX = ( 1) P(X = 1) + 1 P(X = 1) + 2 P(X = 2) + 3 P(X = 3) 3
= 125 21 + 75 21 + 30 21 + 3 21 = 17 21 Problem. An urn contains 11 balls, 3 white, 3 red, and 5 blue balls. Take out two balls at random, without replacement. You win $1 for each red ball you select and lose a $1 for each white ball you select. Determine the distribution of X, the amount you win. Solution. In the solution, we assume that the order of these two balls does not matter. You can solve it in the opposite assumption: that order does matter. But you should be consistent during the solution and stick to one of these two assumptions. If order matters, then numerator and denominator in all fractions here must be multiplied by 2. Total number of choices (if the order of the balls does not matter): ( ) 11 11 10 = = 55. 2 2 Number of choices so that two balls are white (and X = 2): ( 3 2) = 3. Number of choices so that two balls are red (and X = 2): ( 3 2) = 3. Number of choices so that one ball is red, one is white (and X = 0): ( 3 3 1)( 1) = 9. Number of choices so that two balls are blue (and X = 0): ( 5 2) = (5 4)/2 = 10. Number of choices so that one ball is blue, one is white (and X = 1): ( 5 3 1)( 1) = 15. Number of choices so that one ball is blue, one is red (and X = 1): ( 5 3 1)( 1) = 15. Thus, the distribution of X is as follows: Values -2-1 0 1 2 Probabilities 3/55 15/55 19/55 15/55 3/55 Problem 7. An urn contains 10 balls numbered 1,..., 10. Select 2 balls at random, without replacement. Let X be the smallest number among the two selected balls. (i) Determine the distribution of X. (ii) Find EX and Var X. (iii) Find P(X 3). Solution. In the solution, we assume that the order of these two balls does not matter. You can solve it in the opposite assumption: that order does matter. But you should be consistent during the solution and stick to one of these two assumptions. If order matters, then numerator and denominator in all fractions here must be multiplied by 2. (i) X can take values 1,..., 9. If X = k, then one of the balls is k, the other is larger: from k + 1 to 10. So there are 10 k possibilities for the selection so that X = k (if the order of the balls does not count). Total number of selection is ( 10 2 ) = 45. Thus, P(X = k) = 10 k, k = 1,..., 9 45 (ii) EX = 9 k=1 k 10 k 45 4
And EX 2 = 9 (iii) = 1 (1 9 + 2 8 + 3 7 + 4 + 5 5 + 4 + 7 3 + 8 2 + 9 1) 45 k=1 k 2 10 k 45 = 55/3. Therefore, Var X = 55 3 = 15 45 = 11 3 ( ) 2 11 = 44/9 3 P(X 3) = P(X = 1) + P(X = 2) + P(X = 3) = 9 45 + 8 45 + 7 45 = 8 15 Problem 8. If Var X = 0 and EX = 3, then what can you say about the random variable X? Solution. That X = 3 always. Indeed, Var X = E(X EX) 2 = E(X 3) 2 = 0, but (X 3) 2 0. So (X 3) 2 = 0, and X = 3. Problem 9*. An insurance company determines that N, the number of claims received in a week, is a random variable with P(N = n) = 1, n = 0, 1, 2,.... 2n+1 The company also determines that the number of claims received in a given week is independent of the number of claims received in any other week. Determine the probability that exactly 7 claims will be received during a given two-week period. Solution. Let N 1 and N 2 be the number of claims received in the first week and in the second week, respectively. They are independent identically distributed variables. Therefore, we need to find P(N 1 + N 2 = 7). We have: P(N 1 + N 2 = 7) = = 7 k=0 7 P(N 1 = k)p(n 2 = 7 k) k=0 1 1 7 2 k+1 2 = 1 (7 k)+1 2 = 8 9 2 = 1 9 4 Problem 10*. The number of injury claims per month is modeled by a random variable N with 1 P(N = n) =, n = 0, 1, 2,... (n + 1)(n + 2) k=0 5
Determine the probability of at least one claim during a particular month, given that there have been at most four claims during that month. But Solution. This is equal to and similarly Thus, P(N 1 N 4) = P(1 N 4). P(N 4) P(1 N 4) = 1 2 3 + 1 3 4 + 1 4 5 + 1 5 = 1 3, P(N 4) = 1 1 2 + 1 2 3 + 1 3 4 + 1 4 5 + 1 5 = 5. P(N 1 N 4) = 1/3 5/ = 2 5 Problem 11. Consider the following two variables: X, Y, with distribution (i) Find the distribution of X. (ii) Find the distribution of Y. (iii) Calculate EX. (iv) Calculate EY. (v) Calculate E(XY ). (vi) Calculate EX 2. (vii) Calculate EY 2. (viii) Calculate Var X. (ix) Calculate Var Y. (x) Calculate E(X 2 Y ). (xi) Calculate Cov(X, Y ). (xii) Are X and Y independent? P(X = 1, Y = 1) = 0.2, P(X = 2, Y = 1) = 0.3, P(X = 1, Y = 3) = 0.1, P(X = 2, Y = 3) = 0.4. Solution. (i) P(X = 1) = 0.3, P(X = 2) = 0.7. (ii) P(Y = 1) = 0.5, P(Y = 3) = 0.5. (iii) EX = ( 1) 0.3 + 2 0.7 = 1.1 (iv) EY = 1 0.5 + 3 0.5 = 2 (v) E(XY ) = ( 1) 1 0.2 + ( 1) 3 0.1 + 2 1 0.3 + 2 3 0.4 = 3.1 (vi) EX 2 = ( 1) 2 0.3 + 2 2 0.7 = 3.1 (vii) EY 2 = 1 2 0.5 + 3 2 0.5 = 5 (viii) Var X = EX 2 (EX) 2 = 3.1 1.1 2 = 1.89 (ix) Var Y = EY 2 (EY ) 2 = 5 2 2 = 1 (x) E(X 2 Y ) = ( 1) 2 1 0.2 + ( 1) 2 3 0.1 + 2 2 1 0.3 + 2 2 3 0.4 =.5 (xi) Cov(X, Y ) = E(XY ) EXEY = 3.1 1.1 2 = 0.9 (xii) No, X and Y are not independent, because their covariance is not equal to zero.
Review Exercises Problem 12. formula true? How do we define the binomial coefficient ( n k)? Why is the following ( ) n n! = k k!(n k)!. Solution. This binomial coefficient is defined as the quantity of subsets of k elements of the set {1,..., n} (or any set of n elements). We can choose the first element in n ways, the second element in n 1 ways, etc. the kth element in n k + 1 ways, and so the number of choices equals n(n 1)... (n k + 1) = n!/(n k)! But a set is not an arrangement: order of elements does not matter. So we should divide by the number of permutations of these k elements: k!. This completes the proof. Problem 13. Explain why ( ) n + 0 ( ) n +... + 1 ( ) n = 2 n. n Solution. Because these are two different ways to count the number of all subsets of {1,..., n}. On one hand, the first element can be included or not included in the set, so this opens two possibilities; the same is with the second, third, etc. so the total number of subsets is the product of n twos, that is, 2 n. On the other hand, how many elements can contain this potential subset? There are ( n k) subsets of k elements, for every k = 0,..., n. The sum of those binomial coefficients gives us the total number of subsets. This completes the proof. Problem 14. An item is defective (independently of other items) with probability 0.3. You have a method of testing whether the item is defective, but it does not always give you correct answer. If the tested item is defective, the method detects the defect with probability 0.9 (and says the item is OK with probability 0.1). If the tested item is good, then the method says it is defective with probability 0.2 (and gives the right answer with probability 0.8). A box contains 3 items. You have tested all of them and the tests detect no defects. What is the probability that none of the 3 items is defective? Solution. Let us solve the problem for one item instead of three. Let F 1 = {item is not defective}, F 2 = {item is defective}, A = {test said OK}. Then P(F 1 ) = 0.7, P(F 2 ) = 0.3, P(A F 1 ) = 0.8, P(A F 2 ) = 0.1. Therefore, by the second Bayes formula P(F 1 A) = P(F 1 ) P(A F 1 ) P(F 1 ) P(A F 1 ) + P(F 2 ) P(A F 2 ) = 5 59. This is the probability that one item, which is tested OK, is really OK. Since we have three independent items, which are all tested OK, the probability that there are indeed OK is (5/59) 3 0.855 7
Problem 15. Roll a die 8 times. Find the probability that you get three 1, two 2 and three 3. Solution. The quantity of choices for these rolls of a die is the same as the quantity of rearrangements for the word 11122333. This is 8! 3!2!3!. This many elementary outcomes (sequences of eight rolls of a die) give us three 1, two 2 and three 3. Each elementary outcome has probability 1/ 8. Therefore, the probability that you get three 1, two 2 and three 3 is 8! 8 3!2!3! Problems from old actuarial exams are marked by a star. 8