Independent trials that result in a success with probability p are successively performed until a total of r successes is obtained. Find the probability that exactly n trials are required
Here is my (probably incorrect) attempt:
p: probability of success $P_n$ = probability of success on nth trial
So in the first part of the equation I want the probability of n trials to have r successes, so I multiply the probability of success * 1- probability of n-1 trials being successful r times
For the second part of the equation I want the probability of n-1 trials, so I multiply the compliment of the probability r successes (1-p) multiplied by probability of n-1 trials being successful ($P_{n-1}$)
Let $P_n$=the probability that n trials result in r successes $P_n=(1-P_{n-1})p+(1-p)P_{n-1}$