posts | comments | archives | links | create | song
(reminder: all quotes here are fiddled, probably.)

The frog problem


standupmaths, Can you solve The Frog Problem? (youtube)

Problem:

1. When the frog jumps it randomly chooses from one of the possible landing places.
2. The frog keeps jumping forwards until it crosses the river.
3. If the maximum is n jumps and the minimum is 1 jump to cross the river, what is the expected number of jumps?

The answer should be an explicit formula, not a non-recusive relation.
Someone said in the comments that the answer is the harmonic series.

Let E(n) be the expected number of jumps in where the frog has n possible spaces to jump to at the beginning. (i.e. n-1 lotus leaves and 1 spot for the opposite bank).
...
E(n) = 1/n + 1/(n-1) + 1/(n-2) + ... + 1

I cannot quite follow how he gets E(n) = 1/n * (1 + E(n-1)) + (n-1)/n * E(n-1), though I get the same answer E(n) = 1/n + E(n-1).

Here is my line of thought:

E1 = 1
E2 = 1/2*1 + 1/2*(1 + E1)
E3 = 1/3*1 + 1/3*(1 + E1) + 1/3*(1 + E2)
E(n) = 1/n*1 + 1/n*(1 + E1) + 1/n*(1 + E2) + ... + 1/n*(1 + E(n-1))

Grouping the terms we get
E(n) = 1 + 1/n*(E1 + E2 + ... E(n-2) + E(n-1))

Now let's look at E(n-1). Following the similar argument we have
E(n-1) = 1 + 1/(n-1)*(E1 + E2 + ... + E(n-2)), so
E1 + ... + E(n-2) = (n-1)*E(n-1) - (n-1)

Putting into E(n) we get E(n) = 1/n + E(n-1).

0 Comments:

coComment


:: Kommentar veröffentlichen
 (留言請留名, 謝!)

<< Home