# Moment generating function of two independent variables

The moment generating functions of two independent variables $X$ and $Y$ are $M_X(t)=\exp(2e^t-2)$ and $M_Y(t)=\left(\frac34e^t+\frac14\right)^{10}$. What are (a) $P(X+Y=2)$; (b) $P(XY=0)$; (c) $E[XY]$?

For (a), I did it in two ways that yield different answers.

First method: $M_{X+Y}(t)=\exp(2e^t-2)\left(\frac34e^t+\frac14\right)^{10}$, so $$P(X+Y=2)=\frac{d^2}{d(e^t)^2}M_{X+Y}(t)\big|_{e^t=0}=\frac{467}{524288e^2}.$$

Second method: $X$ is Poisson with parameter $2$ and $Y$ is Binomial with parameters $(10,\frac34)$. So $$P(X+Y=2)=\sum_{i=0}^2e^{-2}\frac{2^i}{i!}{10\choose 2-i}\left(\frac34\right)^{2-i}\left(\frac14\right)^{8+i}=\frac{467}{1048576e^2}.$$

Where did I go wrong?

For (b) and (c), can you check my solutions?

(b) $P(XY=0)=P(X=0)+P(Y=0)-P(X=0,Y=0)=e^{-2}+\frac1{4^{10}}-\frac{e^{-2}}{4^{10}}$

(c) $E[XY]=E[X]E[Y]=2\left(10\cdot\frac34\right)=15$

-
You can calculate the moments of a random variable by evaluating the appropriate order derivative of the generating function at 0, but I do not think you can obtain the probability directly this way. Also, why are you evaluating at $e^{t}=0$ and not $t=0$? Think about the statement $e^{t}=0$. Maybe that is a typo. For part (a), consider directly calculating the inverse Fourier transform of the product. – Mr. F Apr 9 '12 at 2:48
I think I read somewhere something similar to the first method, but never mind if it's wrong. I don't know what is a Fourier transform, but is my second method correct? – jakuva Apr 9 '12 at 2:58

Let $Z$ a discrete random variable, then

$$M_Z(t) = \sum_k e^{k \cdot t} \cdot \mathbb{P}[Z=k] \\ \Rightarrow \frac{d}{dt}M_Z(t) = \sum_k k \cdot e^{k \cdot t} \cdot \mathbb{P}[Z=k] \\ \Rightarrow \frac{d}{dt} \left( \frac{d}{dt} M_Z(t)-M_Z(t) \right) = \sum_k k \cdot (k-1) \cdot e^{t \cdot k} \cdot \mathbb{P}[Z=k] \\ \Rightarrow \frac{d}{dt} \left( \frac{d}{dt} M_Z(t)-M_Z(t) \right) \bigg|_{t=0} = 2 \cdot 1 \cdot \mathbb{P}[Z=2]$$

If you apply this to $Z:=X+Y$ you get the correct result. So it's possibly to use the moment generating function to calculate the probability, but it's not that easy as you thought.

(Your first method is wrong, since the expression

$$\frac{d^2}{d(e^t)^2} M_{X+Y}(t) \bigg|_{e^t=0}$$

doesn't make sense at all: $e^t>0$ for all $t \in \mathbb{R}$.)

And yes, your second method is correct.

-