STEP-BY-STEP LEARNING

Learn Sets, Relations & Functions · Mathematics

Learn Sets, Relations & Functions in Mathematics step by step with concepts, examples, quick checks and revision for government exams.

—Due now
—Next revision
—Mastered
—Study streak
Text size
Complete Topic Lesson

Sets, Relations & Functions: Complete Guide for Competitive Exams

Master sets, relations, and functions with clear concepts, formulas, and exam-ready shortcuts. Learn to solve Venn diagram problems, Cartesian product intersections, and function evaluations quickly and accurately.

On this page
  1. Set Basics and Notation
  2. Venn Diagrams: The Two-Set Formula
  3. Cartesian Product and Its Intersection
  4. Relations: Definition and Types
  5. Functions: Basics and Evaluation
  6. Counting Subsets and Power Sets
  7. Three-Set Venn Diagram Problems
  8. Shortcuts and Reverse Problems
  9. Edge Cases and Common Traps
  10. Exam Strategy and Time Management
  11. Worked examples
  12. Common mistakes
  13. Frequently asked questions

Sets, relations, and functions form the foundation of modern mathematics and appear frequently in quantitative aptitude sections of competitive exams. This lesson builds your understanding from basic definitions to advanced problem-solving techniques, with a focus on speed and accuracy. You will learn to derive formulas, apply shortcuts, avoid common traps, and handle reverse problems confidently.

Key Formulas for Sets, Relations & Functions
Union of Two Setsn(A ∪ B) = n(A) + n(B) − n(A ∩ B)
Neither in Two Setsn(neither) = Total − n(A ∪ B)
Cartesian Product Intersectionn[(A × B) ∩ (B × A)] = [n(A ∩ B)]²
Number of Relations2^{n(A) × n(B)}
Number of Subsets2^{n(A)}
ConceptFormulaWhen to Use
Unionn(A ∪ B) = n(A) + n(B) − n(A ∩ B)When asked for 'either/or' or total in at least one.
Intersectionn(A ∩ B) = n(A) + n(B) − n(A ∪ B)When asked for 'both' or overlap.
NeitherTotal − n(A ∪ B)When asked for 'neither' or 'none'.
Cartesian Intersection[n(A ∩ B)]²When asked for (A×B) ∩ (B×A).
Function EvaluationSubstitute and simplifyWhen given f(x) and asked for f(a).
1Read the problem and identify the type (Venn, Cartesian, function, relation).
2Write down the given values: total, n(A), n(B), n(A ∩ B), etc.
3Choose the appropriate formula from the formula box.
4Substitute the values and solve step by step.
5Check if the answer makes sense (e.g., neither cannot be negative).
6If time permits, verify using an alternative method or Venn diagram.

Set Basics and Notation

A set is a well-defined collection of distinct objects. We write sets using curly braces, e.g., A = {1, 2, 3}. The number of elements in a set is its cardinality, denoted n(A). Key operations include union (A ∪ B), intersection (A ∩ B), difference (A − B), and complement (A'). The universal set U contains all elements under consideration. Understanding these operations is crucial because most exam problems combine them. For example, (A ∪ B)' means elements in U but not in A or B. Always check whether the universal set is given; without it, complement is undefined.

  • Union: elements in A or B or both.
  • Intersection: elements common to both A and B.
  • Difference: elements in A but not in B.
  • Complement: elements in U but not in A.
  • Cardinality: n(A) = number of elements in A.
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

Venn Diagrams: The Two-Set Formula

For two sets A and B, the number of elements in their union is n(A ∪ B) = n(A) + n(B) − n(A ∩ B). This formula works because adding n(A) and n(B) counts the intersection twice, so we subtract it once. In a class of N students, if some like cricket (C) and some like football (F), then the number who like neither is N − n(C ∪ F). This is the most common exam scenario. Always identify the total, the two groups, and the overlap. Then apply the formula directly. For three sets, the formula extends: n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(B ∩ C) − n(C ∩ A) + n(A ∩ B ∩ C).

  • Total = n(A only) + n(B only) + n(A ∩ B) + n(neither).
  • n(A only) = n(A) − n(A ∩ B).
  • n(B only) = n(B) − n(A ∩ B).
  • n(neither) = Total − n(A ∪ B).
n(neither) = N − [n(A) + n(B) − n(A ∩ B)]

Cartesian Product and Its Intersection

The Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B. If n(A) = p and n(B) = q, then n(A × B) = p × q. The intersection (A × B) ∩ (B × A) consists of ordered pairs that are in both products. For (a, b) to be in both, we need a ∈ A, b ∈ B and also a ∈ B, b ∈ A. So a and b must belong to A ∩ B. Thus, the number of elements in (A × B) ∩ (B × A) is [n(A ∩ B)]². This is a powerful shortcut. For example, if A = {1,2,3} and B = {2,3,4}, then A ∩ B = {2,3}, so the answer is 2² = 4.

  • A × B = {(a,b) | a ∈ A, b ∈ B}.
  • n(A × B) = n(A) × n(B).
  • (A × B) ∩ (B × A) = (A ∩ B) × (A ∩ B).
  • Number of elements = [n(A ∩ B)]².
n[(A × B) ∩ (B × A)] = [n(A ∩ B)]²

Relations: Definition and Types

A relation R from set A to set B is a subset of A × B. If (a, b) ∈ R, we say a is related to b. A relation on a set A is a subset of A × A. Important types include reflexive (aRa for all a), symmetric (aRb implies bRa), transitive (aRb and bRc imply aRc), and equivalence (reflexive, symmetric, transitive). The number of relations from A to B is 2^{n(A) × n(B)}. The number of reflexive relations on A is 2^{n(A)² − n(A)}. These formulas are derived by counting the number of possible subsets of the Cartesian product. Understanding relations helps in functions, which are special relations.

  • Relation R ⊆ A × B.
  • Total relations from A to B: 2^{pq}, where p = n(A), q = n(B).
  • Reflexive relations on A: 2^{n² − n}.
  • Symmetric relations on A: 2^{n(n+1)/2}.
  • Equivalence relation: reflexive, symmetric, transitive.
Number of relations from A to B = 2^{n(A) × n(B)}

Functions: Basics and Evaluation

A function f: A → B assigns exactly one element of B to each element of A. The set A is the domain, B is the codomain, and the set of actual outputs is the range. For a polynomial like f(x) = 2x² − 3x + 1, evaluating f(2) means substituting x = 2: f(2) = 2(4) − 3(2) + 1 = 8 − 6 + 1 = 3. Always follow order of operations: exponents first, then multiplication, then addition/subtraction. For composite functions, apply the inner function first. For inverse functions, swap x and y and solve. Domain restrictions arise from square roots (radicand ≥ 0), denominators (≠ 0), and logarithms (argument > 0).

  • f(x) notation: input x, output f(x).
  • Domain: all valid inputs.
  • Range: all possible outputs.
  • Composite: (f ∘ g)(x) = f(g(x)).
  • Inverse: f⁻¹(y) = x if f(x) = y.
f(x) = 2x² − 3x + 1 ⇒ f(2) = 3

Counting Subsets and Power Sets

The power set P(A) is the set of all subsets of A, including the empty set and A itself. If n(A) = n, then the number of subsets is 2^n. The number of proper subsets is 2^n − 1. The number of non-empty subsets is 2^n − 1. The number of subsets with exactly k elements is C(n, k). These counting principles are frequently tested. For example, if A has 3 elements, it has 2³ = 8 subsets. This concept extends to relations: a relation is a subset of A × B, so there are 2^{n(A)n(B)} possible relations.

  • Total subsets: 2^n.
  • Proper subsets: 2^n − 1.
  • Non-empty subsets: 2^n − 1.
  • Subsets of size k: C(n, k).
  • Power set cardinality: |P(A)| = 2^n.
|P(A)| = 2^{n(A)}

Three-Set Venn Diagram Problems

For three sets A, B, C, the inclusion-exclusion principle gives n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(B ∩ C) − n(C ∩ A) + n(A ∩ B ∩ C). In a survey of 100 people, if 60 like tea, 50 like coffee, 30 like both, and we need those who like neither, we use the two-set formula: n(T ∪ C) = 60 + 50 − 30 = 80, so neither = 100 − 80 = 20. For three sets, draw a Venn diagram with three overlapping circles. Fill in the innermost intersection first, then work outward. This systematic approach prevents errors.

  • Start with the triple intersection.
  • Subtract to find pairwise-only regions.
  • Sum all regions to get union.
  • Neither = Total − Union.
  • Always verify that all regions sum correctly.
n(A ∪ B ∪ C) = Σn(A) − Σn(pairwise) + n(A ∩ B ∩ C)

Shortcuts and Reverse Problems

Many exam problems give the total, the two group sizes, and the number who like neither, and ask for the overlap. Rearrange the formula: n(A ∩ B) = n(A) + n(B) − (Total − Neither). For example, in a class of 60, 40 like cricket, 30 like football, and 10 like neither. Then n(C ∪ F) = 60 − 10 = 50. So n(C ∩ F) = 40 + 30 − 50 = 20. This reverse approach saves time. Another shortcut: for Cartesian product intersection, use [n(A ∩ B)]² directly. For functions, substitute carefully and simplify. Always check if the answer makes sense in context.

  • Reverse formula: n(A ∩ B) = n(A) + n(B) − Total + Neither.
  • For (A×B) ∩ (B×A): answer = [n(A ∩ B)]².
  • For f(x) evaluation: substitute and simplify.
  • For complements: (A ∪ B)' = A' ∩ B' (De Morgan).
  • For subsets: 2^n.
n(A ∩ B) = n(A) + n(B) + n(neither) − Total

Edge Cases and Common Traps

Watch for these traps: (1) Confusing union with intersection. (2) Forgetting to subtract the overlap. (3) Assuming sets are disjoint when they are not. (4) Misreading 'neither' as 'both'. (5) In Cartesian products, forgetting that order matters. (6) In functions, ignoring domain restrictions. (7) In complements, using the wrong universal set. (8) In three-set problems, double-counting or missing regions. Always read the question carefully, identify what is given and what is asked, and draw a diagram if needed. Check if the numbers add up logically.

  • Union: 'or'; Intersection: 'and'.
  • Neither = Total − Union.
  • Both = Intersection.
  • Ordered pairs: (a,b) ≠ (b,a) unless a = b.
  • Domain: exclude values that make denominator zero or radicand negative.
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

Exam Strategy and Time Management

In competitive exams, set theory and functions questions are often quick wins. Allocate about 1–1.5 minutes per question. For Venn diagram problems, immediately write the formula and substitute. For Cartesian product intersection, use the square shortcut. For function evaluation, substitute directly. If a problem seems complex, try plugging in the answer choices or using a Venn diagram. Avoid getting stuck; mark and move on. Practice mental math for squares and simple arithmetic. Remember that accuracy matters more than speed, but with practice, you can achieve both.

  • Read the question twice to avoid misreading.
  • Identify the type: Venn, Cartesian, function, or relation.
  • Apply the appropriate formula immediately.
  • Use shortcuts like [n(A ∩ B)]².
  • Verify your answer with a quick sanity check.
Time per question: 1–1.5 minutes

Worked examples

If A = {1,2,3}, B = {2,3,4}, find the number of elements in (A × B) ∩ (B × A).
Show solution

First, find A ∩ B = {2,3}. Then, the number of elements in (A × B) ∩ (B × A) is [n(A ∩ B)]² = 2² = 4.

4
In a class of 80 students, 50 passed in Mathematics, 40 passed in Science, and 30 passed in both. How many failed in both subjects?
Show solution

n(M ∪ S) = 50 + 40 − 30 = 60. Failed in both = Total − n(M ∪ S) = 80 − 60 = 20.

20
In a class of 50 students, 30 play cricket, 25 play football, and 10 play both. How many play neither?
Show solution

n(C ∪ F) = 30 + 25 − 10 = 45. Neither = 50 − 45 = 5.

5
In a group of 100 people, 60 like tea, 50 like coffee, and 30 like both. How many like neither tea nor coffee?
Show solution

n(T ∪ C) = 60 + 50 − 30 = 80. Neither = 100 − 80 = 20.

20
If f(x) = 2x² − 3x + 1, what is the value of f(2)?
Show solution

Substitute x = 2: f(2) = 2(2²) − 3(2) + 1 = 2(4) − 6 + 1 = 8 − 6 + 1 = 3.

3
If U = {1,2,3,...,10}, A = {1,3,5,7,9}, and B = {2,3,5,7}, what is (A ∪ B)'?
Show solution

A ∪ B = {1,2,3,5,7,9}. Complement = U − (A ∪ B) = {4,6,8,10}.

{4,6,8,10}
In a class of 60 students, 40 like cricket, 30 like football, and 10 like neither. How many like both?
Show solution

n(C ∪ F) = 60 − 10 = 50. n(C ∩ F) = 40 + 30 − 50 = 20.

20
In a class of 40 students, 25 play cricket and 20 play football, and 10 play both. How many play neither game?
Show solution

n(C ∪ F) = 25 + 20 − 10 = 35. Neither = 40 − 35 = 5.

5

Common mistakes

  • Adding n(A) and n(B) without subtracting the intersection.
  • Confusing 'neither' with 'both'.
  • Forgetting that (A × B) ∩ (B × A) uses the square of the intersection size.
  • Misapplying De Morgan's laws: (A ∪ B)' = A' ∩ B', not A' ∪ B'.
  • Ignoring domain restrictions in functions, leading to invalid inputs.
  • In three-set problems, double-counting the triple intersection.
  • Assuming sets are disjoint when they overlap.
  • Using the wrong universal set for complement problems.

Frequently asked questions

What is the difference between union and intersection?

Union (A ∪ B) includes all elements that are in A or B or both. Intersection (A ∩ B) includes only elements that are in both A and B. In Venn diagrams, union is the entire shaded area of both circles, while intersection is the overlapping region.

How do I find the number of students who like neither tea nor coffee?

Use the formula: Neither = Total − n(T ∪ C), where n(T ∪ C) = n(T) + n(C) − n(T ∩ C). Substitute the given values and compute. For example, if Total = 100, n(T) = 60, n(C) = 50, n(T ∩ C) = 30, then n(T ∪ C) = 80, so Neither = 20.

What is the formula for the number of elements in (A × B) ∩ (B × A)?

The number of elements is [n(A ∩ B)]². This is because an ordered pair (a,b) must have a and b both in A ∩ B to be in both Cartesian products. So if A ∩ B has k elements, there are k² such ordered pairs.

How do I evaluate a function like f(x) = 2x² − 3x + 1 at x = 2?

Substitute x = 2 into the expression: f(2) = 2(2²) − 3(2) + 1 = 2(4) − 6 + 1 = 8 − 6 + 1 = 3. Always follow the order of operations: exponents first, then multiplication, then addition/subtraction.

What is the complement of a set?

The complement of a set A, denoted A', is the set of all elements in the universal set U that are not in A. It is defined only when U is specified. For example, if U = {1,2,3,4,5} and A = {1,3,5}, then A' = {2,4}.

How many subsets does a set with n elements have?

A set with n elements has 2^n subsets, including the empty set and the set itself. The number of proper subsets is 2^n − 1. This is because each element can either be included or excluded, giving 2 choices per element.

What is the inclusion-exclusion principle for three sets?

For three sets A, B, C, n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(B ∩ C) − n(C ∩ A) + n(A ∩ B ∩ C). This formula corrects for double-counting and adds back the triple intersection.

How can I quickly solve reverse problems where the overlap is unknown?

Use the rearranged formula: n(A ∩ B) = n(A) + n(B) + n(neither) − Total. This directly gives the intersection when you know the total, the two group sizes, and the number who like neither. Always double-check by plugging back into the union formula.

Practice this lesson ↓

Loading…