# Test 1 sample sol

.pdf
Stats 2D03 sample test 1 solutions October 2023 There are four problems on this test, worth 10, 10, 15, and 15 points, respectively. If you want to have a timed practice, try completing this sample midterm in an hour and 15 minutes. 1. (3+4+3 points) Consider the function defined by f ( x ) = 1 / 2 0 x < 1 2 C 1 2 x 1 0 otherwise. (a) Find the constant C that makes f ( x ) the probability density function of a continuous random variable. (b) Suppose X is a continuous random variable with probability density function f ( x ), using the constant C found in part (a). Write down the cumulative distribution function of X . (c) The median of this probability distribution is the value m such that P { X m } = 50% = P { X > m } . Find the median of this probability distribution. Solution. (a) Need R −∞ f ( x ) dx = 1. Z 1 / 2 0 1 2 dx + Z 1 1 / 2 Cdx = 1 2 x 1 / 2 0 + [ Cx ] 1 1 / 2 = 1 4 0 + C C 2 = 1 4 + C 2 = 1 , so solving for C we get C = 3 / 2. (b) For 0 t 1 2 , F ( t ) = Z t −∞ f ( x ) dx = Z t 0 1 2 dx = h x 2 i t 0 = t 2 . For 1 2 t 1 we get F ( t ) = Z 1 / 2 0 1 2 dx + Z t 1 / 2 3 2 dx = h x 2 i 1 / 2 0 + 3 x 2 t 1 / 2 = 1 4 + 3 t 2 3 4 = 3 t 1 2 . Thus, F ( t ) = 0 for t 0 , t/ 2 for 0 < t 1 / 2 , (3 t 1) / 2 for 1 / 2 < t 1 , 1 for 1 t.
(c) We want to find m so that F ( m ) = 1 / 2. Looking at the CDF above, we see F (1 / 2) = 1 / 4, while F (1) = 1, so 1 / 2 < m < 1. Thus we must solve (3 m 1) / 2 = 1 / 2. This gives m = 2 / 3. 2. (2+4+4 pts) You have a bag containing three marbles numbered 0, 1, and 2. You sample 5 times from the bag, with replacement. (a) How many outcomes are in my sample space for this experiment? (b) What is the probability that you never pick the same marble twice in a row? (c) What is the probability that the numbers that you picked add up to 5? Solution. (a) 3 5 . (b) 3 × 2 4 / 3 5 = (2 / 3) 4 . There are 3 options for the first pick and then, to avoid repeating the same pick twice in a row, only 2 options for the second pick, and likewise for the 3rd, 4th, and 5th picks. (c) There are three cases to consider: (I) 2 + 2 + 1 + 0 + 0, (II) 2 + 1 + 1 + 1 + 0, or (III) 1+1+1+1+1. For case (I), there are 5 × ( 4 2 ) possible orderings for these picks: five options for where to pick the '1', then four-choose-two options for where to pick the two '2's. For case (II), there are 5 × ( 4 3 ) orderings, and for case (III) there is only one ordering. Thus, the total probability is 5 × 4 2 + 5 × 4 3 + 1 / 3 5 . 3. (3+3+4 pts) We roll a 4-sided die 5 times. Let X denote the number of '1's rolled and let Y denote the number of '2's. (a) Compute P { X = 3 } . (b) Compute P ( { X = 0 } ∪ { Y = 0 } ) . (c) Are X and Y are independent random variables? Prove or disprove your answer. Solution. (a) X Binomial(5 , 1 / 4), so P { X = 3 } = ( 5 3 )( 1 4 ) 3 ( 3 4 ) 2 . (b) P { X = 0 } = P { Y = 0 } = ( 3 4 ) 5 , and P ( { X = 0 } ∩ { Y = 0 } ) = ( 2 4 ) 5 , since X and Y both being 0 would mean all die rolls are '3's and '4's. Thus, by inclusion-exclusion, Pr ( { X = 0 } ∪ { Y = 0 } ) = 3 4 5 + 3 4 5 2 4 5 . (c) P { X = 5 } and P { Y = 5 } are both non-zero (it is possible to roll all '1's or all '2's), but P ( { X = 5 } ∩ { Y = 5 } ) = 0, as it is impossible to get five '1's and five '2's in just five die rolls. Thus, P ( { X = 5 } ∩ { Y = 5 } ) ̸ = P { X = 5 } P { Y = 5 } , so these variables are not independent.
4. (3+3+4 pts) Aragorn and Bilbo have two coins: one is fair and the other is biased to give 'H' with 80% probability. Bilbo chooses between the two coins uniformly at random and Aragorn takes the other coin. They each flip their coin once. (a) Calculate the probability that Bilbo flips 'H'. (b) Find the conditional probability that Bilbo chose the fair coin, given that he got 'H'. (c) Find the conditional probability that Aragorn gets 'H' given that Bilbo got 'H'. Solution. (a) Let B H denote the event that Bilbo flips H, and let E denote the event that Biblo receives the biased coin. P ( B H ) = P ( E ) P ( B H | E ) + P ( E c ) P ( B H | E c ) = 1 2 × 4 5 + 1 2 × 1 2 = 13 20 = 65% . (b) P ( E c | B H ) = P ( E c ) P ( B H | E c ) P ( B H ) = 1 2 × 1 2 13 20 = 5 13 . (c) Let A H denote the event that Aragorn flips 'H'. Since E is the event that Biblo gets the biased coin, it is also the event that Aragorn gets the fair coin. Thus, P ( A H B H ) = P ( E ) P ( A H B H | E ) + P ( E c ) P ( A H B H | E c ) = 1 2 × 1 2 × 4 5 + 1 2 × 4 5 × 1 2 = 2 5 . Thus, P ( A H | B H ) = P ( A H B H ) P ( B H ) = 2 / 5 13 / 20 = 8 13 .