Question: I have this question for in my homework:

[![enter image description here](https://i.stack.imgur.com/QMake.png)](https://i.stack.imgur.com/QMake.png)

My attempt of solution:

Let $2 \leq T \leq n$ be the index of the second observed success. If $T = k$, then the second success was observed on the k-th trial and therefore in the $k-1$ preceding trials we had $k-2$ failures and 1 success. There are $\frac{(k-1)!}{(k-2)!1!} = k-1$ ways of forming series of 1 success and $k-2$ failures. For a given order, the probability of having a second success in the k-th trial is $p^2(1-p)^{k-2}$. So, $\mathbb{P}(T=k) = (k-1)p^2(1-p)^{k-2}$.

That seems reasonable to me, but i'm a bit afraid of having messed up with the combinatorics parr. Is it right? Any more insights? Thanks so much!

Answer: 
The probability mass function for count of trials *until* the second success is indeed:

$$\mathsf P(T=k) = (k-1) p^2(1-p)^{k-2}\quad\Big[k\in\{2, ...\}\Big]$$

The derivation is exactly as you did.   It is the probability for obtaining some *arrangement* of *one* success and $k-1$ failures, followed immediately by a *second* success.

$\blacksquare$
A 6-sided die, a piece of paper to record results, and 20-30 minutes of time can go a long way towards *confirming* (although not definitively *proving*) the correctness of the formula. Roll the die until you see a "six" for the second time. Record how many rolls it took. Repeat the experiment say 50 times. Make a histogram of the resulting counts. It should look reasonably close to the graph of your formula for the pmf. If your formula is just a little off, then you are unlikely to detect the error, though if your calculations are fundamentally misguided you should notice a clash between your observations and your formula. 

If you know a bit of programming then you can do even more. For example, a Python simulation of the experiment (with $p$ specified by the user) can be written in less than 10 lines of code and be run hundreds of thousands or even millions of times. Even minor errors in the formula should be easy to detect.

Still -- there is something to be said about getting in the habit of performing physical experiments (when relevant) while learning probability. Human beings have notoriously poor intuitions when it comes to probability. Careful *observation* of random phenomena is a good way to start to correct your intuition.