03-03-2016, 03:57 PM

I know that you can use a binomial probability distribution to determine the odds of x successes within n independent trials, each with chance of individual success P - the usual B(n,P,x) = COMB(n,x) * P^x * (1 - P)^(n - x).

Suppose I'm concerned with a target number of successes - say 2 - at which point I stop carrying out trials. I should be able to calculate the odds of needing to carry out n trials in order to reach that many successes, but I'm not quite getting there, and I'm not enough of a statistician to know what to search for.

Naively, one might think you would just calculate B(n,P,x) for a given n, but if those x successes came before the nth trial, you wouldn't have actually performed n trials.

It almost sounds like a Bayesian sort of thing, e.g. P^x chance of x successes in x trials, 1 - P^x chance of needing to carry out more than x trials, etc. but I imagine there's a more elegant way to compute it than tree traversal.

Note that these would still be fully independent trials, just that we'd be stopping after the target number of successes, and want to calculate the odds of having to carry out a given number of trials.

Suppose I'm concerned with a target number of successes - say 2 - at which point I stop carrying out trials. I should be able to calculate the odds of needing to carry out n trials in order to reach that many successes, but I'm not quite getting there, and I'm not enough of a statistician to know what to search for.

Naively, one might think you would just calculate B(n,P,x) for a given n, but if those x successes came before the nth trial, you wouldn't have actually performed n trials.

It almost sounds like a Bayesian sort of thing, e.g. P^x chance of x successes in x trials, 1 - P^x chance of needing to carry out more than x trials, etc. but I imagine there's a more elegant way to compute it than tree traversal.

Note that these would still be fully independent trials, just that we'd be stopping after the target number of successes, and want to calculate the odds of having to carry out a given number of trials.