I'm having difficulty understanding a solution to a given problem that I tried to solve.
Problem: Suppose n fair dice are rolled. Those that show a six are rolled again. What are the mean and the variance of the number of sixes obtained in the second round of this experiment?
Solution: Suppose Y is the number of dice in the first round that show a six
Let X be the number of dice in the second round that show a six
Given: $$Y = y$$ $$X ∼ Bin(y, \frac{1}{6})$$ $$Also, \ Y ∼ Bin(n, \frac{1}{6})$$ $$\therefore E(X) = E[E(X|Y = y)] = E_{Y}[\frac{y}{6}]=\frac{n}{36}$$
Note: I got this part above.
My problem understanding starts here:
$$Var(X) = E_{Y}[Var(X|Y = y)] + Var_{Y}[E(X|Y = y)]$$ $$= E_{Y}[y\frac{1}{6}\frac{5}{6}] + Var_{Y}[\frac{y}{6}]$$ $$= \frac{5}{36}\frac{n}{6} + \frac{1}{36}n\frac{1}{6}\frac{5}{6}$$ $$= \frac{35n}{1296}$$
My question: How does $E_{Y}[Var(X|Y = y)] $ become $E_{Y}[y\frac{1}{6}\frac{5}{6}]$ ? I basically need an explanation.
I'm having difficulty understanding conditional variances so any help in terms of tips or resources to understand it better would be great. Thank you.
We have that $X|Y=y\sim \textrm{Bin}(n=y,p=1/6)$ therefore $$\textrm{Var}[X|Y=y]=np(1-p)=y\frac{1}{6}\frac{5}{6}$$ This is because if we know the number of sixes of the first round (i.e. $y$) then we know how many dice will be rolled in the second round.