liveBook · Manning

Complement rule

The complement rule states that the probability of an event’s complement is one minus the probability of the event.

How 3 Manning books explain it

Statistics Every Programmer Needs

The complement rule calculates the probability of an event by subtracting the probability of that event's complement from one.

How it is used
Calculates desired-event probabilities efficiently when their complementary outcomes are easier to enumerate.
How deep it goes
Defines the formula and works through dice examples, stopping short of formal proof or broader distribution theory.
Examples
Uses two dice for at-least-one-four and bounded-sum problems, with short Python calculations for the first example.
What you can do after
Apply the complement rule to shorten probability calculations and implement repeated complement probabilities in Python.

Read how Statistics Every Programmer Needs explains complement rule →

Grokking Machine Learning, Second Edition

The complement rule states that the probability of an event's opposite is one minus the probability of the event.

How it is used
Uses complements to supply missing probabilities while calculating whether an email containing “lottery” is spam.
How deep it goes
Defines the rule and works through unconditional and conditional email probabilities, then applies them within a larger calculation.
Examples
Uses spam and ham emails, the word “lottery,” probability fractions, and a tree of possible outcomes.
What you can do after
Evaluate missing event probabilities by subtracting the known probability from one.

Read how Grokking Machine Learning, Second Edition explains complement rule →

Timeless Algorithms, The Foundational Ideas

The complement rule states that the probability of an event not occurring is one minus the probability of that event occurring.

How it is used
Supports Bayesian inference as one of the probability rules used to quantify and combine uncertainty.
How deep it goes
Defines the rule and works through a dice example, using independence to calculate the complement; it does not develop broader applications.
Examples
Uses two fair six-sided dice to calculate the chance of rolling at least one 4.
What you can do after
Evaluate/understand how calculating an event's complement can simplify a probability calculation.

Read how Timeless Algorithms, The Foundational Ideas explains complement rule →

What to know first

Related concepts

Questions about complement rule

What is complement rule?

The complement rule states that the probability of an event’s complement is one minus the probability of the event.

Which Manning books explain complement rule?

Statistics Every Programmer Needs, Grokking Machine Learning, Second Edition and Timeless Algorithms, The Foundational Ideas.

What should I know before learning complement rule?

Manning books that teach complement rule usually introduce addition rule, mutually exclusive event and probability theory first.

What is complement rule a kind of?

Complement rule is a kind of probability rule. A probability rule is a mathematical rule for calculating or relating probabilities of events.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.