Leave lesson

Statistics · Statistical distributions

1 / 10

Cumulative binomial probabilities

Finding P(X ≤ r), P(X < r), P(X ≥ r), P(X > r) and P(a ≤ X ≤ b) for a binomial distribution by building everything from the cumulative function P(X ≤ r) (binomcdf), with care over the off-by-one when an inequality is strict or "at least". Includes the complement for "≥" and "two-stage" problems where the success of one binomial becomes the trial of another.

Statistics · Statistical distributions

Cumulative binomial probabilities

Finding P(X ≤ r), P(X < r), P(X ≥ r), P(X > r) and P(a ≤ X ≤ b) for a binomial distribution by building everything from the cumulative function P(X ≤ r) (binomcdf), with care over the off-by-one when an inequality is strict or "at least". Includes the complement for "≥" and "two-stage" problems where the success of one binomial becomes the trial of another.

Why it works

Adding single probabilities one at a time is slow, so for ranges we use the cumulative probability

P(Xr)=P(X=0)+P(X=1)++P(X=r),P(X \le r) = P(X=0) + P(X=1) + \dots + P(X=r),

which a calculator gives directly as binomcdf(n,p,r)\text{binomcdf}(n, p, r). Every other range can be rebuilt from P(Xr)P(X \le r) — the whole skill is translating the inequality correctly:

You wantCompute it asP(Xr)binomcdf(n,p,r)P(X<r)P(Xr1)P(Xr)1P(Xr1)P(X>r)1P(Xr)P(aXb)P(Xb)P(Xa1)\begin{array}{l|l} \text{You want} & \text{Compute it as} \\ \hline P(X \le r) & \text{binomcdf}(n, p, r) \\ P(X < r) & P(X \le r-1) \\ P(X \ge r) & 1 - P(X \le r-1) \\ P(X > r) & 1 - P(X \le r) \\ P(a \le X \le b) & P(X \le b) - P(X \le a-1) \end{array}

The off-by-one is where marks are lost. Because XX is a whole number:
  • P(X<r)P(X < r) excludes rr, so it is P(Xr1)P(X \le r-1);
  • P(Xr)P(X \ge r) is the complement of P(Xr1)P(X \le r-1), not of P(Xr)P(X \le r) — for
"at least 55", the opposite is "at most 44", so P(X5)=1P(X4)P(X \ge 5) = 1 - P(X \le 4).

Get the cut-off right by asking "what is the largest value the opposite event can take?" — that is the number you put inside binomcdf\text{binomcdf}.

Two-stage ("binomial of a binomial"). Sometimes the result of one binomial experiment becomes a single success/failure that you then repeat. For example, first find p=P(a box has fewer than 3 prizes)p^{*} = P(\text{a box has fewer than 3 prizes}) from one binomial; then the number of boxes (out of several) with that property is itself binomial with success probability pp^{*}. Work out the inner probability first, then treat it as the pp of a new binomial.