Rolling a dice until we have $5$ and an even number. We roll a dice, until we have both: a five and some even number.
Let X be the expected number of rolls. 
Find expected value of X and Var(X).
So I don't know how to begin. I think there should be something like $X= X_1 + X_2$ And then I would use geometric distribution. But how to divide X into easier events? 
I thought about situations like rolling dice until we have both even and odd number. It's easy, because probability of obtaing an odd number is the same as obtaining even number.
The same situation - if we roll until we get $5$ and, let me say, $3$. There is no problem since getting $5$ has the same probability as getting $3$. 
But getting a $5$ and getting an even number have different proabilities, so it's not so easy... Can somebody help?
 A: Here's a heavy-handed approach. After zero or more rolls, you are in one of four situations:
$\begin{align}
\emptyset:&\qquad\textrm{No 5 or even rolled yet.}\\
E:&\qquad\textrm{Even was rolled, but no 5 yet.}\\
5:&\qquad\textrm{A 5 was rolled, but no even yet.}\\
*:&\qquad\textrm{Both 5 and even have been rolled. Game over.}\\
\end{align}$
The transition matrix of probabilities between each pair of situations is easy to compute:
$\begin{array}{l|cccc}
\nearrow&\emptyset&E&5&*\\
\hline
\emptyset&\frac{1}{3}&\frac{1}{2}&\frac{1}{6}&0\\
E&0&\frac{5}{6}&0&\frac{1}{6}\\
5&0&0&\frac{1}{2}&\frac{1}{2}\\
*&0&0&0&1\\
\end{array}$
So this is now modeled as a absorbing Markov chain with transition matrix
$\left({\begin{array}{cccc}
\frac{1}{3}&\frac{1}{2}&\frac{1}{6}&0\\
0&\frac{5}{6}&0&\frac{1}{6}\\
0&0&\frac{1}{2}&\frac{1}{2}\\
0&0&0&1\\
\end{array}}\right)$
The final state being listed last, the behavior is characterized by the $3\times3$ matrix in the upper left, which is the transition matrix for the non-final states.
$Q=\left({\begin{array}{ccc}
\frac{1}{3}&\frac{1}{2}&\frac{1}{6}\\
0&\frac{5}{6}&0\\
0&0&\frac{1}{2}\\
\end{array}}\right)$
The so-called fundamental matrix $N$ for this chain is
$N=(I-Q)^{-1}
=\left({\begin{array}{ccc}
\frac{3}{2}&\frac{9}{2}&\frac{1}{2}\\
0&6&0\\
0&0&2\\
\end{array}}\right)
$.
The expected number of steps from the $i$-th state to the final one is the sum of the entries of the $i$-th row of $N$, or equivalently the $i$-th entry of the matrix
${\bf t}=N\mathbb{1}=\left({\begin{array}{c}
\frac{13}{2}\\
6\\
2\\
\end{array}}\right)$,
so for the starting state $\emptyset$, it's $\frac{13}{2}$ steps.
The variance of the number of steps from the $i$-th state is the $i$-th entry in the matrix
$(2N-I){\bf t-t_{\textrm sq}}$,
where $t_{\textrm sq}$ is the matrix $\bf t$ with each entry squared. If I didn't slip up with Mathematica,
$(2N-I){\bf t-t_{\textrm sq}}=\left({\begin{array}{c}
\frac{107}{4}\\
30\\
2\\
\end{array}}\right)$,
and the variance you want is $\frac{107}{4}$
A: Let $X$ stand for the number of rolls needed to get an even number
and a $5$.
Let $Y$ stand for the number of rolls needed to get an even number.
Let $Z$ stand for the number of rolls needed to get a $5$.
Let $E$ denote the event that the first roll is even. 
Let $F$ denote the event that the first roll is a $5$. 
Let $G$ denote the event that the first roll is a $1$ or a $3$.
$\mathbb{E}Y=\mathbb{E}\left(Y\mid E\right)P\left(E\right)+\mathbb{E}\left(Y\mid E^{c}\right)P\left(E^{c}\right)=1+\frac{1}{2}\mathbb{E}Y$ leading to $\mathbb{E}Y=2$
$\mathbb{E}Z=\mathbb{E}\left(Z\mid F\right)P\left(F\right)+\mathbb{E}\left(Z\mid F^{c}\right)P\left(F^{c}\right)=1+\frac{5}{6}\mathbb{E}Z$ leading to $\mathbb{E}Z=6$
$\mathbb{E}X=\mathbb{E}\left(X\mid E\right)P\left(E\right)+\mathbb{E}\left(X\mid F\right)P\left(F\right)+\mathbb{E}\left(X\mid G\right)P\left(G\right)=1+\frac{1}{2}\mathbb{E}Z+\frac{1}{6}\mathbb{E}Y+\frac{1}{3}\mathbb{E}X$
This leads to:  $$\mathbb{E}X=\frac{13}{2}$$
addendum:
Likewise $\mathbb{E}Y^{2}$, $\mathbb{E}Z^{2}$ and $\mathbb{E}X^{2}$
can be found. 
To make it a bit shorter: the distributions of $Y$ and $Z$ are geometric. 
That gives directly $\mathbb{E}Y=2$, $\mathbb{E}Z=6$ (allready found alternatively), $\mathbb{E}Y^{2}=6$
and $\mathbb{E}Z^{2}=66$. 
We go on with:
$$\mathbb{E}X^{2}=\mathbb{E}\left(X^{2}\mid E\right)P\left(E\right)+\mathbb{E}\left(X^{2}\mid F\right)P\left(F\right)+\mathbb{E}\left(X^{2}\mid G\right)P\left(G\right)$$ 
$$=\frac{1}{2}\mathbb{E}\left(1+Z\right)^{2}+\frac{1}{6}\mathbb{E}\left(1+Y\right)^{2}+\frac{1}{3}\mathbb{E}\left(1+X\right)^{2}$$
leading to:
$\mathbb{E}X^{2}=69$ and $$\text{Var}X=\mathbb{E}X^{2}-\left(\mathbb{E}X\right)^{2}=\frac{107}{4}$$
A: You can write $X=X_{1}+X_{2}$ where $X_{1}$ stands for the number
of rolls needed to get a number in $\left\{ 2,4,5,6\right\} $ and
$X_{2}$ for the number of rolls needed after that to come in the
situation where an even number and number $5$ is rolled. Then
$X_{1}$ is geometrically distributed with parameter $\frac{2}{3}$
so that $\mathbb{E}X_{1}=\frac{3}{2}$ and $\text{Var}X_{1}=\frac{3}{4}$.
Let $A$ be an rv taking values in $\left\{ 0,1\right\} $ s.t $A=1$
if a $5$ shows up at the first time a number in $\left\{ 2,4,5,6\right\} $
is rolled. It has the Bernouilli-distribution with parameter $\frac{1}{4}$.
Abbreviating $B=1-A$ you can write $X_{2}=AU+BV$ where $U$ and
$V$ are geometrically distributed with parameters $\frac{1}{2}$
and $\frac{1}{6}$ respectively. Here $X_{1},A,U,V$ are independent.
$\mathbb{E}X_{2}=\mathbb{E}A\mathbb{E}U+\mathbb{E}B\mathbb{E}V=\frac{1}{4}\frac{2}{1}+\frac{3}{4}\frac{6}{1}=5$.
Making use of $AB=0$, $A^{2}=A$ and $B^{2}=B$ we find:
$\text{Var}X_{2}=\mathbb{E}X_{2}^{2}-\left(\mathbb{E}X_{2}\right)^{2}=\frac{1}{4}\mathbb{E}U^{2}+\frac{3}{4}\mathbb{E}V^{2}-25=\frac{1}{4}.6+\frac{3}{4}.66-25=26$.
Then $\mathbb{E}X=\mathbb{E}X_{1}+\mathbb{E}X_{2}=\frac{13}{2}$ and
$\text{Var}X=\text{Var}X_{1}+\text{Var}X_{2}=\frac{3}{4}+26=\frac{107}{4}$. 
A: To make this easier, let's consider cases:
Case 1: We roll a five before we ever roll an even number.
Case 2: We roll an even number before we ever roll a five.
Then the probability that it takes $n$ rolls to achieve both a five and an even number is the probability that either (a) you roll a five and no even numbers during the first $n-1$ rolls, and the $n$th roll is even, or (b) you roll at least one even number and no fives during the first $n-1$ rolls, and the $n$th roll is a five.
Can you see how to compute the probabilities of each of these outcomes?
