[Math] A fair die is successively rolled. Let $X$ and $Y$ denote, respectively, the number of rolls necessary to obtain a 6 and a 5. Find $Var[ X|Y = 5]$

probabilityvariance

A fair die is successively rolled. Let $X$ and $Y$ denote,
respectively, the number of rolls necessary to obtain a 6 and a 5.
Find

$E[ X|Y = 5]$

How to conceptualize conditional expectation inductively?

While reading the question above, I thought about obtaining the (in my opinion, much more difficult) conditional variance. Could someone help me to find $Var[ X|Y = 5]$?

Best Answer

As explained in the answer to your previous question, the distribution of $X$ conditioned on $Y$ is given by $$ \mathbb P(X=n\mid Y=m) = \begin{cases} \frac15\left(\frac45\right)^{n-1},& 1\leqslant n\leqslant m-1\\ \frac16\left(\frac45\right)^{m-1}\left(\frac56\right)^{n-m-1},& n\geqslant m+1. \end{cases} $$ So we compute \begin{align} \mathbb E[X\mid Y=m] &= \sum_{n=1}^\infty n\cdot\mathbb P(X=n\mid Y=m)\\ &= \sum_{n=1}^{m-1} n\cdot\frac15\left(\frac45\right)^{n-1} + \sum_{n=m+1}^\infty n\cdot\frac16\left(\frac45\right)^{m-1}\left(\frac56\right)^{n-m-1}\\ &= 5-\left(\frac{5}{4}\right)^{1-m} (m+4) + \left(\frac 45\right)^{m-1}(m+6)\\ &= 5 + 2\left(\frac45\right)^{m-1} \end{align} and similarly \begin{align} \mathbb E[X^2\mid Y=m] &= \sum_{n=1}^\infty n^2\cdot\mathbb P(X=n\mid Y=m)\\ &= 45-\left(\frac{4}{5}\right)^{m-1} (m (m+8)+36) + \left(\frac45\right)^{m-1}(66 +m(12+m))\\ &= 45 + 2\left(\frac{4}{5}\right)^{m-1}(2 m+15). \end{align} Hence, \begin{align} \mathsf{Var}(X\mid Y=m) &= \mathbb E[X^2\mid Y=m] - \mathbb E[X\mid Y=m]^2\\ &=45 + 2\left(\frac{4}{5}\right)^{m-1}(2 m+15) -\left(5 + 2\left(\frac45\right)^{m-1}\right)^2. \end{align} For $m=5$, the above evalutes to $9$.