The complement rule finds the probability of an event by calculating the probability that it does not occur and subtracting that value from 1. For event A, the complement is written Aᶜ, so P(Aᶜ) = 1 − P(A), or equivalently P(A) = 1 − P(Aᶜ). Use it when the inverse event is easier to count or compute. section 3.2.1
Apply the rule in a short sequence:
- Define the desired event and its complement. section 3.2.1
- Calculate the complement, using the multiplication rule when repeated independent outcomes are involved. section 3.2.1
- Subtract the complement probability from 1 and interpret the result as the probability of the desired event. section 3.2.3
Getting at least one 4
For two dice rolls, directly counting the cases containing at least one 4 requires three scenarios: a 4 first, a 4 second, or two 4s. The complement is simpler: neither die shows 4. Each die then has probability 5/6 of avoiding 4, so P(neither 4) = (5/6)² = 25/36. Therefore, P(at least one 4) = 1 − 25/36 = 11/36, about 31%. Python expresses the calculation as probability_not_4 = 5/6 and probability_not_4_both = pow(probability_not_4, 2). section 3.2.1
A bounded dice sum
Two dice produce a sum from 2 through 12. To find the probability of a sum between 2 and 11 inclusive, exclude the sole complementary outcome: a sum of 12, which requires double sixes and has probability 1/36. The desired probability is 1 − 1/36 = 35/36, approximately 97%. section 3.2.3
