Inclusion-Exclusion Principle

The Inclusion-Exclusion Principle (PIE) is a counting technique used to calculate the size of the union of multiple sets when there is overlap between them. For two sets: |A ∪ B| = |A| + |B| - |A ∩ B|. For three sets: |A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |B ∩ C| - |A ∩ C| + |A ∩ B ∩ C|.

10Worksheets
200+Practice Questions
HardDifficulty
3-4 hoursHours to Master

Introduction to Inclusion-Exclusion Principle

The Inclusion-Exclusion Principle (PIE) is a counting technique used to calculate the size of the union of multiple sets when there is overlap between them. For two sets: |A ∪ B| = |A| + |B| - |A ∩ B|. For three sets: |A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |B ∩ C| - |A ∩ C| + |A ∩ B ∩ C|.

Prerequisites

Basic set theory Union and intersection concepts Counting principles Number theory applications (divisibility)
Why This Matters: Inclusion-Exclusion problems appear in 1-2 questions in advanced exams like CAT. They test understanding of set theory and overlap handling.

How to Solve Inclusion-Exclusion Principle Problems

1

Step 1: Identify the sets being counted

2

Step 2: Determine if the problem involves union of sets

3

Step 3: Apply inclusion-exclusion formula for the number of sets involved

4

Step 4: Calculate each term (individual set sizes, intersection sizes)

5

Step 5: Alternate addition and subtraction as per the formula

6

Step 6: For divisibility problems, use floor division to count multiples

7

Step 7: Present the final answer

Pro Strategy: Always identify all sets involved. Start with the sum of individual set sizes, then subtract intersections of pairs, add back intersections of triples, and so on. For divisibility problems, use floor division to count multiples.

Example Problem

Example: How many numbers from 1 to 100 are divisible by 2 or 3? Solution: Step 1: A = numbers divisible by 2, B = numbers divisible by 3 Step 2: |A| = ⌊100/2⌋ = 50, |B| = ⌊100/3⌋ = 33 Step 3: |A ∩ B| = numbers divisible by 6 = ⌊100/6⌋ = 16 Step 4: |A ∪ B| = 50 + 33 - 16 = 67 Answer: 67 numbers

Pro Tips & Tricks

  • For two sets: |A ∪ B| = |A| + |B| - |A ∩ B|
  • For three sets: add singles, subtract pairs, add triple
  • For 'neither A nor B': total - |A ∪ B|
  • For 'exactly one' problems: use inclusion-exclusion carefully
  • In divisibility: |A ∩ B| = numbers divisible by LCM of divisors
  • The principle works for any number of sets

Shortcut Methods to Solve Faster

For two sets: |A ∪ B| = |A| + |B| - |A ∩ B|
For 'not divisible by 2 or 3' = total - |A ∪ B|
LCM of divisors gives the intersection count
For 'divisible by 2 or 3 or 5', use three-set formula

Common Mistakes to Avoid

Forgetting to subtract intersections for two-set problems
Using wrong LCM for intersection calculations
Not alternating signs correctly for three or more sets
Applying inclusion-exclusion when sets are disjoint (not needed)

Exam Importance

Inclusion-Exclusion Principle is an important topic for various competitive exams. Here's how frequently it appears:

SSC CGL
1-2 questions
BANKING PO
1-2 questions
RAILWAYS RRB
1-2 questions
CAT
1-2 questions
INSURANCE
1-2 questions

Ready to Master Inclusion-Exclusion Principle?

Start with Worksheet 1 and work your way up to expert level! Each worksheet includes:

20 practice questions
Detailed solutions
Step-by-step explanations
Start Practicing Now