text
stringlengths
0
66.2k
This is a second-order linear recurrence relation. To solve this, perhaps we can find a solution that is linear or quadratic?
Alternatively, let me think of the difference between E_{k} and E_{k+1}. Let me define D_k = E_{k} - E_{k+1}. Then maybe express the recurrence in terms of D_k.
Let me try that.
Starting from the recurrence:
E_k = 1 + (k/2019) E_{k-1} + ((2019 - k)/2019) E_{k+1}
Let me rearrange this to express E_{k+1} in terms of E_k and E_{k-1}:
Multiply both sides by 2019:
2019 E_k = 2019 + k E_{k-1} + (2019 - k) E_{k+1}
Then, rearranged:
(2019 - k) E_{k+1} = 2019 E_k - k E_{k-1} - 2019
Hmm, not sure yet. Let me consider the difference between E_{k} and E_{k+1}:
Let D_k = E_k - E_{k+1}
Then, perhaps we can write a recurrence for D_k.
First, let me express E_{k+1} from the equation above:
(2019 - k) E_{k+1} = 2019 E_k - k E_{k-1} - 2019
Therefore,
E_{k+1} = [2019 E_k - k E_{k-1} - 2019]/(2019 - k)
Hmm, complicated. Let me see if I can find a relation between D_{k} and D_{k-1}.
Alternatively, maybe instead of D_k, consider another approach.
Alternatively, let me consider the case for small numbers first. Maybe solving for a smaller case and see a pattern.
Suppose instead of 2019 frogs, let's take N = 2 frogs. So initially, 1 frog in the pool and 1 on the shore. Wait, actually in the problem, starting with 2018 in pool and 1 on shore, so N = 2019 total. Let me try with N=2, so starting at k=1, wanting to reach k=0.
Wait, in that case, starting at k=1, the expected time E_1?
Let me compute for N=2.
In N=2, the states are 0 and 1 and 2. Wait, but we start at 1. We need E_1.
The equations would be:
For k=1:
E_1 = 1 + (1/2) E_0 + (1/2) E_2
But E_0 = 0.
So E_1 = 1 + (1/2)(0) + (1/2) E_2 => E_1 = 1 + (1/2) E_2
For k=2:
E_2 = 1 + (2/2) E_1 + (0) E_3 (since E_3 would be beyond, but actually in N=2, maximum k is 2. Wait, but in this case, starting from k=2, the next step would be to go to k=1 with probability 1 (since all frogs are on shore, so the next move must be to the pool). Wait, actually, in N=2, if you are at k=2 (both frogs on ...
So for N=2, the equations are:
E_0 = 0,
For k=1: E_1 = 1 + (1/2)(0) + (1/2) E_2,
For k=2: E_2 = 1 + (2/2) E_1 + (0) E_3,
So E_2 = 1 + E_1.
Substituting into E_1 equation:
E_1 = 1 + (1/2)(E_2) = 1 + (1/2)(1 + E_1) = 1 + 1/2 + (1/2) E_1
So E_1 - (1/2) E_1 = 3/2 => (1/2) E_1 = 3/2 => E_1 = 3.
So starting from k=1 with N=2, the expected time is 3.
Alternatively, let's see: starting at 1, each step, with 1/2 chance to go to 0 (done in 1 step), and 1/2 chance to go to 2. From 2, you have to go back to 1, then again. So the expectation is E_1 = 1 + (1/2)(0) + (1/2)(1 + E_1). Wait, that's the same as above, so yes, 3.
Alternatively, thinking of it as a Markov chain: from state 1, with probability 1/2 you finish in 1 step, with probability 1/2 you go to 2, which then takes an expected 1 + E_1 more steps. So:
E_1 = (1/2)(1) + (1/2)(1 + E_2)
But E_2 = 1 + E_1, so substituting:
E_1 = 1/2 + (1/2)(1 + 1 + E_1) = 1/2 + (1/2)(2 + E_1) = 1/2 + 1 + (1/2) E_1
Thus, E_1 - (1/2) E_1 = 3/2 => same result. So E_1=3.
Hmm, so for N=2, the answer is 3. Interesting.
Now let's try N=3. Let me see if I can find a pattern.
Suppose N=3. So total frogs 3, starting with 2 in pool and 1 on shore (k=1). Wait, actually, the problem starts with 2018 in pool and 1 on shore, so for N=3, starting at k=1, and we want E_1.
So equations: