Discrete Math Tutor

Counting / Inclusion Exclusion

Least You Need to Know: Inclusion-Exclusion

When two counted groups overlap, add the group sizes and then subtract the overlap once.

The least you need to know

Key notation

A ∪ B in A or B or both
A ∩ B in both A and B
|S| size of set S

Tiny worked example

  • Suppose 12 students take Python, 9 take Java, and 5 take both.\n- Adding 12 + 9 counts the 5 students in both classes twice.\n- So |Python ∪ Java| = 12 + 9 - 5 = 16.

Common mistakes

How to recognize this kind of problem

Start practice