Expected value and recursion II

In a one of a square of 2 × 2 2 \times 2 square grid sits a stone, that randomly moves to the remaining squares with equal probabilities.

What is Expected number of moves taken to return to original square?


Bonus: Generalize for n n Sided larger square where stone has equal probability of jumping to ANY of Remaining Squares


The answer is 4.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

From the first place, the stone can move to any other three places. After it goes there, there is one in 'three blank units' chance that it'll go to the starting point, no matter where it goes, if it's not the starting position, the probability of getting to the starting position is one in three, 1 3 \frac{1}{3} . We want to reach a probability of 100% (probability of 1) in getting to the starting position, so we'll roll the dice x x amount of times such that

1 3 x = 1 \frac{1}{3} * x = 1

Or x = 3 \text{Or } x=3

(This is not the actual probability, but a way to calculate the expected value)

Since total moves also include the first move where it leaves the starting position, we'd have to roll a total of 3 + 1 = 4 \boxed{3+1=4} times.


Using the same logic the formula for a square with n n unit as its side with one unit square containing the stone is,

1 1 n 2 1 + 1 n 2 \frac{1}{\frac{1}{n^2 - 1}} +1 \rightarrow \boxed{n^2}

Rolling a dice with probability 1/3 three times does not result in a probability 1 but instead 1-(2/3)^3 for getting the starting position at least once.

And, even if it was somehow guaranteed that after at most 4 steps you reach the original position (which is not!), then the expected number of steps would be <4, because in some cases it only takes 2 or 3 steps.

Jonathan Dinkelbach - 9 months, 3 weeks ago

That's what I thought Jonathan, so you can roll the die to infinity without ever falling back to the starting square, well obviously the limit of (1-2/3**k) when k tends towards + infinity is 0 but you get the idea. 👍

Michel Pi - 9 months, 3 weeks ago

Log in to reply

'Roll the die to infinity without ever falling back', in fact the opposite, it says just '4' moves. It's an elementary take on Expected Value.

A Former Brilliant Member - 7 months, 2 weeks ago

It all boils down to calculating the infinite sum

1 3 n = 2 n ( 2 3 ) n 2 = 4 \frac{1}{3}\sum_{n=2}^{\infty} n(\frac{2}{3})^{n-2} = 4

Stanley Kowalski - 9 months, 2 weeks ago
Aryan Sanghi
Aug 19, 2020

For n n sided square

Now, Probability returning to original square at any point P = 1 n 2 1 \displaystyle P = \frac{1}{n^2 - 1}

E = (Number of moves to return) × (Probability that it returns in that many moves) \displaystyle E = \sum \text{(Number of moves to return)} × \text{(Probability that it returns in that many moves)}

E = 1 × 0 + 2 × 1 n 2 1 + 3 × ( n 2 2 n 2 1 ) × 1 n 2 1 + 4 × ( n 2 2 n 2 1 ) 2 × 1 n 2 3 + \displaystyle E = 1 × 0 + 2 × \frac{1}{n^2 - 1} + 3 × \bigg(\frac{n^2 - 2}{n^2 - 1}\bigg) × \frac{1}{n^2 - 1}+ 4 × \bigg(\frac{n^2 - 2}{n^2 - 1}\bigg)^2 × \frac{1}{n^2 - 3} + \ldots \infty

E = r = 2 r × ( n 2 2 n 2 1 ) r 2 × 1 n 2 1 \displaystyle E = \sum_{r=2}^{\infty} r × \bigg(\frac{n^2 - 2}{n^2 - 1}\bigg)^{r-2} × \frac{1}{n^2 - 1}

Apply A.G.M. summation to get

