distribution of a random variable that depends on another random variable Let X be a Poisson random variable, $X \thicksim Po(\lambda Y) $ where $Y \thicksim Exp(\alpha)$.
Now I would like to compute the distribution of X.
If I conditionate on $Y=c$, I find $P(X=0|Y=c)=e^{\lambda c}$.
But, in general, how can I compute $P(X=0)?$ I think that I have to take the mean, and so $P(X=0)=E(e^{\lambda y})=\int_{0}^{\infty}e^{\lambda z}\alpha e^{- \alpha z}dz$. But I don't understand why, how can I show the previous equality and how I have to look at this problem.(the variable that I'm studying is a function of random variable or what else..)  
 A: Given $Y$, $X$'s distribution is known. The law of total probiability gives us for $n \in \mathbf N$
\begin{align*}
  \def\P{\mathbf P}\P(X = n) &= \int_0^\infty \P(X = n \mid Y= y)f_Y(y)\, dy
\\
   &= \int_0^\infty \frac{(\lambda y)^n}{n!}\exp(-\lambda y)\alpha\exp(-\alpha y)\, dy\\
   &= \frac{\lambda^n \alpha}{n!}\int_0^\infty y^n \exp\bigl(-(\alpha+\lambda)y\bigr)\, dy 
\end{align*}
Now, by induction 
$$ \int_0^\infty y^n \exp(-y)\, dy = n! $$
Hence, 
$$ \int_0^\infty y^n \exp\bigl(-(\alpha + \lambda)y\bigr)\, dy 
 = \frac 1{(\alpha + \lambda)^n} \int_0^\infty z^n \exp(-z)\, \frac{dz}{(\alpha + \lambda)} = \frac{n!}{(\alpha + \lambda)^{n+1}} $$
This gives
$$ \P(X = n) = \frac{\lambda^n \alpha}{(\alpha + \lambda)^{n+1}} = \frac \alpha\lambda \left(\frac{\lambda}{\alpha + \lambda}\right)^{n+1} = \frac{\alpha}{\alpha + \lambda} \cdot \left(1  -\frac{\alpha}{\alpha + \lambda}\right)^{n}  $$
That is, $X$ is geometrically distributed with parameter $\frac{\alpha}{\alpha + \lambda}$.

Addendum: One can see it as follows. $X$ is not a function of $Y$, $X$ is a random variable of its own. But: The information we are given about $X$ is conditioned on $Y$, we have observed $X$ only for known $Y$ values.
