TITLE: Expected value of number of draws
QUESTION [5 upvotes]: We have $5$ number in a bag: $(1,3,5,7,9)$. We draw one from the bag and then put it back. We do this until the sum of the numbers can be divided by $3$. Whats the expected value of the number of draws?
My idea was to solve it with Markov-chains:
States: $0,1,2$. So numbers$\mod 3$.
The matrix will be:
$\begin{pmatrix}
2/5 & 2/5 & 1/5 \\
1/5 & 2/5 & 2/5 \\
2/5 & 1/5 & 2/5
\end{pmatrix}$
Then we have an equation system: 
$k_1=1+2/5k_1+2/5k_2$, $\ k_2=1+1/5k_1+2/5k_2$ and $k_3=0$.
Even if I solve this, I'm not sure how to continue. Thanks for help.

REPLY [3 votes]: We may also consider an absorbing markov chain:
$$
A=\left(\begin{array}{rrrr}
0 & \frac{1}{5} & \frac{2}{5} & \frac{2}{5} \\
0 & \frac{2}{5} & \frac{1}{5} & \frac{2}{5} \\
0 & \frac{2}{5} & \frac{2}{5} & \frac{1}{5} \\
0 & 0 & 0 & 1
\end{array}\right)
$$
Expected time to absorbing state is then given by 
$$(I-Q)^{-1}\cdot c$$
where
$$
I=\left(\begin{array}{rrr}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{array}\right),
Q=\left(\begin{array}{rrr}
0 & \frac{1}{5} & \frac{2}{5} \\
0 & \frac{2}{5} & \frac{1}{5} \\
0 & \frac{2}{5} & \frac{2}{5}
\end{array}\right), c= \left(\begin{array}{r}
1 \\
1 \\
1
\end{array}\right)$$
which is 3.