Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Using the Complement Rule to Find “At Least One” Probabilities

Hello! Last time, you calculated the probability of both events using a conditional probability, and saw when independence lets you multiply their individual probabilities. Today, you will use a different shortcut: calculate the chance that an event does not happen, then subtract from one. This is especially useful for questions such as “What is the chance of at least one success in several attempts?”

By the end, you will be able to identify the right opposite event, calculate its probability, and check whether an independence assumption is needed for the calculation—not for the complement rule itself.


An event and everything outside it

Suppose is the event that a selected observation has a True flag. Its complement, written , is the event that the flag is not True. Every eligible observation belongs to exactly one of and . Their probabilities therefore add to one:

The short video segment below illustrates this partition using the outcomes of a die roll.

Probability of Complementary Events & Sample Space

Watch “Probability of Complementary Events & Sample Space” from The Organic Chemistry Tutor for a visual explanation of why an event and its complement exhaust the possible outcomes.

Watch the remaining outcomes as the presenter identifies the complement in a six-sided die's sample space. Continue with the complement rule, focusing on why the two probabilities sum to one.

In pandas, the same idea appears as two shares that exhaust a fully observed Boolean column:

import pandas as pd

flags = pd.Series([
    True, True, False, False, True, False,
    False, True, True, True, False, False
])

print(flags.mean())       # 6 / 12: flag is True
print((~flags).mean())    # 6 / 12: flag is False
print(1 - flags.mean())   # 6 / 12: complement of True

This calculation assumes each entry can be classified as True or False. If a real column contains missing values, decide which observations are eligible before taking either share; otherwise, the two calculations may not use the same denominator.

The complement rule requires no independence assumption. It relies only on specifying the event and its opposite over the same set of possible outcomes.


“At least one” has a particularly simple opposite

Imagine three independent rolls of a fair die. Let a “success” mean rolling a four. “At least one four” includes exactly one four, exactly two fours, and three fours. Its opposite is much shorter to describe: no fours at all.

OpenStax uses this die example to introduce the technique. Read the indicated subsection, then we will put its reasoning into a formula.

3.4 Probability Theory - Principles of Data Science | OpenStax

Read the “Probability of At Least One” subsection of OpenStax’s “3.4 Probability Theory” to see how an outcome described as “one or more” becomes a calculation about zero.

In “Probability of At Least One,” start with the opening paragraph about at least one occurrence. Read through the die example, stopping before “Example 3.20.” Focus on naming the opposite event before calculating it.

Let mean success on attempt . At least one success means that one or more of occurs. Its complement means that every attempt fails. Hence

That identity is always true. To calculate , we need to know how the attempts relate to one another. If the attempts are independent and each has success probability , each has failure probability , and the multiplication rule from the last lesson gives

Under those assumptions, the useful shortcut is

For the three die rolls, . Rolls are modeled as independent, so

The event “at least one four” is the complement of zero fours, not the complement of “exactly one four.” The latter would include both zero fours and two or more fours.

You can connect this shortcut to the addition rule from earlier in the module. With two independent attempts, each succeeding with probability , adding their success probabilities gives —but counts “both succeed” twice. Subtract that overlap to get

The complement calculation gives the same result with less bookkeeping:

As the number of attempts grows, describing “all fail” remains simple while listing the possible success patterns becomes cumbersome.


Check the model before raising a probability to a power

The complement step remains valid when attempts are dependent. What may fail is the shortcut for no successes.

For a concrete case, suppose five attempts always have the same outcome: with probability , all five succeed; otherwise, all five fail. Each individual attempt still has success probability . But the chance of at least one success is , not . After seeing the first outcome, you know the rest, so multiplying five unconditional failure probabilities would be unjustified.

Compare that with five independent attempts, each with success probability . Their chance of no successes really is , leaving for at least one. The individual success rate is identical in both models; the relationship among attempts changes the answer.

More generally, when independence does not hold, you can still calculate “no successes” using the conditional multiplication rule. For two attempts, for example,

The complement rule then subtracts that joint failure probability from one.


Check the calculation with a Python simulation

A simulation makes the distinction between a model probability and an observed frequency visible. The following code simulates 100,000 sets of five independent attempts. Each row is one five-attempt experiment; each column is an attempt.

import numpy as np

rng = np.random.default_rng(42)
experiments = 100_000
attempts = 5
p = 0.2

success = rng.random((experiments, attempts)) < p

at_least_one = success.any(axis=1)
none = ~success.any(axis=1)

print("Simulated at least one:", at_least_one.mean())
print("Simulated none:", none.mean())
print("Theoretical at least one:", 1 - (1 - p) ** attempts)
print("Theoretical none:", (1 - p) ** attempts)
print("Simulated shares sum to:", at_least_one.mean() + none.mean())

success.any(axis=1) asks whether any attempt in each experiment succeeded. Its opposite, none, identifies rows in which every attempt failed. The simulated shares sum to exactly one because every row belongs to one of those two events. Each simulated share should be close to its theoretical probability, though it will generally not match it exactly.

Notice what this simulation does not establish: it does not prove that five real-world observations would be independent, or that their success probability is . Those are inputs to the model being simulated. Choosing a suitable model comes before trusting the numerical answer.


Key takeaways

A complement is everything in the relevant sample space outside the event of interest, so . For “at least one success,” the opposite is no successes. If attempts are independent and each succeeds with probability , this gives .

Always separate those two steps: taking a complement needs no independence assumption; multiplying failure probabilities does. In the next lesson, you will examine the assumptions behind modeling a fixed number of repeated yes/no attempts—a foundation for the binomial distribution.

Can't find a good explanation? Sign up and we'll make it for you

Sign up