Set Theory for Placement Aptitude: Formulas and Worked Problems
Master set theory for placement aptitude: notation, union, intersection, complement, power sets, and the inclusion-exclusion formula with 8 worked examples.
Set theory problems appear in the quantitative aptitude sections of TCS NQT, AMCAT, and Infosys placement tests, testing your ability to count overlapping groups using unions, intersections, and the inclusion-exclusion formula.
The core idea is simple: a set is a collection of distinct, unordered elements, and a handful of operations on sets (plus one formula) handle the bulk of aptitude questions. This article covers notation, all five standard operations, and eight fully worked problems from the types that appear in actual placement rounds.
The same placement test section that includes set problems typically also covers calendar and date problems and coding-and-decoding questions, both of which reward understanding the underlying rule over pattern-guessing.
What Is a Set?
A set is a well-defined, unordered collection of distinct objects. “Well-defined” means there’s no ambiguity about membership. “Distinct” means no duplicates: {1, 1, 2} is just {1, 2}.
The Wikipedia article on Set (mathematics) traces the formal theory back to Georg Cantor’s work in the 1870s. For placement aptitude, the applied subset of that theory is what matters.
Notation
Two styles of set notation appear in aptitude questions:
- Roster notation lists elements explicitly:
{1, 2, 3}or{a, e, i, o, u}. - Set-builder notation describes a rule:
{x | x is an even integer between 1 and 10}means{2, 4, 6, 8, 10}.
Membership and Special Sets
- If element a belongs to set A, write a ∈ A.
- If element b does not belong, write b ∉ A.
- The empty set ∅ (also written
{}) has no elements. - The universal set U contains all elements under consideration for a given problem.
Sets are labelled with capital letters (A, B, C) and elements with lowercase (a, b, x). Order and repetition do not matter: {2, 4, 6}, {6, 4, 2}, and {4, 2, 6} are the same set.
Set Relationships: Subsets, Power Sets, and Cardinality
Subsets and Proper Subsets
Set A is a subset of B (written A ⊆ B) if every element of A is also in B. A ⊆ A is always true.
Set A is a proper subset of B (written A ⊂ B) if A ⊆ B and A ≠ B. So {1, 2} ⊂ {1, 2, 3}, but {1, 2, 3} is not a proper subset of itself.
Power Set
The power set P(A) is the set of all subsets of A, including ∅ and A itself.
If |A| = n elements, then |P(A)| = 2^n.
For A = {a, b, c}: the subsets are ∅, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, and {a,b,c}, giving exactly 2^3 = 8 subsets. This count mirrors the binomial coefficients in Pascal’s Triangle: 1 + 3 + 3 + 1 = 8.
Cardinality
The cardinality |A| is the count of elements in a set. If A = {10, 20, 30, 40}, then |A| = 4.
Set Operations
Five operations cover all placement-test scenarios.
| Operation | Symbol | Meaning | Example (A = {1,2,3}, B = {3,4,5}) |
|---|---|---|---|
| Union | A ∪ B | All elements in A or B (or both) | {1,2,3,4,5} |
| Intersection | A ∩ B | Only elements in both A and B | {3} |
| Difference | A − B | Elements in A but not in B | {1,2} |
| Complement | A’ | Elements in U but not in A | Depends on U |
| Symmetric Difference | A △ B | Elements in A or B but not both | {1,2,4,5} |
In set-builder form:
- Union: A ∪ B =
{x | x ∈ A or x ∈ B} - Intersection: A ∩ B =
{x | x ∈ A and x ∈ B} - Difference: A − B =
{x | x ∈ A and x ∉ B} - Complement: A’ =
{x | x ∈ U and x ∉ A} - Symmetric difference: A △ B = (A − B) ∪ (B − A)
The symmetric difference contains elements belonging to exactly one of the two sets.
Cartesian Product
A × B (read “A cross B”) is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.
If A = {1, 2} and B = {x, y}, then A × B = {(1,x), (1,y), (2,x), (2,y)}.
The size rule: |A × B| = |A| × |B|. So |A × B| = 2 × 2 = 4 in this example.
Unlike union or intersection, order matters in a Cartesian product: (1, x) and (x, 1) are different pairs.
Venn Diagrams for Aptitude Problems
A Venn diagram represents sets as overlapping circles inside a rectangle (the universal set U).
For two sets A and B:
- Left region (A only): elements in A but not B.
- Overlapping centre region: elements in A ∩ B.
- Right region (B only): elements in B but not A.
- Rectangle outside both circles: elements in neither A nor B.
When a problem states “35 like Maths, 30 like Science, 15 like both, class of 60,” the diagram fills as:
- Left (Maths only): 35 − 15 = 20
- Centre (both): 15
- Right (Science only): 30 − 15 = 15
- Outside (neither): 60 − (20 + 15 + 15) = 10
For three sets, add a third overlapping circle. Fill the centre region (all three overlap) first, then pairwise overlaps, then individual regions, then “none” last.
The Inclusion-Exclusion Principle
Two Sets
- |A ∪ B| = |A| + |B| - |A ∩ B|
The subtraction corrects for double-counting: elements in A ∩ B were counted once in |A| and once in |B|.
Neither (Complement of Union)
- |neither| = |U| - |A ∪ B|
Three Sets
- |A ∪ B ∪ C| = |A| + |B| + |C| - |A∩B| - |B∩C| - |A∩C| + |A∩B∩C|
Subtracting all three pairwise intersections over-subtracts each pair by one; adding back the triple intersection restores the correct count.
Derived Formulas
- |A - B| = |A| - |A ∩ B|
- |A’| = |U| - |A|
- If A and B are disjoint (no overlap): |A ∪ B| = |A| + |B|
Worked Aptitude Problems
Practice sets for these problem types are available at IndiaBix Venn Diagrams. The eight problems below cover every operation and question type found in typical placement rounds.
P1: Basic Inclusion-Exclusion (Two Sets)
- Problem: In a class of 60 students, 35 like Maths and 30 like Science. If 15 like both, how many like neither?
- Step 1: |M ∪ S| = 35 + 30 - 15 = 50
- Step 2: Neither = 60 - 50 = 10
- Answer: 10 students like neither subject.
P2: Finding the Intersection from the Union
- Problem: In a batch of 80 students, 50 like Cricket and 45 like Football. 25 like neither sport. How many like both?
- Step 1: Like at least one = 80 - 25 = 55
- Step 2: |C ∩ F| = 50 + 45 - 55 = 40
- Answer: 40 students like both sports.
P3: Subset Count and Proper Subsets
- Problem: How many subsets does
{p, q, r, s}have? How many are proper subsets? - Step 1: Total subsets = 2^4 = 16
- Step 2: Proper subsets exclude the set itself: 16 - 1 = 15
- Answer: 16 subsets total; 15 proper subsets.
P4: Cartesian Product
- Problem: A =
{1, 2}, B ={3}. List A × B and state its size. - Step 1: A × B =
{(1,3), (2,3)} - Step 2: |A × B| = 2 × 1 = 2
- Answer: A × B =
{(1,3), (2,3)}, size 2.
P5: Symmetric Difference
- Problem: A =
{1, 2, 3, 4}, B ={3, 4, 5, 6}. Find A △ B. - Step 1: A - B =
{1, 2}(in A but not B) - Step 2: B - A =
{5, 6}(in B but not A) - Step 3: A △ B = (A - B) ∪ (B - A) =
{1, 2, 5, 6} - Answer: A △ B =
{1, 2, 5, 6}.
P6: Complement
- Problem: U =
{1,2,3,4,5,6,7,8}, A ={2,4,6,8}. Find A’. - Step 1: A’ contains elements of U not in A.
- Answer: A’ =
{1, 3, 5, 7}.
P7: Three-Set Inclusion-Exclusion
- Problem: 100 students; 45 study Physics, 38 study Chemistry, 27 study Biology. Pairwise overlaps: Physics ∩ Chemistry = 15, Chemistry ∩ Biology = 10, Physics ∩ Biology = 12. All three = 5. How many study at least one subject?
- Step 1: |P ∪ C ∪ B| = 45 + 38 + 27 - 15 - 10 - 12 + 5
- Step 2: Sum = 110; pairwise sum = 37; 110 - 37 + 5 = 78
- Answer: 78 students study at least one subject.
P8: Set Difference and Cardinality
- Problem: A =
{1,2,3,4,5}, B ={4,5,6,7}. Find |A - B|. - Step 1: A - B = elements in A not in B =
{1, 2, 3} - Step 2: |A - B| = 3
- Verification using formula: |A - B| = |A| - |A ∩ B| = 5 - 2 = 3 ✓
- Answer: |A - B| = 3.
Set Theory in Code and AI Pipelines
The inclusion-exclusion formula you just applied across eight problems isn’t only a placement aptitude tool. Python’s built-in set type implements every operation covered here: union(), intersection(), difference(), and symmetric_difference() are all single-line calls. The same membership-counting logic appears in AI feature pipelines whenever document corpora or knowledge bases are merged, de-duplicated, or compared.
If you want to go from placement aptitude to building with language models, TinkerLLM (₹299) is a practical starting point. The set-based filtering logic you applied in P1 to P8 shows up repeatedly in retrieval and ranking code once you get there.
Primary sources
Frequently asked questions
What is a set in mathematics?
A set is an unordered collection of distinct objects called elements. Two sets are equal if they contain exactly the same elements regardless of order, so `{1, 2, 3}` and `{3, 1, 2}` are the same set.
What is the difference between a subset and a proper subset?
Every element of a subset also belongs to the parent set. A proper subset is a subset that is not equal to the parent set. If A = `{1, 2}` and B = `{1, 2, 3}`, then A is a proper subset of B, written A ⊂ B.
How do I solve 'how many like neither?' problems in placement tests?
Use inclusion-exclusion: find |A ∪ B| = |A| + |B| - |A ∩ B|, then subtract from the total. In a class of 60 where 35 like A, 30 like B, and 15 like both, |A ∪ B| = 50 and neither = 10.
What is a power set and how do I count its elements?
The power set of S is the collection of all subsets of S, including the empty set and S itself. If S has n elements, the power set has 2^n elements. A 3-element set produces a power set of 8 elements.
What is the Cartesian product of two sets?
A x B is the set of all ordered pairs (a, b) where a belongs to A and b belongs to B. If A = `{1, 2}` and B = `{x, y}`, then A x B = `{(1,x), (1,y), (2,x), (2,y)}` and its size is |A| x |B| = 4.
How does the three-set inclusion-exclusion formula work?
For three sets A, B, C: |A ∪ B ∪ C| = |A| + |B| + |C| - |A∩B| - |B∩C| - |A∩C| + |A∩B∩C|. You subtract each pairwise intersection once because it was counted twice, then add back the triple intersection once because it was subtracted three times.
A self-paced playground for building with LLMs.
TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.
Try TinkerLLM (₹299 launch)