$\newcommand{\Var}{\mathrm{Var}}$ Consider $Z_i$ as a binary random variable with $\mathrm{Pr}[Z_i = 1] = \pi$. Also, consider $Y_i$ as:
$Y_i|Z_i = 0 \sim \mathrm{Poisson} (\lambda_0) $
$Y_i|Z_i = 1 \sim \mathrm{Poisson} (\lambda_1) $
My question is how we can find $\Var(Y_i)$.
Here is what I think I should do, but I've not had any success till now:
$\Var(Y_i) = E(\Var(Y_i|Z_i)) + \Var(E(Y_i|Z_i)) = E(\pi\cdot\lambda_1 + (1 - \pi)\cdot\lambda_0) + \Var(\pi\cdot\lambda_1 + (1 - \pi)\cdot\lambda_0) = \pi\cdot\lambda_1 + (1 - \pi)\cdot\lambda_0 + 0 $
What I've got above is different from what my instructor has in his lecture notes. He has: $\Var(Y_i) = \pi\cdot\lambda_1 + (1 - \pi)\cdot\lambda_0 + (\lambda_1 - \lambda_0)^2\cdot\pi\cdot(1 - \pi)$
I appreciate your help.