Tutorials › Introduction to Statistics › Computing Exact Binomial Probabilities Under a Null

Tests for Proportions · Tutorial 637 of 996

Computing Exact Binomial Probabilities Under a Null

Use the binomial model under a specified null proportion to calculate probabilities for an exact success count and for cumulative ranges of counts.

Intermediate 9 min read

What You'll Learn

  • State the assumptions needed for a binomial model under a null hypothesis.
  • Calculate the probability of exactly a specified number of successes.
  • Add binomial probabilities to find inclusive cumulative tails.
  • Use the complement rule to simplify some tail calculations.
  • Interpret a probability as a chance for a count under the stated model, not as a probability that the null is true.

From a Null Proportion to a Count Distribution

When an outcome is binary, the data can be summarized by the number of successes. For example, a response may be classified as “yes” or “no,” or a product may be classified as passing or failing. If the null hypothesis specifies a success probability \(p_0\), we can calculate how likely different success counts would be if that null model were true.

This calculation uses the binomial distribution. It gives probabilities for individual counts and for ranges of counts, such as “exactly four successes” or “at least four successes.” Those probabilities describe the behavior of a count under a specified model. By themselves, they do not decide whether a hypothesis should be rejected; that requires a testing rule.

Definition: Let \(X\) be the number of successes in \(n\) trials. Under a binomial model, the trials are independent, each trial has two possible outcomes classified as success or failure, and every trial has the same success probability \(p\). We write \(X\sim\operatorname{Binomial}(n,p)\). Under a point null hypothesis \(H_0:p=p_0\), the null model is \(X\sim\operatorname{Binomial}(n,p_0)\).

The assumptions have direct meanings in an application. The number \(n\) of trials is fixed in advance; the definition of a success is consistent across trials; each trial has probability \(p_0\) of success under the null; and the outcomes are independent. If these assumptions do not describe the process, the binomial probabilities may not be appropriate. The calculations below assume that they do.

Probability of Exactly \(k\) Successes

For an integer \(k\) between 0 and \(n\), the event \(X=k\) means that exactly \(k\) trials are successes and the remaining \(n-k\) are failures. A particular ordering of those outcomes has probability \(p_0^k(1-p_0)^{n-k}\). There are \(\binom{n}{k}\) distinct ways to choose which \(k\) of the \(n\) trials are successes. Since those distinct orderings cannot occur at the same time, their probabilities add.

$$ P(X=k\mid H_0)=\binom{n}{k}p_0^k(1-p_0)^{n-k}, \qquad k=0,1,\ldots,n, $$

Here \(\binom{n}{k}=\frac{n!}{k!(n-k)!}\) counts the possible placements of the \(k\) successes. The notation \(P(X=k\mid H_0)\) emphasizes that the probability is calculated assuming the null model. It is not a probability that \(H_0\) is true. For a count outside the possible range, such as \(k<0\) or \(k>n\), the probability is zero.

Worked Example: Exactly Three Successes

Suppose eight independent trials have success probability \(p_0=0.25\) under a hypothetical null model. Calculate the probability of exactly three successes.

The fixed number of trials is \(n=8\), and the target count is \(k=3\). The number of ways to place three successes among eight trials is \(\binom{8}{3}=56\). The binomial formula gives

$$ \begin{aligned} P(X=3\mid H_0) &=\binom{8}{3}(0.25)^3(1-0.25)^{8-3}\\ &=56(0.25)^3(0.75)^5\\ &=56(0.015625)(0.2373046875)\\ &=0.2076416016. \end{aligned} $$

Thus, under this model, the probability of exactly three successes in eight trials is about \(0.2076\), or \(20.76\%\). This probability is for the single count \(X=3\); it does not include counts such as 2 or 4.

Cumulative Probabilities: Adding Counts

A cumulative probability covers several possible values of \(X\). Because \(X\) is a count, it can take only integer values. For example, the event \(X\geq 4\) consists of \(X=4,5,\ldots,n\), while \(X\leq 1\) consists of \(X=0\) and \(X=1\). To find either probability, add the probabilities of all the included counts.

Key result: For integer bounds \(a\) and \(b\), a binomial cumulative probability is a sum of point probabilities: $$ P(X\geq a\mid H_0)=\sum_{k=a}^{n}\binom{n}{k}p_0^k(1-p_0)^{n-k}, \qquad P(X\leq b\mid H_0)=\sum_{k=0}^{b}\binom{n}{k}p_0^k(1-p_0)^{n-k}. $$ The endpoints are included. If a bound falls outside \(0,\ldots,n\), the event is interpreted using the actual possible values of \(X\).

For example, “at least four” includes four itself. It does not mean “more than four.” Likewise, “at most one” includes one. Writing down the event in words and then translating it into an inequality helps prevent an off-by-one error.

Worked Example: At Least Four Successes

In a hypothetical process, six independent trials each have null success probability \(p_0=0.40\). Find the probability of at least four successes.

The event is \(X\geq 4\), which includes exactly four, five, or six successes. Calculate each point probability and add them:

$$ \begin{aligned} P(X\geq 4\mid H_0) &=P(X=4\mid H_0)+P(X=5\mid H_0)+P(X=6\mid H_0)\\ &=\binom{6}{4}(0.40)^4(0.60)^2 +\binom{6}{5}(0.40)^5(0.60)^1 +\binom{6}{6}(0.40)^6(0.60)^0\\ &=15(0.0256)(0.36)+6(0.01024)(0.60)+1(0.004096)(1)\\ &=0.13824+0.036864+0.004096\\ &=0.1792. \end{aligned} $$

