Welcome to Sharpening Probability Basics! In the first lesson of this course, we explored how to calculate single-event probability by comparing favorable outcomes to the total number of equally likely outcomes. Now, in the second lesson of four, we turn our attention to a powerful shortcut known as the complement rule.
Here, we will learn how to find the probability that an event does not happen, using the simple formula P(not A)=1−P(A). We will also discover why this approach can save a great deal of counting work in certain situations.
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Before we look at any formulas, let's build some intuition. In everyday life, we often think about what won't happen just as naturally as what will. If a weather app says there is a 30% chance of rain, we immediately sense that there is a 70% chance it stays dry. If a basketball player makes 9 out of 10 free throws, we know they miss about 1 out of 10.
This idea of flipping an event to its opposite is at the heart of the complement rule. In probability, the complement of an event A is the event that A does not occur. We write it as not A (sometimes shown as A′ or Aˉ in textbooks). If A is "it rains tomorrow," then not A is "it does not rain tomorrow."
One important detail: every outcome in the sample space belongs to either A or not A, with no overlap and nothing left out. There is no middle ground — an outcome either satisfies the event or it doesn't.
Because A and not A together cover every possible outcome, their probabilities must add up to 1:
P(A)+P(not A)=1
A quick rearrangement gives us the complement rule:
P(not A)=1−P(A)
That's the entire formula. If we know the probability of an event happening, we subtract it from 1 to get the probability of it not happening. It works in every direction, too — if someone gives you P(not A), you can find P(A)=1−P(not A) just as easily.
Let's put this to work with a familiar scenario. Suppose we roll a standard six-sided die and define event A as "rolling a 5." There is 1 favorable outcome out of 6 equally likely outcomes, so:
P(A)=61
The complement, not A, is "rolling anything other than a 5." Using the complement rule:
P(not A)=1−61=65
We could also count directly: the outcomes 1, 2, 3, 4, and 6 are all favorable for not A, giving 65. Both methods agree, which is a nice confirmation that the rule works.
Now consider a standard 52-card deck. Suppose we want to know the probability that a randomly drawn card is not a heart. There are 13 hearts in the deck, so:
P(heart)=5213=41
Applying the complement rule:
P(not a heart)=1−41=43
We could count the 39 non-heart cards instead, arriving at 5239=43. Either way we get the same answer, but notice how the complement route required almost no counting at all — we only needed to know the 13 hearts.
As you practice, keep these pitfalls in mind:
Forgetting that probabilities must be between 0 and 1. If your answer for P(not A) comes out negative or greater than 1, double-check your value of P(A).
Confusing the complement with a different event. The complement of "rolling an even number" is "rolling an odd number," not "rolling a 1." Every outcome not in A belongs to not A — no more, no less.
Using the complement rule when you already have both counts. The rule is a shortcut. If you already know the favorable and total outcome counts for the event itself, feel free to compute the probability directly. Choose whichever path involves less work.
Let's recap what we covered. The complement of an event A is everything that is notA, and every outcome falls into exactly one of the two groups. Because P(A) and P(not A) always sum to 1, we can find either one from the other using P(not A)=1−P(A). This rule is especially handy when the event itself has many outcomes that are hard to count, but its opposite is simple.
Up next, you will put the complement rule into action through a series of hands-on practice tasks — from identifying complement events, to applying the formula in weather and business contexts, to solving a scenario where the complement approach truly outshines direct counting. Let's jump in and make these ideas stick!