<s>[INST] Probability - die - The number of throws until a $5$ and a $6$ have been obtained. An unbiased die is thrown repeatedly until a 5 and a 6 have been obtained. the random variable M denotes the number of throws required. For example, for the sequence of results 6,3,2,3,6,6,5, the value of M is 7. Calculate P(M=r).
 [/INST] Let's say the $r$-th one is $6$. Then in the previous $r-1$ throw, you must have at least one $5$. That means at the same time you cannot have $6$. So you can have one $5$ and $(r-2)$ $1-4$, or two $5$ and $(r-3)$ $1-4$, ... etc.
So the probability is
$$P=\frac{1}{6}\sum_{i=1}^{r-1}C^{r-1}_i \left(\frac{1}{6}\right)^i\left(\frac{2}{3}\right)^{r-2-i}$$
$$=\frac{1}{6}\bigg[\left(\frac{1}{6}+\frac{2}{3}\right)^{r-1}-\left(\frac{2}{3}\right)^{r-1}\bigg]$$
$$=\frac{1}{6}\frac{5^{r-1}-4^{r-1}}{6^{r-1}}$$
Finally, switching the role of $5$ and $6$ means doubling the probability, so
$$P=\frac{1}{3}\frac{5^{r-1}-4^{r-1}}{6^{r-1}}$$
</s>