Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a follow-up question to the one posted here:

Random walking and the expected value

I want to generalize the probability.... lets say walking to the neighbour in the clockwise direction is p ,and the counter clockwise is 1-p.

Any help would be greatly appreciated


share|cite|improve this question

The answer is still 4, because (by the symmetry) the invariant distribution of the Markov chain is still uniform, and the mean time to return to the node is the reciprocal of the corresponding component of the invariant distribution vector, $\mathbb{E}(T_1) = \frac{1}{\pi_1} = 4$.

Alternatively, let $m_k$ denote the mean number of transitions until visiting node 1. Conditioning on the next step: $$ m_2 = 1 + p m_3, \quad m_3 = 1 + (1-p) m_2 + p m_4, \quad m_4 = 1 + (1-p) m_3 $$ Which gives: $$ m_2 = 1 + \frac{2p}{1-2p(1-p)}, \quad m_3 = \frac{2}{1-2p(1-p)}, \quad m_4 = 1 + \frac{2(1-p)}{1-2p(1-p)} $$ The mean time to return to node 1 is: $$ 1 + (1-p) m_4 + p m_2 = 1 + 1 + \frac{2}{1-2p(1-p)}\left((1-p)^2 + p^2\right) = 4 $$

share|cite|improve this answer
I like the Markov chain method. – Hagen von Eitzen Sep 5 '12 at 21:09

Let $e$ be the desired expectation. Let $a_2$, $a_3$, $a_4$ be the expected time until one returns to vertex $1$, given that we are at $2$, $3$, $4$ respectively.

We have the following equations:

$e=1+ pa_2+(1-p)a_4$; This is because we take $1$ step, and enter State $2$ with probability $p$, and State $4$ with probability $1-p$.

$a_2=1+pa_3$; one step backwards and it's over, else we are in State $3$. This happens with probability $p$.



Four linear equations in four unknowns: solve.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.