General Question

ragingloli's avatar

Can you solve the "Frog Problem"?

Asked by ragingloli (52278points) September 15th, 2019
Observing members: 0 Composing members: 0

14 Answers

Pinguidchance's avatar

If, as expected, this is a cunningly contrived Brexit conundrum then to give it 5.5 for average difficulty is two generous so let’s guess 10 / 5.5

LostInParadise's avatar

I get 2.93 rounded to two places. I don’t have a general formula, but I developed a recurrence relation. If we call the function f, then we want to find f(10). f(0) = 0. For f(n), there will always be 1 jump to start off and, since there is 1/n chance of landing on any lead, add 1/n * sum of f(i) for i from 0 to n-1. f(n) = 1 + 1/n(sum(f(i)), from i = 0 to i=n-1.

I was too lazy to calculate this by hand, so I wrote a short program to do the calculation.

LostInParadise's avatar

I suspect that the closed form is related to the log function. The number of jumps grows slowly, and the value of f(n) – log(n) changes even more slowly.

stanleybmanly's avatar

Before any mathematical considerations, I want to be certain that I understand the “problem” as stated. The frog is capable of jumping the river at one hop, yet we are to predict the chance of its landing on specific pads between?

ragingloli's avatar

The frog can hop to leaf 1, 2, 3, 4, etc, and to the other and the probability for each of those is equal.
And if, for example, on hop 1, he leaps to leaf 2, he then can jump to leaf 3, 4, 5, etc., again each of those being equally probably.
If he traversed the river a million times, how many hops would he make on average?

stanleybmanly's avatar

I don’t have a mathematical mind loli. But I have a question for you. Suppose you live on a subway line and you work downtown. Then suppose there are 9 subway stations between you and your job and you get to decide at which stations the train must stop. Which stations should I predict you will choose?

ragingloli's avatar

It will stop at all of them, because I am not going to be a dick to the other passengers

stanleybmanly's avatar

And if like the frog, you have the train and stations empty and to yourself? I truly want to understand. Does the frog have no control over where it will land? It simply jumps in the direction of the opposite shore?

ragingloli's avatar

Yes. And it chooses the next leaf randomly.

stanleybmanly's avatar

I think “choose” is really inappropriate. But do you believe a set can be formulated to predict the probability of landing on specific pads?

ragingloli's avatar

That is why I am asking you lot.

LostInParadise's avatar

Following the idea in the video, I ran a simulation, and the result agrees with what I calculated.

Let me explain a little better what I did.
Let f(n) be the average number of jumps with n possibilities.
f(1)= 1 initial jump over the pond + f(0), since there is nothing to jump to after jumping over the pond. f(0) is obviously 0 and this gives f(1) =1, which is intuitively obvious.

f(2) = 1 initial jump + ½ f(1) + ½ f(0) = 1.5.

f(3) = 1 + ⅓ f(2) + ⅓ f(1) + ⅓ f(0) and so on.

The great thing about doing this on a computer is that I only have to say that f(n) = 1 + sum(f(i))/n i from 0 to n-1. The computer function calls itself automatically and computes the individual f(i). I do have to provide a stopping point by saying that f(0)=0. Otherwise the program would try to compute f(i) for increasingly negative numbers and would never stop.

LostInParadise's avatar

I found an interesting simplification of the solution to this problem. Looking at the equation f(n) = 1 + sum(f(i))/n for i = 0 to n-1, notice that nf(n) has nearly the same terms as (n-1)f(n-1)
In fact nf(n) – (n-1)f(n-1) = 1 + f(n-1)
Simplifying, nf(n) = nf(n-1) +1
f(n) = f(n-1) + 1/n
f(n) is just the sum of the terms 1/i
f(n) = 1/1 ½…+1/n
This relationship is not at all obvious to me from the original problem.

LostInParadise's avatar

In case I did not make it clear, the closed form solution to the problem is the harmonic series f(n)= sum(1/i) for I = 1 to n. The series relates to logarithms since log is the area under the curve y=1/x. The harmonic series, like logarithms, grows very slowly, which I find surprising. I would have thought that the number of jumps would have been something like square root of n. So much for mathematical intuition.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther