The transition probability matrix is$$ \mathrm P= \begin{pmatrix} 0 & 2/3 & 1/3 \\ 1/2 & 0 & 1/2 \\ 1/2 & 1/2 & 0 \\ \end{pmatrix} $$ Starting from state 0, the mean number of visits of state 2 before coming back to state 0 is
- 5/9
- 6/9
- 7/9
- 8/9
- None of the above is correct.
If my step is from 0->1->2->0, the probability = $1/6$, but I don't know the total step from state 0 toward itself, and also what is the meaning of "the mean number of visits"?
The "mean number of visits of state $2$" mean how many times do you visit state $2$ on average.Or also the expected number of visit of state $2$. So the mean number of visit is given by the sum, over all runs going from $0$ to $0$, of the probability of the run times the number of times it visit $2$.
So the example you gave ($0\to1\to2\to 0$) gives you that the average number of visit is greater than $1/6*1=1/6$ (it is greater since you only considered one run, you should consider all runs to get the right value.
Denoting $E(n)$ the expected number of visit of state 2 from state $n$, you can right the 3 equation defining $E(0),E(1)$ and $E(2)$ solving this equation will give you the value you look for (it is $E(0)$).
Below are the 3 equations, please do not look at it if you didn't understand something. Ask if something is not clear I'll try to help/be clearer.
$ $
$ $