Expectation Values of a Binomial Distribution with an Exponentially Distributed Variable I have an exponentially distributed variable, $Y$:
$Y \sim Exp(\lambda_{0}, x) $
I want to calculate the expectation value of a binomial distributed variable $Z$ dependent upon the value of $Y$ given by:
$Z \sim B(N, k,  p = 1 - e^{- \lambda_{1}Y})$
My intuition tells me that in order to solve $E[Z]$, I should:

*

*take the expectation value of $Y$, $E[Y] = \frac{1}{\lambda_{0}}$;

*substitute into $Z$, $Z \sim B(N, k,  p = 1 - e^{-\frac{\lambda_{1}}{\lambda_{0}}})$

*take the expectation value of $Z$, $E[Z] = n(1 - e^{-\frac{\lambda_{1}}{\lambda_{0}}})$
However, something tells me this is too simple and therefore probably wrong, given my limited knowledge of statistics.
Can someone reveal to me how I would solve this problem?
Edit: I tested numerically, and I found the result to be incorrect. I am not surprised, yet I do not know how to proceed.

Key idea: condition on the value of $Y$.
In more detail: $E[Z]=E[E[Z|Y]]$ by the law of total expectation. Conditional on $Y=y$, we know that the expected value of $Z$ is $n(1 - e^{- \lambda_{1}y})$.
So $E[Z]=E[n(1-e^{-\lambda_1 Y})]=n-nE[e^{-\lambda_1 Y}]$.The latter expectation is just the moment generating function of the exponential distribution with rate parameter $\lambda_0$, evaluated at $-\lambda_1$ (see this page for the mgf of the exponential distribution). So, finally, $E[Z]=n-n\frac{\lambda_0}{\lambda_0+\lambda_1}=\frac{n\lambda_1}{\lambda_0+\lambda_1}$.
