# math question (probability calculation)

**URL:** <https://boards.straightdope.com/t/math-question-probability-calculation/820840>\
**Category:** Factual Questions\
**Created:** [September 5, 2018, 11:10pm UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840 "2018-09-05T23:10:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thing\_Fish](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@Thing\_Fish](https://boards.straightdope.com/u/Thing_Fish)\
**Post date:** [September 5, 2018, 11:10pm UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/1 "2018-09-05T23:10:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 5, 2018, 11:45pm UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/2 "2018-09-05T23:45:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Thing\_Fish](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@Thing\_Fish](https://boards.straightdope.com/u/Thing_Fish)\
**Post date:** [September 6, 2018, 12:14am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/3 "2018-09-06T00:14:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [September 6, 2018, 12:30am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/4 "2018-09-06T00:30:49Z")

</div>

What you’re asking about is [binomial probabilities](https://www.dummies.com/education/math/statistics/how-to-find-binomial-probabilities-using-a-statistical-formula/). See also [here](https://stattrek.com/probability-distributions/binomial.aspx) and the associated Binomial Probability Calculator [here](https://stattrek.com/online-calculator/binomial.aspx).

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [September 6, 2018, 12:31am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/5 "2018-09-06T00:31:43Z")

</div>

This is the binomial distribution.

> **[Binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution)**
>
> In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes–no question, and each with its own Boolean-valued outcome: success (with probability p) or failure (with probability 
>   
>     
>       
> q
> =
> 1
> −
> p
>       
>     
> {\\displaystyle q=1-p}
>   
> ). A single success/failure experiment is also called a Ber...

---

<div class="post-metadata">

**Author:** ![Thing\_Fish](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@Thing\_Fish](https://boards.straightdope.com/u/Thing_Fish)\
**Post date:** [September 6, 2018, 3:15am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/6 "2018-09-06T03:15:40Z")

</div>

Awesome. Thanks, Dopers!

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [September 6, 2018, 3:18pm UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/7 "2018-09-06T15:18:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [September 6, 2018, 7:11pm UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/8 "2018-09-06T19:11:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tim\_R.Mortiss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim_r.mortiss/32/142_2.png) [@Tim\_R.Mortiss](https://boards.straightdope.com/u/Tim_R.Mortiss)\
**Post date:** [September 7, 2018, 1:02am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/9 "2018-09-07T01:02:35Z")

</div>

> [@ftg](#):
>
> 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 “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.

> <https://stats.stackexchange.com/questions/108002/what-is-a-cumulative-binomial-probability>

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 7, 2018, 2:34am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/10 "2018-09-07T02:34:30Z")

</div>

Incomplete beta function ?

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

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 7, 2018, 4:27am UTC](https://boards.straightdope.com/t/math-question-probability-calculation/820840/11 "2018-09-07T04:27:47Z")

</div>

In addition to the calculator page linked to above, [here](https://keisan.casio.com/exec/system/1244987852) is another calculator page, Wolfram has it implemented as Beta[z, a, b], and [this page](https://dlmf.nist.gov/8.17) has some convergent continued fractions near the bottom. Also, Pearson’s tables are available from the Internet Archive.
