I've been trying to solve this question for some time now, and I could not figure out the second part of the exercise. Here it is:
Consider a circle with five markings 0, 1, 2, 3, 4, in that order. Suppose that a particle starts at state 0 and moves to state 1 or 4 with probability 1/2 each. Subsequent movements are to one of its neighbors with equal probability. Let $X_{n}$ be the state of the particle at time $n \geq 0$. Let
$$ \tau = \min \{n \geq 1: X_{n}=0 \} \text{ and } V_{3} = \sum_{n=1}^{\tau}I(X_{n}=3) $$
a) Compute $E(\tau)$
b) Compute $E(V_{3})$
For part (a) I'm using that $X_{n}$ is an irreducible Markov chain with finite number of states $S = \{0,1,2,3,4\}$. It follows this chain is positive-recurrent and has a unique stationary distribution, which is
$$ \pi = \left( \frac{1}{|S|},\dots,\frac{1}{|S|} \right) $$
The mean recurrence time for any of the states is then
$$ \mu_{i} = \frac{1}{\frac{1}{|S|}} = |S|, i \in S $$
From this I got $E[\tau] = |S| = 5$ since $\tau$ is the time it takes to go back to state 0 after the chain started there. I wonder how can I solve this using recurrence, like in similar Markov chain problems.
For part (b) I thought about using total expectation but I'm not sure how to move forward. This is what I have so far
$$ E[V_{3}] = E[E[V_{3}|\tau=t]] = E \left[E \left[ \left. \sum_{n=1}^{\tau}I(X_{n}=3) \right| \tau=t\right] \right] = E\left[ \sum_{n=1}^{\tau}P(X_{n} = 3) \right] $$
Any suggestions will be appreciated.
EDIT: I added my attempt for an answer using @Joe suggestions. Let me know if you have any comments.