 # math question (probability calculation)

I know that, if X independent events each have a Y chance of happening, the chance of all of them happening is just Y to the power of X. So, the odds of flipping a coin 5 times and having them all come up heads is (0.5) to the fifth power, or approximately .032.

But how would you calculate the odds of, for instance, flipping a coin 5 times and having at least 4 of them come up heads? IOW, the chance of either X or X-n events happening?

TIA.

Out of 32 possible sets of coin flips, six of them meet your criteria: The one possibility with all heads, and five more possibilities where the first one is tails, the second one is tails, or so on.

Right, I can figure that out in my head for that simple example. I was hoping for a formula that could be used for more complex situations.

I’m thinking it might be (y to the power of x)+ (y to the power of x-1)(1-y)(x). That does work for the coin flipping example, but I’m not mathy enough to tell if it applies generally. Also, that only works if the cases of interest are either “all events occur” or “all events except one occur”. I wouldn’t have any idea how to figure it if you also are interested in cases where all events except (some number larger than one) occur.

This is the binomial distribution.

Awesome. Thanks, Dopers!

Note that the formula for a binomial distribution value counts exactly Y out of X.

The OP wanted to know, for example, at least 4 out of 5. So you want at least the value for at least Y out of X you have to add the terms from Y to X. Which is even messier than exactly Y out of X.

The odds of k heads and n-k tails from n flips is the coefficient of h^t^{n-k} in the expansion of (t + h)^n. If you want at least k heads you have to add the various numbers.

The “at least” version of the problem is answered with the “cumulative binomial distribution.” It is usually expressed with the capital Sigma “summation” operator. They tend to be very tedious to solve by hand, but approximations can be arrived at quickly with various graphs.

Incomplete beta function ?

You can use a computer to calculate numerical values, or various tables or approximations.

In addition to the calculator page linked to above, here is another calculator page, Wolfram has it implemented as Beta[z, a, b], and this page has some convergent continued fractions near the bottom. Also, Pearson’s tables are available from the Internet Archive.