# Thread: conditional distributions (another interesting question)

1. ## conditional distributions (another interesting question)

I don't have the answer and I'd appreciate any feedback.

Question.

Consider the following game involving two players and a bag containing 3 discs: 2 blue and 1 red. The players take turns. At each turn the player puts $X into the kitty, removes a disc from the bag, looks at the colour and replaces it in the bag. If the disk is blue, the game continues with the other player's turn. If the disc is red, the game stops, and the player who picked up the red disc wins the money in the kitty. Suppose$\displaystyle X{\sim}Exp(\theta)$. Let$\displaystyle Y$be the number of turns in a game (Y=1 if the red disc is chosen on the first turn). Let Z be the amount of money in the kitty when the game ends. i. Evaluate$\displaystyle P(Y=1), P(Y=2), P(Y=3)$. Write down the probability mass function of Y. ii. Derive the moment generating function of X and the moment generating function of Y. For each give an interval around the origin for which the function is well-defined. iii. Derive the moment generating function of$\displaystyle Z, M_Z(t)$. Express$\displaystyle M_Z(t)$as a polynomial of t and hence find E(Z) and Var(Z). iv. Evaluate the probability that the person who starts the game wins the game. Given the choice, would you choose to start or to go second in the game? Give reasons. I'll do the answer in a separate post, this one is getting too long. 2. Answer. i. If Y is the number of turns in the game, this is also the number of rounds until the red disc comes up for the first time. I claim that$\displaystyle Y{\sim}Geometric(p)$and its mass function is$\displaystyle f_Y(y)=(1-p)^{y-1}p$, y=1,2,... ie the number of trials until the first success (success=red disc comes up) Therefore$\displaystyle P(Y=1)=(1-1/3)^0\frac{1}{3}=\frac{1}{3}\displaystyle P(Y=2)=(1-1/3)^1\frac{1}{3}=\frac{2}{9}\displaystyle P(Y=3)=(1-1/3)^2\frac{1}{3}=\frac{4}{27}$iii.$\displaystyle M_Z(t)=\frac{\Theta}{{\Theta}-t}$(~Exp)$\displaystyle M_Y(t)=\frac{pe^t}{1-(1-p)e^t}$(~Geo) For Mx(t) to be well-defined,$\displaystyle \Theta>t$, and likewise, denominator in My(t) should be strictly positive, ie$\displaystyle 1-(1-p)e^t>0\displaystyle e^t<\frac{1}{1-p}\displaystyle ln(e^t)<-ln(1-p)$and finally$\displaystyle t<-ln(1-p)$(thinking to myself, since 1-p<1, ln(1-p)<0 so t must be positive...) iii. Z is the function of Y and X, which, in turn, are pairwise independent. Therefore$\displaystyle M_Z(t)=M_X(t)M_Y(t)$by the way, I am not sure if I can use t parameter in all three functions, doesn't sound right, as they are three differnet mgfs? But if I use three different letters for parameters, I can never multiply$\displaystyle M_X(t)M_Y(t)$Anyways, I get$\displaystyle M_Z(t)=\frac{\Theta}{{\Theta}-t}\frac{pe^t}{1-(1-p)e^t}$and since I cannot, cannot, cannot express this as a polynomial (must be something to do with expension of e^t?? but I got messy in the end and gave up) I took the first derivative of the fraction and found E(Z) as 1st derivative of Mz(t) around t=0. The calculation was a bit tedious so I'll just say that I got$\displaystyle E(Z)=\frac{1+{\Theta}}{{\Theta}p}$And since the direct calculation of the 2nd derivative from the fraction would be even more tedious, I welcome any pointers on how to express Mz(t) as polynomial so to do the Var(Z) in a proper way. 3. iv. Finally, the fun part. The probability that the person who starts the game wins the game. I consider the sequence$\displaystyle \frac{1}{3},...\frac{2^{2m}}{3^{2m+1}}, m=0,1,2,...$which represents probabilities of winning the game (picking the red disc) by the person who makes the first move. Total probability is the sum$\displaystyle \Sigma_{m=0}^{\infty}\frac{2^{2m}}{3^{2m+1}}=\Sigm a_{m=0}^{\infty}(\frac{2^2}{3^2})^m\frac{1}{3}=\fr ac{1}{3}\Sigma_{m=0}^{\infty}(\frac{4}{9})^m=\frac {1}{3}\frac{1}{1-4/9}=\frac{3}{5}$Then the probability of the other person winning is 1-3/5=2/5 Since 3/5>2/5, I would choose to start. (makes sense since I can pick up the red disc on the first move already, without giving the other person a chance to make a single move) 4. Originally Posted by Volga Answer. i. If Y is the number of turns in the game, this is also the number of rounds until the red disc comes up for the first time. I claim that$\displaystyle Y{\sim}Geometric(p)$and its mass function is$\displaystyle f_Y(y)=(1-p)^{y-1}p$, y=1,2,... ie the number of trials until the first success (success=red disc comes up) Therefore$\displaystyle P(Y=1)=(1-1/3)^0\frac{1}{3}=\frac{1}{3}\displaystyle P(Y=2)=(1-1/3)^1\frac{1}{3}=\frac{2}{9}\displaystyle P(Y=3)=(1-1/3)^2\frac{1}{3}=\frac{4}{27}$You are corrrect for the values for$\displaystyle P(Y=1),\;P(Y=2)\;and\;P(Y=3)$however, when writing down the pmf, you need to plug in the values of p=1/3 and (1-p)=2/3 in$\displaystyle f_Y(y)=(1-p)^{y-1}p \; ,\;y=1,2,3,....$Originally Posted by Volga iii.$\displaystyle M_Z(t)=\frac{\Theta}{{\Theta}-t}$(~Exp)$\displaystyle M_Y(t)=\frac{pe^t}{1-(1-p)e^t}$(~Geo) For Mx(t) to be well-defined,$\displaystyle \Theta>t$, and likewise, denominator in My(t) should be strictly positive, ie$\displaystyle 1-(1-p)e^t>0\displaystyle e^t<\frac{1}{1-p}\displaystyle ln(e^t)<-ln(1-p)$and finally$\displaystyle t<-ln(1-p)$(thinking to myself, since 1-p<1, ln(1-p)<0 so t must be positive...) I assume you meant$\displaystyle M_X(t)=\frac{\theta}{{\theta}-t} $, since X follows an exponential distribution. You should also know$\displaystyle t < |\theta|$and$\displaystyle M_Y(t)=\dfrac{pe^t}{1-(1-p)e^t}$. Yes, but plug in the values of p and (1-p). Same for$\displaystyle t<-ln(1-p)$Originally Posted by Volga Answer. iii. Z is the function of Y and X, which, in turn, are pairwise independent. Therefore$\displaystyle M_Z(t)=M_X(t)M_Y(t)$by the way, I am not sure if I can use t parameter in all three functions, doesn't sound right, as they are three differnet mgfs? But if I use three different letters for parameters, I can never multiply$\displaystyle M_X(t)M_Y(t)$. Actually$\displaystyle \displaystyle Z = \sum_{i=1}^Y {X_i}$can you find the mgf? 5. Originally Posted by Volga iv. Finally, the fun part. The probability that the person who starts the game wins the game. I consider the sequence$\displaystyle \frac{1}{3},...\frac{2^{2m}}{3^{2m+1}}, m=0,1,2,...$which represents probabilities of winning the game (picking the red disc) by the person who makes the first move. Total probability is the sum$\displaystyle \Sigma_{m=0}^{\infty}\frac{2^{2m}}{3^{2m+1}}=\Sigm a_{m=0}^{\infty}(\frac{2^2}{3^2})^m\frac{1}{3}=\fr ac{1}{3}\Sigma_{m=0}^{\infty}(\frac{4}{9})^m=\frac {1}{3}\frac{1}{1-4/9}=\frac{3}{5}$Then the probability of the other person winning is 1-3/5=2/5 Since 3/5>2/5, I would choose to start. (makes sense since I can pick up the red disc on the first move already, without giving the other person a chance to make a single move) The answer looks good. However, I would go second. The graeter probability of winning if you go ﬁrst is because of probability of winning on the first try (Y = 1) where all the money in the kitty is your own. You'd rather win your opponent's money!! If you go first, the prob of winning your opponents money is$\displaystyle \frac{4}{15}$, and it is$\displaystyle \frac{6}{15}$if you went second. 6. Originally Posted by harish21 However, I would go second. So we are matched ))) Thanks- I will work on your pointers and update here. 7. Reworked, i.$\displaystyle M_X(t)=\frac{\theta}{\theta-t}\displaystyle M_Y(t)=\frac{1/3e^t}{1-2/3e^t}=\frac{e^t}{3-2e^t}$. How could I not see to substitute p=1/3??? iii. Ah! Y is the number of rounds, X is the amount of money in each round -> random sum! Therefore if$\displaystyle Z=\Sigma_{i=1}^YX_j, M_Z(t)=M_Y(lnM_X(t))=M_Y(ln(\frac{\theta}{\theta-t}))=M_Y(\frac{e^{ln\theta-ln(\theta-1)}}{3-2e^{ln\theta-ln(\theta-1)}})=\displaystyle =\frac{\theta}{\theta-t}3-2\frac{\theta}{\theta-t})=\frac{\theta}{\theta-3t}$Then it is easy to take first and second derivative of this function at t=0, I got$\displaystyle E(Z)=\frac{3}{\theta}, Var(Z)=\frac{18}{\theta^2}$iv. The conclusion I should make for myself, look at the big picture, not just one formula ))) Again, thanks a lot for your help! 8. good job. you're almost there, but the second derivative of the mgf of Z at t=0 is NOT the variance. It is the second moment, that is,$\displaystyle E[Z^2]=\dfrac{18}{\theta^2}$now find the variance. 9. Oh sorry, I rushed it$\displaystyle Var(Z)=E(Z^2)-E(Z)^2=\frac{18}{\theta^2}-\frac{9}{\theta^2}=\frac{9}{\theta^2}$Clearly I must practice much more! 10. Originally Posted by Volga Oh sorry, I rushed it Better to do that here than in the test.$\displaystyle Var(Z)=E(Z^2)-E(Z)^2=\frac{18}{\theta^2}-\frac{9}{\theta^2}=\frac{9}{\theta^2}\$