Operations on Sets

The basic operations

Each operation builds a new set out of two sets AA and BB inside a universal set UU. The examples below all use U={1,2,3,4,5,6,7,8}U = \{1, 2, 3, 4, 5, 6, 7, 8\}, A={1,2,3,4}A = \{1, 2, 3, 4\} and B={3,4,5,6}B = \{3, 4, 5, 6\}.

Set operations with A = {1, 2, 3, 4} and B = {3, 4, 5, 6}
OperationContainsExample
Union A∪BA \cup BElements in AA, in BB, or in both{1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\}
Intersection A∩BA \cap BElements in both AA and BB{3,4}\{3, 4\}
Difference A−BA - BElements in AA but not in BB{1,2}\{1, 2\}
Difference B−AB - AElements in BB but not in AA{5,6}\{5, 6\}
Complement A′A'Elements of UU not in AA{5,6,7,8}\{5, 6, 7, 8\}
Symmetric difference A Δ BA \,\Delta\, BElements in exactly one of the two{1,2,5,6}\{1, 2, 5, 6\}

Union and intersection don't care about order (A∪B=B∪AA \cup B = B \cup A), but difference does: A−BA - B and B−AB - A above share no elements at all.

De Morgan's laws

Taking a complement swaps union and intersection:

(A∪B)′=A′∩B′,(A∩B)′=A′∪B′(A \cup B)' = A' \cap B', \qquad (A \cap B)' = A' \cup B'

Check with the sets above: A∪B={1,…,6}A \cup B = \{1, \dots, 6\}, so (A∪B)′={7,8}(A \cup B)' = \{7, 8\}. Separately, A′={5,6,7,8}A' = \{5, 6, 7, 8\} and B′={1,2,7,8}B' = \{1, 2, 7, 8\}, and their intersection is also {7,8}\{7, 8\}.

Counting two overlapping groups

When two groups AA and BB overlap, simply adding their sizes double-counts whoever is in both. The inclusion-exclusion principle corrects for that:

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

Worked example

In a class of 60 students, 25 play cricket and 20 play tennis, and 10 play both. How many play neither?

Solution: First find how many play at least one sport:

∣cricket∪tennis∣=25+20−10=35|\text{cricket} \cup \text{tennis}| = 25 + 20 - 10 = 35

Out of 60 students total, the rest play neither:

60−35=2560 - 35 = 25

The same numbers also give the "only" counts: 25−10=1525 - 10 = 15 play only cricket and 20−10=1020 - 10 = 10 play only tennis. Check: 15+10+10+25=6015 + 10 + 10 + 25 = 60.

Three overlapping groups

With three sets, subtracting every pairwise overlap removes the middle region (in all three) once too often, so it gets added back at the end:

∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |B \cap C| - |A \cap C| + |A \cap B \cap C|

Worked example: three languages

In a survey of 100 students, 50 study Hindi, 40 study English and 30 study Sanskrit. 20 study Hindi and English, 15 study English and Sanskrit, 10 study Hindi and Sanskrit, and 5 study all three. How many study none of the three?

Solution:

∣H∪E∪S∣=50+40+30−20−15−10+5=80|H \cup E \cup S| = 50 + 40 + 30 - 20 - 15 - 10 + 5 = 80

So 100−80=20100 - 80 = 20 students study none of them.

Common mistakes

  • Treating "both" as "only". "10 play both" means 10 are inside each of the two groups already. Students who play only cricket are 25−1025 - 10, not 25.
  • Forgetting the last term for three sets. Without +∣A∩B∩C∣+|A \cap B \cap C|, the 5 students who study all three languages would be counted zero times.
  • Assuming A−B=B−AA - B = B - A. Difference is not symmetric. Use the symmetric difference A Δ BA \,\Delta\, B when you mean "in one but not the other" either way round.
  • Taking a complement without a universal set. A′A' only makes sense relative to UU. Change UU and the complement changes too.

Where this comes up in exams

Union, intersection, difference and complement of sets are listed in Unit 1 of the JEE Main 2026 mathematics syllabus, in the JEE Advanced 2026 syllabus, and in the CBSE Class XI sets unit for 2025-26.

Checked against JEE (Main) 2026 syllabus (NTA), JEE (Advanced) 2026 syllabus and CBSE Mathematics curriculum, Classes XI-XII (2025-26). Syllabi can change from year to year, so confirm with the latest official notification for your exam.

Continue learning

Sets are the ground floor of relations and functions, which are defined as particular sets of ordered pairs.

From past GATE papers