Stat 333 Prac Midterm 1 Solns-merged PDF

Summary

This document contains solutions to a midterm exam in a statistics class. It covers topics like the expected value and variance of random variables, as well as concepts like renewal theory. The exam problems are related to a Harry Potter theme.

Full Transcript

STAT 333 Test SOLUTIONS 1. Harry Potter is trapped in the Department of Mysteries. Three doors lead out from his room, one returning back to the centre after 6 minutes, one returning back to the centre after 9 minutes, and one leading to his goal (the Hall of Prophecies) after 20 minutes. Unf...

STAT 333 Test SOLUTIONS 1. Harry Potter is trapped in the Department of Mysteries. Three doors lead out from his room, one returning back to the centre after 6 minutes, one returning back to the centre after 9 minutes, and one leading to his goal (the Hall of Prophecies) after 20 minutes. Unfortunately, every time he enters the centre room, the doors randomly spin around so he cannot remember which doors have been tried already, so he chooses randomly. a) Let X = the number of minutes to reach his goal. Find E[X]. Let D be the door Harry chooses. E[X|D = 1] = E[6 + X1] = 6 + E[X] since X1 ~ X E[X|D = 2] = E[9 + X1] = 9 + E[X] since X1 ~ X E[X|D = 3] = 20 So E[X] = E[E[X|D] = E[X|D = 1]P(D = 1) + E[X|D = 2]P(D = 2) + E[X|D = 3]P(D = 3) = (6 + E[X]) (1/3) + (9 + E[X]) (1/3) + 20 (1/3) = 35/3 + (2/3)E[X] So E[X] = 35 minutes b) Find Var(X). E[X2|D = 1] = E[(6 + X1)2] = 36 + 12E[X] + E[X2] since X1 ~ X E[X2|D = 2] = E[(9 + X1)2] = 81 + 18E[X] + E[X2] since X1 ~ X E[X2|D = 3] = 202 = 400 So E[X2] = E[E[X2|D] = E[X2|D = 1]P(D = 1) + E[X2|D = 2]P(D = 2) + E[X2|D = 3]P(D = 3) = (36 + 12E[X] + E[X2])(1/3) + (81 + 18E[X] + E[X2])(1/3) +400(1/3) = 1567/3 + (2/3)E[X2] since E[X] = 35 2 So E[X ] = 1567 And Var(X) = E[X2] – E[X]2 = 1567 – 352 = 342 c) Harry’s friend Hermione figures out a way to label the doors so they will not try the same door twice. Describe how you would find E[X] and Var(X) in this case. (No calculations are necessary.) There are a number of ways to do this. The easiest way would be to list out all possible paths Harry could take. There are only 5 cases if he can never choose the same door twice: 1, 2, 3 (prob 1/6), 1, 3 (prob 1/6), 2, 1, 3 (prob 1/6), 2, 3 (prob 1/6), and 2 (prob 1/3). Then the expected value and variance can be calculated from first principles. 2. X and Y are continuous random variables with joint probability density function (pdf) given ∞ α α −1 − λx λ x e by f ( x, y ) = x 2 y e − xy , x > 0, y > 2. You may want a gamma function: ∫ dx = 1 , α ε Z+ 0 (α − 1)! a) Find f (y), the marginal pdf of Y. ∞ ∞ f(y) = ∫ f ( x , y ) dx = ∫ x ye dx 2 − xy 0 0 ∞ (3 − 1)! y 3 x 3−1e − ( y ) x y 2 ∫0 (3 − 1)! = dx 2 = , y>2 y2 b) Find f (x| y), the conditional pdf of X given Y = y. f ( x, y ) x 2 ye − xy f ( x | y) = = f ( y) 2 / y2 = 12 x 2 y 3e − xy , x > 0 c) Find E[X|Y = y]. ∞ ∞ E[X|Y = y] = ∫ xf ( x | y ) dx = ∫ x 2 x y e dx 1 2 3 − xy 0 0 ∞ ( 4 − 1)! y 4 x 4 −1e − ( y ) x 2 y ∫0 ( 4 − 1)! = dx 6 3 = = 2y y d) Write down E[X|Y]. Explain (briefly) why E[X|Y] is a random variable. E[X|Y] = 3/Y. It is a random variable because it is a function of Y. We let y vary over the range of Y according to f(y). e) Use double-averaging to obtain E[X]. ∞ E[X] = E[E[X|Y]] = ∫ E[ X | Y = y ] f ( y )dy 2 ∞ 3 2 =∫ dy 2 y y2 ∞  −1  = 6  2  = 6 / 23 = 0.75  2 y 2 3. Suppose we toss a fair coin (P(H) = ½) until we observe one H, and let Y be the number of tosses required. Then we toss a second biased coin (with P(H) = p) until we observe Y heads, and let X be the number of tosses required for this new event. Recall that the mean and variance of a NB(r, p) random variable are r/p and r(1 – p)/p2 a) What are the conditional distribution and conditional range of X | Y = y? X | Y = y ~ NB (y, p) range: {y, y+1, y+2, …} b) Find P(X < 3) P(X < 3) = P(X = 1) + P(X = 2) = P(X = 1|Y = 1)P(Y = 1) + P(X = 2|Y = 1)P(Y = 1) + P(X= 2|Y= 2)P(Y= 2) = p(1/2) + (1 – p)p(1/2) + p2(1/2)2 = p – p2/4 c) Find E[X] E[X] = E[E[X|Y]] by double-averaging = E[Y/p] since the mean of a NB(y, p) is y/p = E[Y]/p = 2/p since the mean of a Geo(½) is 1/ ½ = 2 d) Find Var(X) Var(X) = E[Var(X|Y)] + Var(E[X|Y]) by conditional variance = E[Y(1 – p)/p2] + Var(Y/p) since the variance of a NB(y, p) is y(1– p)/p2 = E[Y](1 – p)/p2 + Var(Y)/p2 = 2(1 – p)/p2 + 2/p2 since the variance of a Geo(½) is (1 – ½)/(½)2 = 2 = (4 – 2p)/p 4. Suppose an infinite sequence of letters are selected randomly from the set {A, B, C, D, R} a) Find the expected # of trials until the first occurrence of the word “ABRACADABRA” Delayed renewal event with maximum overlap “ABRA” So TABRACADABRA = TABRA + T ABRACADABRA But “ABRA” is delayed renewal too with maximum overlap “A” So TABRACADABRA = TA + T +T ABRA ABRACADABRA 4 11 =5+5 +5 using the Renewal Theorem = 48,828,755 b) Derive the pgf FABRA(s) of the waiting time until we first observe “ABRA” Delayed renewal sequence: d0 = 0, d1 = d2 = d3 = 0, dn = (1/5)4, for n ≥ 4. Associated renewal sequence: r0 = 1, r1 = r2 = 0, r3 = (1/5)3, rn = (1/5)4 for n ≥ 4. So DABRA(s) = [s4/625]/(1 – s) 3 4 3 4 R ABRA (s) = 1 + s /125 + [s /625]/(1 – s) = [1 – s + (1 – s)s /125 + s /625]/(1 – s) So FABRA(s) = [s4/625]/[1 – s + (1 – s)s3/125 + s4/625] c) Find the probability that “ABRA” occurs for the first time on trial 7. (Hint: you can do this without expanding FABRA(s)) We want f7 = P(“ABRA” occurs for the first time on trial 7) We need _ _ _ A B R A but not A B R A B R A since in that case it has occurred first on 4. So f7 = P(“ABRA” occurs on trial 7) – P(“ABRA” occurs on 7 and 4) = (1/5)4 – (1/5)7 = 0.0015872 d) What two things are required for a delayed renewal event to occur infinitely often? The event must occur at least once with probability 1, and The associated renewal event must be recurrent (occur infinitely often) 5. Diana is playing poker at a casino. She wins or loses $10 per hand, and her probability of winning each hand is 0.48. She starts with $150. a) What is the expected number of games until she goes bankrupt? We want E[T15, 0] which is the same as E[T0, -15] in a random walk. E[T0, -15] = 15 E[T0, -1] = 15/[q – p] reverse roles of p and q since moving to the left = 15/.04 = 375 b) What is the probability she reaches a wealth of $400 before going bankrupt? Now this is gambler’s ruin with i = 15 and k = 40. P(40 before 0) = (1 – (.52/.48)15) / (1 – (.52/.48)40) = 0.0985 c) Suppose the casino will let Diana go arbitrarily far into debt. Now what is the probability she ever reaches $400? Now we just want the first passage time f15, 40 which is the same as f0, 25 in a random walk. f0, 25 = (f0,1)25 = (p/q)25 = (0.48/.052)25 = 0.1352 d) Without doing any calculations, what is the expected waiting time (in the scenario presented in c) until she reaches $400. Why? It will be ∞ since there is a positive probability that she will never reach $400. The event is transient. 6. BONUS QUESTION – only attempt if you are done with your answers to all other questions a) Why are recurrent events more useful than transient events? They will occur an infinite number of times so we can examine long-run behaviour of these events. Transient events will eventually stop occurring at some time in the future. b) List and briefly describe all the ways you can show that a renewal event is recurrent. - Find fλ and check that it is 1 - Sum the renewal sequence and check that E[Vλ] = ∞ - Find the generating function Fλ(s) and check that F(1) = 1 - Find E[Tλ] and check that it is finite (which shows positive recurrence, a stronger result) STAT 333 Spring 2010 Test 1 Thurs, June 10, 2:30 – 4:00 pm First (given) name:__________________ Last (family) name:____________________ Student ID #:__________________ UW userid:____________________ Instructions: 1. Please fill in the above information 2. This test has 7 pages, including this cover page 3. Answer all questions in the space provided 4. You have 90 minutes for the test 5. Show all your work and justify your steps 6. Good luck! Question Marks available Marks obtained 1 9 2 13 3 10 4 8 5 8 6 12 Total 60 1. Harry Potter is trapped in the Department of Mysteries. Three doors lead out from the centre room, one returning back to the centre after 2 minutes, one returning back to the centre after 4 minutes, and one leading to his goal (the Hall of Prophecies) after 10 minutes. Unfortunately, every time he enters the centre room, the doors randomly spin around so he cannot remember which doors have been tried already, so he chooses randomly. a) Let X = the number of minutes to reach his goal. Find E[X]. b) Find Var(X). c) Harry’s friend Hermione figures out a way to label the doors so they will not try the same door twice. Describe how you would find E[X] and Var(X) in this case. (No calculations are necessary.) 2. X and Y are continuous random variables with joint probability density function (pdf) given ∞ α α −1 − λx λ x e x, y ) x 2 y e − xy , x > 0, y > 2. You may want a gamma function: ∫ by f (= dx = 1 , α ε Z+ 0 (α − 1)! a) Find f (y), the marginal pdf of Y. b) Find f (x| y), the conditional pdf of X given Y = y. c) Find E[X|Y = y]. d) Write down E[X|Y]. Explain (briefly) why E[X|Y] is a random variable. e) Use double-averaging to obtain E[X]. 3. Suppose the marks you and the 173 other students get on this test (expressed as a fraction) are independent continuous U(0,1) random variables. (Not realistic, but go with it.) Let your mark be Y and let X be the number of other students who get lower marks than you. Recall: for U ~ U(0,1), the pdf f(u) = 1 and cdf F(u) = u. a) Find the probability you get the highest mark (i.e. P(X=173)) by any legitimate method. b) Given that your mark is y, find E[X|Y = y]. c) Find E[X]. Explain your result using symmetry arguments. 4. Suppose you have two boxes, one which contains 2 white balls and 1 black ball, and the other 2 white and 2 black. You randomly choose a box, take a random ball from it, and transfer it to the other box. a) What is the probability that the transferred ball is white? b) Without knowing the colour of the transferred ball, you randomly select a ball from the box that now contains the transferred ball. Show that the probability that the selected ball is white is 0.579. Hint: There are four cases to consider. c) Given that the selected ball is white, what is the probability that a white ball was transferred? You may use the result in part b. 5. For each of the following probability generating functions (pgfs), determine if the associated random variable is improper, null proper, or short proper. Show your work and circle your answer at the right. You may need to check two conditions for some variables. If it is short proper, also determine the Variance. a) GW(s) = s3 improper null proper short proper: (Var(W) = ________) b) GX(s) = 6/π2(s + s2/4 + s3/9 + s4/16 + …) improper null proper short proper: (Var(X) = ________) c) GY(s) = (1/3) / (1 – s/2) improper null proper short proper: (Var(Y) = ________) d) GZ(s) = e λs – λ improper null proper short proper: (Var(Z) = ________) 6. Suppose we toss a biased coin (with P(head) = p) until we observe r heads, and let Y be the number of tosses required. Then we toss a different fair coin (with P(head) = ½) Y times, and let X be the number of heads tossed on this second coin. Recall: For NB(r, p), mean = r/p and variance = r(1 – p)/p2 For Bin(n, p), mean = np and variance = np(1 – p) a) What are the conditional distribution and conditional range of the rv X | Y = y? b) Find P(X = 0) in the case where r = 1. c) Find E[X]. d) Find Var(X). properties a x 111 ELEY Aix di An are instants Xi Xn are rus Not require Xi Xn are independent 121 If Xi Xn are independent vav E Aix IT Varlaix Eia varix X ax Ey Varix that travail varix if are independent var x X2 Var exit tuarixy 131 In general varlet a X at aid calx varix Ey IIa calx X varix tzzaia Ay n2 varix Txu vault travail 21Wh X2 43 varlxitxztxsl vavexiltvavexatvaufxs t2cafxi.at 2cal Xl Ks 2101 21 31 or 31.5 Indicator rus Indicator two values ok 1 ru only For a given event A we define 1 if A Onan IA L o o W PCAFP then PCIA P PIA 0 Suppose q tP Then E IA P P IAI PCIA o PCIA VavCIA PA 11 P Gf Suppose X Binchip In Find Ex Je varix In are iid Bernoullicpl Sof X É Ii Then EXILE ICI NP varix vav Ii vaygil NPC Example 1.7 Suppose we have two boxes: red box and black box. In red box, there are 4 red balls and 6 black balls. In the black box, there are 6 red balls and 4 black balls. An experiment is conducted as follows. vAt the first step, a fair coin is tossed. vIf it shows head, then you randomly choose a ball in the red box, record the color and put it back; else, you randomly choose a ball in the black box, record the color and put it back. vAt the second step, you randomly choose a ball from the box, which has the same color as the ball you chosen at the first step. Let X be the number of red balls you draw in the first two steps. Find E(X) and Var(X). d TJ Black Box É j steps if R in step1 if B in step FEBox go to BlackBox I I 12 Ball in an step if we get I p O W 5 X I Iz o 4 go bad RI H PCH PII D Past backR past past ball o RIT f Pg o J I 0.5 y RITTER PI ISER and Bark P III p and ban p p B pill is P land Ball Ro o 5 In TERI DCI I PIL Il E X IE I Iz VAV II VAV Cz Varix Vav II 2 IN 111,12 Var Ii P I II PII O VAV Iz Pez1 ME O IL Cacti Iz ELI ELI it 1st R 2nd I 12 4 O ICI IL P CI 12 1 PC ist R and R Pland RI ISER RISER 0.2 0 4 I Cov Ii 121 0 2 4 0.05 4 I 0 Var x 4 2 0 05 Cha Waiting time ru Background suppose we have a sequence of trials we would like to observe an event E based on trial let to waiting time Te of trials or observe ist E Event E ours at time n mind 1 n Range of TE Egging Bs means we cannot observe the event Yigitiffindangtobserve Ear not or not i e Peter or not or PETE 07 0 4 what is E Te If yes to all tI I pan prob of o Fighting Not observing E then Te is improper In tha lase E Te p Sina PETER o Notes 0 127 If P TEO I N PETE 87 then Te is proper TEDI ELTE P then 21 If JC Te is Null proper y proper 22 ECT CP then If Pete PI Te is short proper 11th is improper then ECT P ELTE LP then TE is short proper 121 If hence proper Aside do not include Egan is in the summation Recall this is a limit an an lying we do not include is in summation Hence P TECO É PCTE n I Example 2.1 (Short proper waiting time rv) Suppose we toss a coin repeatedly and independently. At each toss, the probability of getting ``H" is p with 0

Use Quizgecko on...
Browser
Browser