E = n 2 \color{#3D99F6}{\boxed{E = n^2}}

For n = 2 n = 2

E = 4 \color{#3D99F6}{\boxed{E = 4}}

I wanted to do that but well with this technique you get the most probable result, I think: that's what the question implied for me.

Michel Pi - 9 months, 3 weeks ago

Log in to reply

I didn't understand your question can you please elaborate? :)

Aryan Sanghi - 9 months, 3 weeks ago

I might be wrong, the way I read the solution, I think you haven't included the move where it leaves the starting position.

A Former Brilliant Member - 7 months, 2 weeks ago

Log in to reply

Actually, i have included it. In that case, probability is 1 1 , so no issues for that move. :)

Aryan Sanghi - 7 months, 2 weeks ago

Log in to reply

I see it now, thank you

A Former Brilliant Member - 7 months, 2 weeks ago

It was included in the first term and not others for shortening the solution. :)

Aryan Sanghi - 7 months, 2 weeks ago
Saket Goyal
Aug 19, 2020

Let us start by labelling the smaller squares.

Let the one in which stone sits = A A

The square Right to A A = B B

The square Left to A A = C C

The square Diagonally opposite to A A = D D

Let the expected number of moves taken to reach A A from any i i square = E i E i

From,say, B B expected number of moves can be 1(with P = 1 / 3 P=1/3 )

,Or it could equal to E ( C ) + 1 E(C)+1 (with P = 1 / 3 P=1/3 ) (1 is added as our exp. value would have increased by 1 if we go to C)

,Or it could be E ( D ) + 1 E(D)+1 (with P = 1 / 3 P=1/3 )

By total expectation E ( B ) E(B) = ( 1 ) ( 1 ) ( 1 / 3 ) (1/3) + E ( C ) + 1 E(C) + 1 ( 1 / 3 ) (1/3) + E ( D ) + 1 E(D) + 1 ( 1 / 3 ) (1/3)

The key is to realize that E ( B ) E(B) = E ( C ) E(C) = E ( D ) E(D) as all the conditions are same for these squares as from any of these squares there is a 1/3 probability of returning to A A and a 2/3 probability of going to other 2 squares.

Thus, E ( B ) E(B) = E ( C ) E(C) = E ( D ) E(D) = 3 3

But we are not done yet as we started at A A .

From A A we can go to B B ( and increase exp. value by 1) or to C C ( and increase exp. value by 1) or to D D ( and increase exp. value by 1) (all with equal probabilities)

So, E ( A ) E(A) = ( E ( B ) + 1 ) (E(B) + 1 ) ( 1 / 3 ) (1/3) + ( E ( C ) + 1 ) (E(C) + 1) ( 1 / 3 ) (1/3) + ( E ( D ) + 1 ) (E(D) + 1) ( 1 / 3 ) (1/3)

So, E ( A ) E(A) = 4 4

I hope you can now generalize it yourself :)

In this picture the letters represents the expected number of moves from given place. A = 1 + 1 2 B + 1 2 C B = 1 + 1 2 D C = 1 + 1 2 D D = 1 + 1 2 B + 1 2 C \begin{array}{rl} A &= 1+\cfrac12B+\cfrac12C\\ B &= 1+\cfrac12D\\ C &= 1+\cfrac12D\\ D &= 1+\cfrac12B+\cfrac12C\\ \end{array} You can see A = D , B = C A=D, B=C : A = 1 + B B = 1 + 1 2 A 1 2 A = 2 A = 4 \begin{array}{rl} A &= 1+B\\ B &= 1+\cfrac12A\\ \end{array}\implies \cfrac12A=2\implies A=4

Richard Desper
Dec 9, 2020

Consider a related problem: suppose we toss a fair 6 6 -sided die and stop when a ' 1 1 ' or a ' 2 2 ' is observed. This describes a geometric distribution.

A geometric distribution with parameter p p stops after k k steps with probability p ( 1 p ) k 1 p(1-p)^{k-1} . And the expected number of steps observed is 1 p \frac{1}{p} . See the wiki for details about this distribution.

With p = 1 3 p=\frac{1}{3} , the expected number of steps needed to get back to the first step after leaving it is 3 3 . Add one for the initial step, and the answer to the problem is 4 4 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...