<s>[INST] Expected number of turns in dice throwing I generated a transition probability matrix for a scenario where I throw five dice and set aside those dice that are sixes. Then, I throw the remaining dice and again set aside the sixes - then I repeat this procedure until I get all the sixes. $X_n$ here represents the number of dices that are sixes after n rolls.
$$\begin{pmatrix}\frac{5^5}{6^5} & \frac{3125}{6^5} & \frac{1250}{6^5} & \frac{250}{6^5} & \frac{25}{6^5} & \frac{1}{6^5}\\\ 0 & \frac{625}{6^4} & \frac{500}{6^4} & \frac{150}{6^4} & \frac{20}{6^4} & \frac{1}{6^4} \\\ 0& 0 & \frac{125}{6^3}& \frac{75}{6^3}& \frac{15}{6^3} & \frac{1}{6^3} \\\ 0 & 0& 0& \frac{25}{6^2}& \frac{10}{6^2}& \frac{1}{6^2}& \\ 0 & 0 & 0 & 0 & \frac{5}{6} & \frac{1}{6} \end{pmatrix}$$
I want to figure out how many turns it takes for me on average to get all sixes.
I'm not even sure where to start with this problem. Is it a right approach to write a program where I calculate $P^n$ and see when the 6th column all equals to 1? 
Any pointers would be greatly appreciated.
 [/INST] Yet another way:
Let's call rolling all five dice a "turn".  Let $X$ be the number of the first turn on which all five dice have rolled at least one six.  If $X>n$ then we have at least one die which has not rolled a six by turn $n$.  So
$$\begin{align}
E(X) &= \sum_{n>0} P(X > n) \tag{1} \\
&= \sum_{n=0}^{\infty} \{1 - [1-(5/6)^n)]^5 \} \\
&= \sum_{n=0}^{\infty} \left( 1 - \sum_{i=0}^5 (-1)^i \binom{5}{i} (5/6)^{ni} \right) \tag{2}\\
&= \sum_{i=1}^5 (-1)^{i+1} \binom{5}{i} \sum_{n=0}^{\infty} (5/6)^{ni} \\
&= \sum_{i=1}^5 (-1)^{i+1} \binom{5}{i} \frac{1}{1-(5/6)^i} \tag{3}\\
&= 13.02366
\end{align}$$
$(1)$ is true for any discrete random variable which only takes on non-negative values.
$(2)$ is by the binomial theorem.
$(3)$ is by the formula for the sum of an infinite geometric series.
</s>