Redfin interview question

Given a cube and a random walker on the cube, find the expected value of the # of steps that the random walker takes to reach the opposite vertex of the cube.

Interview Answers

Anonymous

23 Oct 2015

Originally this markov processes has 7 states, since there are 7 vertices on the tube except the opposite vertex. However, the 7 states can be reduced to 3 due to symmetry: Vertices that is 1, 2 and 3 step(s) away from the opposite. The symmetric property is pretty obvious. Now by markov property: E[3] = 1/3 * (E[2] + 1) * 3 (starting vertex can only access vertices 2 steps away from it) E[2] = 1/3 * (E[1] + 1) * 2 + 1/3 * (E[3] + 1) E[1] = 1/3 + 1/3 * (E[2] + 1) * 2 (opposite vertex is absorbing state) These give E[1] = 7, E[2] = 9, E[3] = 10. So 10 steps.

1

Anonymous

10 Mar 2016

This is a Markov chain problem. WinTheBattle's answer is right.

Anonymous

5 Nov 2014

For 2 steps: 4 ways of (1/4)*(1/4) = 1/4 For 3 steps: 8 ways of (1/4)*(1/4)*(1/4) = 1/8 etc... Expected Value is then: 2/4 + 3/8 + 4/16...etc = 3/2

1