# Thread: Moment generating function question

1. ## Moment generating function question

A fair die is rolled repeatedly and independently. Let X be the number of rolls until the first time a 5 or 6 has been observed. Note that the trial that 5 or 6 occurred is also counted. Let Y be the number of casts until the first time when both 5 or 6 have been observed.
a) What is the moment generating function of X, Mx(t)
b) What is the moment generating function of Y-X, My-x(t)
c) Find the moment generating function of Y, My(t) and use it to find E(Y)

Help would be greatly appreciated.

2. X is a geometric with p=1/3.
I've never seen this before.
The distribution of Y is interesting.
The hint is to go after the rv Y-X via its MGF.
I think you should try the conditional expectation
$E(e^{(Y-X)t})=E(E(e^{(Y-X)t}|X))$.

3. Originally Posted by matheagle
X is a geometric with p=1/3.
I've never seen this before.
The distribution of Y is interesting.
The hint is to go after the rv Y-X via its MGF.
I think you should try the conditional expectation
$E(e^{(Y-X)t})=E(E(e^{(Y-X)t}|X))$.
Is it also possible to get the moment of Y - X by noticing that Y - X is a new geometric r.v. with p = 1/6? And taking z = y - x. We get the geometric r.v. $p(z) = (1 - p)^{z - 1}p$

And we can take the moment $M_z(t) = E(e^{tz})$?

4. After doing part (a), you find a general form for the $M_{x}(t) = pe^t(1-(1-p)e^t)^{-1}$.

I did what utopiaNow did for part (b), and using the work from (a), I used p = 1/6

Part (c) is due to the fact that the geometric r.v. is memoryless.

Part (d), I multiplied $M_{X} * M_{Y-X} = M_{X+Y-X} = M_{Y}$ to find the mgf of $M_{Y}$. To find the $E(Y)$, I found the derivative of $M_{Y}$.

I'm not quite sure about my work for (d), but I think that's the gist of it... try it out

5. Originally Posted by veol
After doing part (a), you find a general form for the $M_{x}(t) = pe^t(1-(1-p)e^t)^{-1}$.

I did what utopiaNow did for part (b), and using the work from (a), I used p = 1/6

Part (c) is due to the fact that the geometric r.v. is memoryless.

Part (d), I multiplied $M_{X} * M_{Y-X} = M_{X+Y-X} = M_{Y}$ to find the mgf of $M_{Y}$. To find the $E(Y)$, I found the derivative of $M_{Y}$.

I'm not quite sure about my work for (d), but I think that's the gist of it... try it out
Yeah I ended up doing it that way. And I got a final answer of 9 for (d). That final answer makes sense to me, but just in case, what did you guys get?

6. Hmm.. I got $\frac{9}{64}$ as my answer for (d). I should check if I did it right.

7. Originally Posted by veol
Hmm.. I got $\frac{9}{64}$ as my answer for (d). I should check if I did it right.
Yeah $\frac{9}{64}$ seems strange to me because we're dealing with a discrete p.d.f. So to like an $\frac{9}{64}$ expected number of rolls to get both a 5 and 6 seem strange.

8. Thanks, nice catch. I tried taking the derivative of the mgf again, and got a final answer of 9.

I missed doing the chain rule while finding the derivative for a part of the question, but I fixed it. I just got caught up in the math, I forgot what the question was, and hence, didn't pick up that 9/64 was a weird answer...

Thanks for that! 9 does make more sense, and I fixed up my math.

9. Originally Posted by veol
Thanks, nice catch. I tried taking the derivative of the mgf again, and got a final answer of 9.

I missed doing the chain rule while finding the derivative for a part of the question, but I fixed it. I just got caught up in the math, I forgot what the question was, and hence, didn't pick up that 9/64 was a weird answer...

Thanks for that! 9 does make more sense, and I fixed up my math.
Sweet good to also get some support for the answer I got. Thanks!

10. Can someone explain to me why p=1/6 for part (b) when we are trying to find the moment generating function for Y-X? Thanks!

11. Originally Posted by cheeseburgirl
Can someone explain to me why p=1/6 for part (b) when we are trying to find the moment generating function for Y-X? Thanks!
K well for that we have to think about what X and Y are. X is a geometric r.v. with p1 = 1/3. Now Y is the total number of rolls till both 5 and 6 are observed. So for Y we keep rolling dice till we get a 5 or 6, ( which is X), then we keep rolling again till we get whichever one we didn't get on the first "success"( so we wait for 5 if we got 6 the first time and vice versa).

So now think about it like this:
---------->X------------>Y-X
-----------*-------------*
------------------------->Y

Now you can see that Y - X is just the difference, or the second wait period. And since the dice is being rolled independently, we can basically treat Y-X as rolling a dice until we get whichever 1 we didn't get the first time. Only 1/6 possibilities this time, since 5 or 6 already happens first at the first star(X). So p2 = 1/6.

12. Thanks... for d, how do you take the derivative of this My? The equation is so complicated.

The fraction I got for My is this:
1/18 e^(2t) / (1-(3/2)e^t + (5/9)e^(2t))

13. Originally Posted by cheeseburgirl
Thanks... for d, how do you take the derivative of this My? The equation is so complicated.

The fraction I got for My is this:
1/18 e^(2t) / (1-(3/2)e^t + (5/9)e^(2t))
Ya...I got the same thing..but when i tried to get the derivative.... i can't get 9...actually,, i am not sure how to do the derivative for this one... i tried the chain rule..but not work....anyone could show me how to do it? Thanks in advance!!!

14. Originally Posted by cm917
Ya...I got the same thing..but when i tried to get the derivative.... i can't get 9...actually,, i am not sure how to do the derivative for this one... i tried the chain rule..but not work....anyone could show me how to do it? Thanks in advance!!!
Actually I'm sure you can do it, it just takes time and care and the quotient rule. And I think it's reasonable to say that the time and care should be yours, not someone elses. You should at least post what you've done and where you get stuck.

15. Originally Posted by mr fantastic
Actually I'm sure you can do it, it just takes time and care and the quotient rule. And I think it's reasonable to say that the time and care should be yours, not someone elses. You should at least post what you've done and where you get stuck.
Sorry..coz I am not familiar with how to use the math symbol...so i didnt post it...

My work:

let e^t = u du/dt = e^t

My(t) = 1/18 u^2 / ( 1-3/2 u+5/9 u^2)
Applying quotient rule:
--> (1/9u-1/12 u ^2) / (1-2/3u+5/9u^2)^2

Should I let t=0...then....it turns out... (1/9-1/12 )/(1-3/2+5/9)^2 = 9
am I on the right track?

Thanks!

Page 1 of 2 12 Last