Before any algebra, let me say what is actually on the screen, because this sentence hides three different questions and they have three different answers.
Reading one: the frog reaches position two for the first time at exactly the n-th second. Reading two: at second n the frog is sitting on position two, whenever it got there. Reading three: by second n it has reached position two at some point. These are the probability mass at n, a state probability, and a cumulative probability.
The words decide. Reaches is an action of arriving, not a state of being; exactly the n-th second explicitly excludes having arrived earlier. So the reading the words force is R1, first arrival at n, and that is what I will compute.
I am not going to quietly throw the other two readings away either: at the end I will put their formulas next to mine on the board, so we can both see how far apart the readings are. If you intended a different reading, the answer changes in a specific, nameable way.
I will branch openly: solve R1 now, report R2 and R3 as well, and repair nothing in silence.
Let me fix notation. Each second hands me an independent increment: it equals one with probability p and zero with probability one minus p. The position at time n is the partial sum, starting at zero, and the object I want is the first time this partial sum equals two.
There is a structural fact here that is the whole engine of the solution. The increment is zero or one, never two or more, so the frog cannot hop over position two, and it cannot come back to it. Its position is non-decreasing with steps of at most one.
That collapses the event, and I want the collapse written down: to first arrive at two at second n is exactly to be on one at second n minus one and to jump at second n. Forward: if you arrive at n then just before you you must have been strictly below two, and a single small jump from below two to two means you were at one. Backward: if you are at one at time n minus one, monotonicity says all earlier positions were at most one, so the jump at n is a first arrival.
Finally, sitting at one at time n minus one just means exactly one jump in the first n minus one seconds. The question is now a counting question, not a probability-theory question.
I am going to draw the path space, because the count that everyone gets wrong lives right here in the picture. Seconds run left to right, position runs up, and each of the three coloured staircases is one full history of the frog: diagonal is jump, flat is stay.
Watch where each staircase touches the dashed boundary line for the first time. All three land on position two exactly at second four: one jumps at second one then waits, one jumps at two, one jumps at three and then again at four. Trace the grey dashed one: it reached position two at second two and simply sat there. It has position two at time four, so it counts for the reading by time four, but it is completely excluded from exactly at four.
And now the general count reads itself off the lattice: fix the landing jump at second n, and the entire freedom is which one of the first n minus one seconds carried the earlier jump. That is n minus one choices, no more.
Each history costs p squared q to the n minus two, all of them disjoint, so the probability I want is n minus one times that. The algebra is already finished; the next beat just writes it.
The lattice count multiplies out in one line: n minus one admissible staircases, each of probability p squared q to the n minus two, so the first-arrival probability is n minus one times p squared times one minus p to the n minus two.
In the catalogue this is the negative binomial law of the second success. Naming it is filing, not solving: the derivation the examiner asked for is the fixing of the last jump and the count n minus one, which is done above.
Now the contrast I promised in the first beat. If the sentence had meant is at position two at second n, the answer would be the binomial coefficient n choose 2 times the same powers, and that is n over two times too big, because it also counts histories that arrived earlier and sat on the level. If it had meant has reached by second n, that is one minus the probabilities of zero and one jumps, a cumulative quantity, not a mass at n.
Take p of 0.3, n of 6: the three readings give 0.108045, 0.324135 and 0.579825. Three readings, three numbers, a factor of three apart. Note 0.47178. That is the cumulative value at n of 5, not of 6; a silent substitution is not a small error here, and that is why all three stay on the board.
Three independent checks before I trust the closed form. Row one is the formula at p of 0.3, with the exact fractions lined up in row two: nine hundredths, sixty-three five-hundredths, thirteen hundred twenty-three ten-thousandths, and so on.
Row two is brute force: for each n I listed all two-to-the-n histories of jumps and stays, ran the frog on each, recorded the first second at which the position first reached two, and summed probabilities in exact rational arithmetic. Every entry in row two is a fraction identity with row one, not a decimal coincidence.
Row three is Monte Carlo, half a million walks with a fixed seed. At n of 4 the formula says 0.132300 and the simulation says 0.132176; means 6.6594 against 6.6667, standard deviations 3.9326 against 3.9441. All within sampling noise.
And the chart shows the shape the theory predicts: a single peak at n of 4, geometric decay after it, partial sums 0.8507 by ten and 0.99999 by forty. The mass is where the mode analysis says it should be.
Everything so far agrees, but looks-like-one is not is-one, so let me prove normalisation rather than admire the table. Shift the index and the total mass is p squared times the sum of k q to the k minus one.
That sum is the differentiated geometric series: differentiate one over one minus q term by term, legitimately inside the unit disc, and you get one over the quantity one minus q, squared. Since one minus q is p, the total mass is exactly one for every p greater than nought.
Read the licence as the hypothesis of the problem. The identity needs absolute q below one, which is p above nought; the question never said it, and now it is on the board. At p of 1 the formula collapses honestly to arrival at second two; at p of 0 there is no distribution and the question has to be re-asked.
As a belt and braces, high-precision term-by-term summation at p of 0.3 returns one to six decimal places, matching the partial sums from the previous beat, whose tail at n of 40 was about one thousandth of a percent.
The masses must sum to one over the whole support.
Let me reach the same law from a different direction, because agreement between two independent derivations is cheap insurance. The wait has a natural cut: the first jump lands the frog on level one after a geometric number of seconds, and the extra wait for the second jump is geometric again, independent of the first, since the coin has no memory once the frog is sitting on one.
Convolving: the probability that the sum equals n is a sum over the split point, every term is p squared q to the n minus two, and the number of terms is n minus one. Out comes exactly the beat 4 formula, confirmed symbolically.
Not a coincidence - choosing the split second is choosing which staircase we drew, so this route reuses the same count in a different notation. What IS genuinely new is the moments: the mean is one over p plus one over p without differentiating anything, and the variances of independent stages add.
At p of 0.3 the theory says mean 6.6667 and standard deviation 3.9441; the half-million-walk simulation returned 6.6594 and 3.9326. Two derivations, one simulation, all agreeing.
So the answer is: n minus one, p squared, one minus p to the n minus two, for n at least two, and nought below. Note the three readings agree at n of 2, where all of them are just p squared - the sanity point where arriving, being, and having-arrived coincide.
The mode is a function of p, and the ratio test gives it exactly: successive masses increase while n is at most one over p, so the peak sits at the floor of one over p plus one, with a tie when one over p is an integer - p of one half puts equal mass a quarter on n of 2 and n of 3.
The two limits pin the shape down. As p rises to one the law collapses onto second two. As p falls to zero the mean diverges like two over p, but the scaled wait has a genuine limit, the two-stage gamma law: at the test point x of 2 the exact tails converge 0.4046, 0.4059, 0.4060 to the limiting 0.4060 as p shrinks tenfold each step.
And the general answer for boundary r is the negative binomial with mean r over p. The failure boundary is as important as the formula: allow a step bigger than one and the frog can overshoot, first arrival stops being a below-two-then-jump event, and the closed form - and even the reading of the sentence - has to be renegotiated. That is the line where this method stops.
If pushed one level deeper, the topic note wants Markov-chain language. Make position two absorbing, write the three-state transition matrix, and the arrival mass at n is p times the zero-one entry of the matrix to the n minus one. I checked this with exact powers: at n of 4 it reproduces 0.1323, and the zero-two entry reproduces the cumulative values of the branch table.
The probability generating function packs the whole law into p s over one minus q s, squared: setting s equal to 1 returns one - a third proof of normalisation from the generating function itself - and its derivatives regenerate the mean two over p and variance two q over p squared.
One diagnostic worth offering: the conditional chance of arriving at second n given no arrival yet increases with n, from p squared at n of 2 up to p in the limit, reaching 0.29652 by n of 200 at p of 0.3. The composite wait is not memoryless even though both stages are - which is exactly the pedagogy of this question: first arrival inherits the structure of two geometrics, not their amnesia.
All of this is beyond what was asked; I would keep it in reserve unless invited.
Then the answer is the binomial reading: n choose two p squared q to the n minus two, and it is larger than my first-arrival law by exactly n over two, because every arrival before second n that still sits on level two gets counted.
The giveaway that it cannot be the answer to my reading: summed over n at p of 0.3 it gives 3.3333, not 1. A quantity that does not add to one over its putative support is not a distribution in that variable.
But the number is not nonsense - it is exactly one over p, the expected number of seconds the frog spends on level two: it arrives once and then holds the level for a geometric time with mean one over p. Wrong reading, right fact; I would say all three sentences.
That is the CDF of my law: one minus q to the n minus n p q to the n minus one, because to have reached by second n is to have taken at least two jumps, and the number of jumps in n seconds is binomial. The no-overshoot structure is again what turns reached into at-least.
At p of 0.3 the cumulative reading runs 0.09, 0.216, 0.3483, 0.47178 through n of 5 - and the increments of exactly this sequence reproduce my pmf: 0.3483 minus 0.216 is 0.1323. The three readings are one story: R1 is the mass, R3 its cumulative, R2 a different quantity that is not a distribution in n at all.
The tail form is useful too: the probability of still not having arrived by n is q to the n plus n p q to the n minus one - at n of 30 that is 0.0003123, matching the pmf tail sum.
The shape survives completely: first arrival at level r at second n means one jump short at every earlier moment and the r-th jump at n, so the count is n minus one choose r minus one, giving the negative binomial with parameters r and p, mean r over p, variance r q over p squared.
The r of 3 family still sums to one over its support - I checked that symbolically - and at r of 1 everything degenerates to the bare geometric, which is the memoryless one: the ONLY case of this family that has no history.
The scaling limit is the Erlang family: with r fixed and p going to zero, p times T converges in law to the gamma distribution with shape r and rate 1 - the sum of r exponential stages. Our two-stage limit was the member at r of 2 itself.
What breaks is not the formula but the setting: any step larger than one reopens the overshoot question and first arrival needs a recursion over boundary states instead of a single binomial coefficient.
Rule: jump forward with probability one half, stay with one quarter, slip back with one quarter. Brute-force enumeration of all three-to-the-n histories gives 0.25, 0.125, 0.109375, 0.078125, 0.063477, 0.050293, 0.041443 for the first arrival at seconds 2 through 8.
The factor n minus one is dead. Now the paths revisit levels - a history can go up, slip back, and recover - so the mass at n depends on the whole shape of the walk, not on the position of one jump among n minus one slots.
What survives is the renewal idea, as a recursion now rather than a closed form: the walk is spatially homogeneous, so the time to cross one level is a fresh independent copy each time, and the two-level wait is still tau-one plus tau-two - only the passage law tau has stopped being geometric. Condition on the very first step - jump, stay, or slip - and a recursion for its masses falls out; fed by hand it starts one half, one eighth, three thirty-seconds, and its self-convolution lands on a quarter, an eighth, seven sixty-fourths for the second, third and fourth seconds. That is precisely what the brute-force enumeration printed, so the decomposition is audited, not assumed.
And a real new phenomenon: arrival now has probability one only because the drift is positive, a quarter per second. Tilt the slip probability so the drift is at most zero and a positive fraction of walks never arrive at all - the masses sum to strictly less than one, and the question 'the probability that it reaches' quietly becomes a question about a defective distribution.