The probability of four or more successes is \(0.1792\), or \(17.92\%\), under the stated null model. This is a cumulative probability, so it includes three different count outcomes rather than only \(X=4\).

Using Complements and Checking a Cumulative Calculation

The complement of \(X\geq a\) is \(X\leq a-1\), provided \(a\) is an integer. Since an event and its complement have probabilities that sum to 1,

$$ P(X\geq a\mid H_0)=1-P(X\leq a-1\mid H_0). $$

Similarly, \(P(X\leq b\mid H_0)=1-P(X\geq b+1\mid H_0)\). A complement can reduce the number of terms that must be calculated. It also provides a useful check: a lower tail and the corresponding upper tail with the next integer boundary must add to 1.

Worked Example: At Most One Success

Suppose ten independent trials have null success probability \(p_0=0.10\). Calculate the probability of at most one success.

The event \(X\leq 1\) contains \(X=0\) and \(X=1\). Directly applying the binomial formula gives

$$ \begin{aligned} P(X\leq 1\mid H_0) &=P(X=0\mid H_0)+P(X=1\mid H_0)\\ &=\binom{10}{0}(0.10)^0(0.90)^{10} +\binom{10}{1}(0.10)^1(0.90)^9\\ &=(0.90)^{10}+10(0.10)(0.90)^9\\ &=0.3486784401+0.3874204890\\ &=0.7360989291. \end{aligned} $$

Thus, the chance of no more than one success is about \(0.7361\), or \(73.61\%\), under this model. As a check, the complementary event is \(X\geq 2\), so its probability is \(1-0.7360989291=0.2639010709\). The two probabilities sum to 1.

A Reliable Calculation Process

For a point probability, the main tasks are identifying the null probability and substituting the correct count into the binomial formula. For a cumulative probability, first identify every count in the event, then sum the corresponding point probabilities. The following sequence makes the event and its boundaries explicit.

1
State the model.
Confirm that there are \(n\) fixed trials, each with success probability \(p_0\) under \(H_0\), and that the trials are independent. Then write \(X\sim\operatorname{Binomial}(n,p_0)\).
2
Translate the event.
Write the requested event precisely, such as \(X=3\), \(X\geq 4\), or \(X\leq 1\). Remember that “at least” and “at most” include their stated endpoints.
3
Calculate and report.
Use the point-probability formula once for \(X=k\), or sum it over all counts in a cumulative event. Consider a complement if it is shorter, and interpret the result as a probability under the specified model.

The binomial formula can also be checked conceptually. Each specific pattern with \(k\) successes has probability \(p_0^k(1-p_0)^{n-k}\) by independence. There are exactly \(\binom{n}{k}\) patterns with that count. Multiplying the probability of one pattern by the number of patterns gives the probability of \(X=k\). Summing across the counts in a cumulative event then adds the probabilities of mutually exclusive outcomes.

Why Exact Count Probabilities Matter

A normal approximation can be convenient, but a binomial calculation uses the discrete model directly. It can therefore be useful when an approximation is questionable or when the probability for a specific count is needed. “Exact” here means exact relative to the stated binomial model: the formula does not replace the binomial distribution with a continuous curve. It does not mean that the model assumptions are guaranteed to describe a real process perfectly.

The probability also depends on the event being asked about. Under the same \(n\) and \(p_0\), \(P(X=4\mid H_0)\) is not the same quantity as \(P(X\geq 4\mid H_0)\). The latter includes every possible count from 4 through \(n\). Accurate calculations begin with a precise event, not merely a formula.

Common Mistakes

  • Using the observed sample proportion as the null probability. Under the null model, substitute the specified \(p_0\). The observed count determines the event of interest, but it does not replace \(p_0\) in the null distribution.
  • Omitting the combination count. The probability of one particular ordering is \(p_0^k(1-p_0)^{n-k}\). There are \(\binom{n}{k}\) orderings with \(k\) successes, so the probability of the count must include that factor.
  • Leaving out the boundary count. “At least four” means \(X=4,5,\ldots,n\), not \(X=5,6,\ldots,n\). “At most one” includes both zero and one.
  • Calling a tail probability the probability that the null is true. A value such as \(P(X\geq 4\mid H_0)\) is a probability of a data event assuming the null model. It is not \(P(H_0\mid X\geq 4)\).
  • Calling a model-based calculation unconditionally exact. The arithmetic is exact for the binomial model, but its relevance depends on the fixed-trial, common-probability, independence assumptions being reasonable.
Key takeaway: Under \(H_0:p=p_0\), model the success count as \(X\sim\operatorname{Binomial}(n,p_0)\). Calculate an exact-count probability with the binomial formula; calculate an inclusive cumulative probability by summing the point probabilities for every count in the event.

Check Your Understanding

For each question, identify the event and explain how the binomial model would be used.

  1. In 12 independent trials with null success probability \(0.30\), what formula gives the probability of exactly five successes?
  2. For \(n=9\), which count outcomes are included in the event \(X\geq 7\)?
  3. Why does the probability of exactly \(k\) successes include the factor \(\binom{n}{k}\)?
  4. If \(n=10\), what event is the complement of \(X\geq 3\)?
  5. In words, distinguish \(P(X=2\mid H_0)\) from \(P(X\leq 2\mid H_0)\).