Get the probability generating function of $X$ from $Y$

37 Views Asked by At

For $X\in $Bin($n,p$) and $Y|X=k \in$Bin($k,p$), I have to show using the pgf that $Y \in$Bin($n,p^2$). I have been shown that the pgf of $Y$ can be written as, $$ g_Y(t)=E[t^Y]=E[E[t^Y|X]]=\sum_{k=0}^{n} E[t^Y|X=k]P(X=k) $$ What I don't understand is why (when using the conditional) is it $P(X=k)$ and not $P(Y=k)$?

Edit: Also, what happened with $t^k$, i.e. why is it not $(E[t^Y|X=k])^k$?