NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

Venn Diagrams and Inclusion-Exclusion Principle | NIMCET

Learn how to use Venn diagrams and the inclusion-exclusion principle to count elements in two and three sets, with exactly-one and at-least-one formulas and NIMCET word problems.

5 min read

SP

SHIVAM PRADHAN

Updated 25 October 2026

On this page

Quick answer: For two sets, n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B). For three sets, n(A∪B∪C)=∑n(A)−∑n(A∩B)+n(A∩B∩C)n(A \cup B \cup C) = \sum n(A) - \sum n(A \cap B) + n(A \cap B \cap C). This is the inclusion-exclusion principle: add the single sets, subtract the overlaps counted twice, then add back the triple overlap. A Venn diagram filled from the centre outward makes these problems quick and reliable.

This uses the operations in set operations and laws of sets.

Two-set formulas

QuantityFormula
n(A∪B)n(A \cup B)n(A)+n(B)−n(A∩B)n(A) + n(B) - n(A \cap B)
Only A, n(A−B)n(A - B)n(A)−n(A∩B)n(A) - n(A \cap B)
Exactly one of A, Bn(A)+n(B)−2n(A∩B)n(A) + n(B) - 2n(A \cap B)
Neither, n((A∪B)′)n((A \cup B)')n(U)−n(A∪B)n(U) - n(A \cup B)

If A and B are disjoint, n(A∪B)=n(A)+n(B)n(A \cup B) = n(A) + n(B).

Three-set formula

n(A∪B∪C)=n(A)+n(B)+n(C)−n(A∩B)−n(B∩C)−n(C∩A)+n(A∩B∩C)n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(B \cap C) - n(C \cap A) + n(A \cap B \cap C)

Let S1=n(A)+n(B)+n(C)S_1 = n(A) + n(B) + n(C), S2S_2 = sum of the three pairwise intersections, and S3=n(A∩B∩C)S_3 = n(A \cap B \cap C).

QuantityFormula
At least oneS1−S2+S3S_1 - S_2 + S_3
Exactly oneS1−2S2+3S3S_1 - 2S_2 + 3S_3
Exactly twoS2−3S3S_2 - 3S_3
Exactly threeS3S_3
At least twoS2−2S3S_2 - 2S_3

How to fill a three-set Venn diagram

Step 1: Write n(A∩B∩C)n(A \cap B \cap C) in the centre.

Step 2: For each pair, write (pair intersection − centre) in the region of exactly those two sets.

Step 3: For each set, write (set total − its three inner regions) in the "only" region.

Step 4: Add all seven regions for the union, and subtract from n(U)n(U) for "none".

Worked examples

Example 1: two languages

In a class of 50, 30 study French, 25 study German and 10 study both. How many study neither?

Step 1: n(F∪G)=30+25−10=45n(F \cup G) = 30 + 25 - 10 = 45.

Step 2: Neither =50−45=5= 50 - 45 = 5.

Example 2: three newspapers

In a survey of 100 people: 50 read A, 40 read B, 30 read C, 20 read A and B, 15 read B and C, 10 read A and C, and 5 read all three.

At least one:

120−45+5=80120 - 45 + 5 = 80

None: 100−80=20100 - 80 = 20.

Exactly one: S1−2S2+3S3=120−90+15=45S_1 - 2S_2 + 3S_3 = 120 - 90 + 15 = 45.

Exactly two: S2−3S3=45−15=30S_2 - 3S_3 = 45 - 15 = 30.

Check: exactly one + exactly two + exactly three =45+30+5=80= 45 + 30 + 5 = 80 ✓.

Example 3: region-by-region

Using Example 2, the "only A" region is 50−(20−5)−(10−5)−5=2550 - (20 - 5) - (10 - 5) - 5 = 25.

Example 4: the largest and smallest possible overlap

If n(U)=100n(U) = 100, n(A)=70n(A) = 70 and n(B)=60n(B) = 60, what are the possible values of n(A∩B)n(A \cap B)?

  • Maximum: min⁡(70,60)=60\min(70, 60) = 60, when B ⊆ A.
  • Minimum: 70+60−100=3070 + 60 - 100 = 30, when A∪B=UA \cup B = U.

So 30≤n(A∩B)≤6030 \le n(A \cap B) \le 60.

Summary table

Problem asks forUse
Union of two setsn(A)+n(B)−n(A∩B)n(A) + n(B) - n(A \cap B)
Union of three setsS1−S2+S3S_1 - S_2 + S_3
Exactly one of threeS1−2S2+3S3S_1 - 2S_2 + 3S_3
Exactly two of threeS2−3S3S_2 - 3S_3
Bounds on overlapmax⁡(0,n(A)+n(B)−n(U))≤n(A∩B)≤min⁡(n(A),n(B))\max(0, n(A) + n(B) - n(U)) \le n(A \cap B) \le \min(n(A), n(B))

Exam tips

  • Always fill a Venn diagram from the centre outward.
  • Read wording carefully: "both A and B" may include those who also do C.
  • Check that the seven regions plus "none" add up to the total.
  • The same principle is used for counting with divisibility, for example numbers divisible by 2, 3 or 5.

The same counting idea appears in probability; see NIMCET probability and statistics and the NIMCET Set Theory chapter.

Common mistakes

  • Subtracting the triple intersection instead of adding it back.
  • Treating a pairwise intersection as "exactly two"; it includes the centre.
  • Forgetting the "none" region outside all circles.
  • Using n(A)+n(B)n(A) + n(B) for a union without checking whether the sets overlap.

Frequently Asked Questions

What is the inclusion-exclusion principle?

It is the counting rule n(A ∪ B) = n(A) + n(B) − n(A ∩ B), and its extension to more sets, which corrects for elements counted more than once.

What is the formula for n(A ∪ B ∪ C)?

n(A) + n(B) + n(C) − n(A ∩ B) − n(B ∩ C) − n(C ∩ A) + n(A ∩ B ∩ C).

How do you find the number in exactly one of three sets?

Use S₁ − 2S₂ + 3S₃, where S₁ is the sum of the set sizes, S₂ the sum of pairwise intersections and S₃ the triple intersection.

How do you find the number of elements in neither set?

Subtract the union from the total: n(U) − n(A ∪ B).

What is the minimum possible value of n(A ∩ B)?

It is n(A) + n(B) − n(U), or 0 if that value is negative.

Concept Check

MEDIUM

Find the derivative of y=xxy = x^x for x>0x > 0.

Suggested for you