Practice Discrete Math

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

Next recommended lesson

Continue through this topic with Least You Need to Know: Permutations and Combinations.

Least You Need to Know: Permutations and Combinations

Related lessons

Keep going with nearby lessons in the same topic.

More ways to explore

Start practice