# Probability generating function of $X\sim \text{Poisson}(\lambda)$ when $\lambda\sim U(0,2)$

The probability generating function (pgf) of $$X\sim \text{Poisson}(\lambda)$$ is $$G_x(t) = e^{-\lambda(1-t)}.$$

Find pgf of $$X$$ if $$\lambda\sim \text{Unif}(0,2).$$ Then find $$\mathbb P(X=2).$$

My solution:

$$G_{x\mid \lambda\sim Unif(0,2)}(t)=\int_{0}^2 e^{-\lambda(1-t)} f_\lambda(t) dt = \int_{0}^2 e^{-\lambda(1-t)} \frac{1}{2} dt = \frac{1}{2} \int_{0}^2 e^{-\lambda(1-t)} dt = \frac{1}{2} e^{2\lambda} - \frac{1}{2} e^{-\lambda}$$.

Then $$\mathbb P(X=2) = \frac{G_x^{(2)}(0)}{2!}$$, so here

$$G_x^{(2)}(t) = 2e^{2\lambda} - \frac{1}{2}e^{-\lambda}$$ and $$G_x^{(2)}(0)= 2-\frac{1}{2}$$.

Finally, $$\mathbb P(X=2) = \frac{3}{4}$$

Is it correct?

• @KaviRamaMurthy Are you sure the integration should be w.r.t $t$ and not $\lambda$?, because we want the unconditional PGF and probability. Jun 20, 2019 at 9:02
• Yes, I am interested in this question too. If I integrate w.r.t. $λ$, I get 0, that is also possible. Jun 20, 2019 at 9:06
• @Lucyy As pointed out by Vishaal Sudarsan you have mixed up the variables. You have to integrate w.r.t. $\lambda$ and get the moment generating function as a function of $t$. The differentiate twice w.r.t. $t$. Jun 20, 2019 at 9:08
• @Kavi Rama Murthy but now I am getting the negative probability.. Jun 20, 2019 at 9:30
• \lambda is the proper syntax for $\lambda$. Jun 20, 2019 at 13:33

$$\mathbb{E}\left[t^{X}\mid\lambda=u\right]=e^{-u\left(1-t\right)}$$ so that $$\mathbb{E}\left[t^{X}\mid\lambda\right]=e^{-\lambda\left(1-t\right)}$$ and: $$G_{X}\left(t\right)=\mathbb{E}t^{X}=\mathbb{E}\left[\mathbb{E}\left[t^{X}\mid\lambda\right]\right]=\mathbb{E}e^{-\lambda\left(1-t\right)}=\frac{1}{2}\int_{0}^{2}e^{-\lambda\left(1-t\right)}d\lambda=\begin{cases} \frac{1-e^{-2\left(1-t\right)}}{2\left(1-t\right)} & \text{if }t\neq1\\ 1 & \text{otherwise} \end{cases}$$
Now $$P(X=2)$$ can be found on base of: $$P(X=2)=\frac{G_{X}^{\left(2\right)}\left(0\right)}{2!}$$
• @StubbornAtom You are correct in stating that the word "independent" (I removed it) is not the right term to use here. It was meant to say that $\Lambda$ only determined the parameter of the distribution and had no other effect on $X$. Jun 20, 2019 at 12:05