Winjeet Academy Pvt Ltd., Hyderabad +91 9100607603

← All articles

Mathematics

Sets, Relations and Functions

By Winjeet Academy · 20 Nov 2026

1. Sets

A set is a well-defined collection of distinct objects, called its elements. "Well-defined" means we can decide for any object whether it belongs to the set. Sets are written in two forms:

  • Roster form: list the elements, e.g. \(A = \{1, 2, 3, 4\}\).
  • Set-builder form: state the property, e.g. \(A = \{x : x \in \mathbb{N},\ x \le 4\}\).
TypeMeaningExample
Empty (null) setNo elements, written ∅ or { }\(\{x \in \mathbb{R} : x^2 = -1\}\)
SingletonExactly one element{0}
Finite / infiniteCountable number of elements, or not{vowels} / \(\mathbb{N}\)
Equal setsExactly the same elements{1, 2} = {2, 1}
Equivalent setsSame number of elements{a, b} and {1, 2}
Subset\(A \subseteq B\) if every element of A is in B\(\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\)
Power set P(A)Set of all subsets of AP({a, b}) = {∅, {a}, {b}, {a, b}}
Universal set UThe set containing all sets under discussion\(\mathbb{R}\) for real-number problems

If \(n(A) = n\), then A has \(2^n\) subsets, so \(n(P(A)) = 2^n\), and \(2^n - 1\) proper subsets. ∅ is a subset of every set, and every set is a subset of itself.

1.1 Intervals

\[(a, b) = \{x : a \lt x \lt b\}, \quad [a, b] = \{x : a \le x \le b\}, \quad [a, b) = \{x : a \le x \lt b\}\]

2. Operations on sets

Venn diagrams of union, intersection, difference and complement

OperationDefinition
Union\(A \cup B = \{x : x \in A \text{ or } x \in B\}\)
Intersection\(A \cap B = \{x : x \in A \text{ and } x \in B\}\); A, B are disjoint if \(A \cap B = \varnothing\)
Difference\(A - B = \{x : x \in A,\ x \notin B\} = A \cap B'\)
Complement\(A' = U - A = \{x \in U : x \notin A\}\)
Symmetric difference\(A \,\Delta\, B = (A - B) \cup (B - A)\)

2.1 Laws of algebra of sets

  • Commutative: \(A \cup B = B \cup A\), \(A \cap B = B \cap A\).
  • Associative: \((A \cup B) \cup C = A \cup (B \cup C)\), and similarly for ∩.
  • Distributive: \(A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\), \(A \cap (B \cup C) = (A \cap B) \cup (A \cap C)\).
  • Identity and complement: \(A \cup \varnothing = A\), \(A \cap U = A\), \(A \cup A' = U\), \(A \cap A' = \varnothing\), \((A')' = A\).
\[\text{De Morgan's laws:}\quad (A \cup B)' = A' \cap B', \qquad (A \cap B)' = A' \cup B'\]

2.2 Counting with sets

\[n(A \cup B) = n(A) + n(B) - n(A \cap B)\]
\[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)\]
\[n(A - B) = n(A) - n(A \cap B), \qquad n(A') = n(U) - n(A)\]

3. Cartesian product

The Cartesian product of A and B is the set of all ordered pairs with first element from A and second from B:

\[A \times B = \{(a, b) : a \in A,\ b \in B\}, \qquad n(A \times B) = n(A)\,n(B)\]

(a, b) = (c, d) only if a = c and b = d. In general \(A \times B \ne B \times A\). Example: A = {1, 2}, B = {x, y} gives A × B = {(1, x), (1, y), (2, x), (2, y)}.

4. Relations

A relation R from A to B is any subset of A × B. If (a, b) ∈ R we write a R b. The domain is the set of first elements, the range the set of second elements, and B is the codomain.

\[\text{number of relations from A to B} = 2^{\,n(A)\,n(B)}\]

The inverse relation is \(R^{-1} = \{(b, a) : (a, b) \in R\}\).

4.1 Types of relations on a set A

TypeConditionExample on \(\mathbb{Z}\)
EmptyR = ∅{(a, b) : a – b = 1/2}
UniversalR = A × A{(a, b) : a – b is an integer}
Reflexive(a, a) ∈ R for every a ∈ Aa ≤ b
Symmetric(a, b) ∈ R ⇒ (b, a) ∈ Ra + b is even
Antisymmetric(a, b), (b, a) ∈ R ⇒ a = ba ≤ b
Transitive(a, b), (b, c) ∈ R ⇒ (a, c) ∈ Ra < b
EquivalenceReflexive, symmetric and transitivea – b divisible by 5

An equivalence relation splits A into disjoint equivalence classes. For congruence modulo 5 on \(\mathbb{Z}\), there are five classes: remainders 0, 1, 2, 3, 4.

For a set with n elements:

\[\text{reflexive relations} = 2^{\,n^2 - n}, \qquad \text{symmetric relations} = 2^{\,n(n+1)/2}\]

5. Functions

A relation f from A to B is a function (mapping) \(f : A \to B\) if every element of A has exactly one image in B. A is the domain, B the codomain, and \(f(A) = \{f(x) : x \in A\}\) the range, with range ⊆ codomain.

Vertical line test: a graph represents a function of x if no vertical line meets it more than once.

Arrow diagrams of one-one, onto and bijective functions and a relation that is not a function

5.1 Types of functions

TypeConditionHow to test
One-one (injective)\(f(x_1) = f(x_2) \Rightarrow x_1 = x_2\)Horizontal line meets the graph at most once; strictly monotonic functions are one-one
Many-oneTwo or more elements share an imageSome horizontal line meets the graph more than once
Onto (surjective)Range = codomainEvery y in B has a pre-image
IntoRange is a proper subset of the codomainSome y has no pre-image
BijectiveOne-one and ontoOnly bijections have inverses

For finite sets with n(A) = m and n(B) = n:

\[\text{functions } A \to B = n^{m}, \qquad \text{one-one functions} = \begin{cases} {}^{n}P_{m} = \dfrac{n!}{(n-m)!}, & m \le n \\ 0, & m \gt n \end{cases}\]
\[\text{bijections (when } m = n) = n!, \qquad \text{onto functions (} m \ge n) = \sum_{r=0}^{n} (-1)^r \binom{n}{r} (n - r)^{m}\]

5.2 Standard real functions

FunctionDefinitionDomainRange
Identityf(x) = x\(\mathbb{R}\)\(\mathbb{R}\)
Constantf(x) = c\(\mathbb{R}\){c}
Modulus|x| = x for x ≥ 0, –x for x < 0\(\mathbb{R}\)[0, ∞)
Signumsgn x = 1, 0, –1 for x > 0, x = 0, x < 0\(\mathbb{R}\){–1, 0, 1}
Greatest integer[x] = greatest integer ≤ x\(\mathbb{R}\)\(\mathbb{Z}\)
Fractional part{x} = x – [x]\(\mathbb{R}\)[0, 1)
Exponential\(a^x\), a > 0, a ≠ 1\(\mathbb{R}\)(0, ∞)
Logarithmic\(\log_a x\), a > 0, a ≠ 1(0, ∞)\(\mathbb{R}\)
Reciprocal1/x\(\mathbb{R} - \{0\}\)\(\mathbb{R} - \{0\}\)
Square root\(\sqrt{x}\)[0, ∞)[0, ∞)

Graphs of modulus, greatest integer, signum, exponential and logarithmic functions

Examples: [2.7] = 2, [–2.7] = –3, {–2.7} = 0.3. Also \(x - 1 \lt [x] \le x\) and \([x + n] = [x] + n\) for integer n.

5.3 Finding domain and range

  • Denominator ≠ 0; expression under an even root ≥ 0; argument of log > 0.
  • For the range, write x in terms of y and find the y for which x is real and in the domain.

Example: \(f(x) = \sqrt{\dfrac{x - 2}{3 - x}}\). We need \(\dfrac{x - 2}{3 - x} \ge 0\) with x ≠ 3, giving the domain [2, 3).

Example: range of \(f(x) = \dfrac{x}{1 + x^2}\). Setting \(y = \dfrac{x}{1+x^2}\) gives \(yx^2 - x + y = 0\). For real x (y ≠ 0) the discriminant \(1 - 4y^2 \ge 0\), so \(-\tfrac{1}{2} \le y \le \tfrac{1}{2}\); y = 0 occurs at x = 0. Range: \([-\tfrac{1}{2}, \tfrac{1}{2}]\).

5.4 Even and odd functions

\[\text{even: } f(-x) = f(x) \ (\text{symmetric about the y-axis}), \qquad \text{odd: } f(-x) = -f(x) \ (\text{symmetric about the origin})\]

cos x, x2, |x| are even; sin x, x3, sgn x are odd. Every function on a symmetric domain is the sum of an even and an odd part:

\[f(x) = \frac{f(x) + f(-x)}{2} + \frac{f(x) - f(-x)}{2}\]

5.5 Periodic functions

f is periodic if \(f(x + T) = f(x)\) for all x; the smallest positive T is the period. sin x and cos x have period 2π; tan x has period π; {x} has period 1. The period of \(\sin(ax + b)\) is \(2\pi/|a|\); \(|\sin x|\) and \(\sin^2 x\) have period π.

6. Composition and inverse

For \(f : A \to B\) and \(g : B \to C\), the composite is

\[(g \circ f)(x) = g(f(x)), \qquad g \circ f : A \to C\]

Composition is associative but not commutative in general. Example: f(x) = x2, g(x) = x + 1 give \((g \circ f)(x) = x^2 + 1\) but \((f \circ g)(x) = (x + 1)^2\).

If f is a bijection, its inverse \(f^{-1} : B \to A\) satisfies

\[f^{-1}(y) = x \iff f(x) = y, \qquad f^{-1} \circ f = I_A,\quad f \circ f^{-1} = I_B, \qquad (g \circ f)^{-1} = f^{-1} \circ g^{-1}\]

The graph of \(f^{-1}\) is the mirror image of the graph of f in the line y = x (see \(e^x\) and \(\ln x\) above). Example: f(x) = 2x + 3 on \(\mathbb{R}\) gives \(f^{-1}(x) = \dfrac{x - 3}{2}\).

7. Binary operations

A binary operation * on a set A is a function \(A \times A \to A\). Addition and multiplication are binary operations on \(\mathbb{N}\); subtraction is not (3 – 5 ∉ \(\mathbb{N}\)). * is commutative if a * b = b * a and associative if (a * b) * c = a * (b * c). An identity e satisfies a * e = e * a = a. The number of binary operations on a set with n elements is \(n^{n^2}\).

8. Summary and practice questions

8.1 Key points

  1. A set with n elements has \(2^n\) subsets; \(n(A \times B) = n(A)\,n(B)\).
  2. \(n(A \cup B) = n(A) + n(B) - n(A \cap B)\); De Morgan: \((A \cup B)' = A' \cap B'\).
  3. A relation is a subset of A × B; there are \(2^{mn}\) relations from A to B.
  4. Equivalence relation = reflexive + symmetric + transitive; it partitions the set into classes.
  5. A function gives each element of the domain exactly one image. Number of functions = \(n^m\).
  6. One-one: distinct inputs give distinct outputs. Onto: range = codomain. Only bijections are invertible.
  7. Domain rules: no zero denominator, even roots of non-negative quantities, logs of positive quantities.
  8. \((g \circ f)(x) = g(f(x))\); \((g \circ f)^{-1} = f^{-1} \circ g^{-1}\); the graph of \(f^{-1}\) is the reflection of f in y = x.

8.2 Practice questions

Q1. In a class of 60 students, 35 study physics, 30 study chemistry and 12 study both. How many study neither?

  • Answer: n(P ∪ C) = 35 + 30 – 12 = 53, so 60 – 53 = 7 study neither.

Q2. A set has 3 elements. How many subsets and proper subsets does it have, and how many elements does P(P(A)) have?

  • Answer: \(2^3 = 8\) subsets, 7 proper subsets; \(n(P(P(A))) = 2^8 = 256\).

Q3. If n(A) = 3 and n(B) = 4, find the number of relations from A to B.

  • Answer: \(2^{3 \times 4} = 2^{12} = 4096\).

Q4. On \(\mathbb{Z}\), R = {(a, b) : a – b is divisible by 3}. Show that R is an equivalence relation.

  • Answer: reflexive: a – a = 0 is divisible by 3. Symmetric: if 3 | (a – b) then 3 | (b – a). Transitive: if 3 | (a – b) and 3 | (b – c) then 3 | (a – c), since a – c = (a – b) + (b – c).

Q5. R = {(1, 1), (2, 2), (3, 3), (1, 2)} on A = {1, 2, 3}. Is it reflexive, symmetric, transitive?

  • Answer: reflexive (all (a, a) present) and transitive, but not symmetric ((1, 2) ∈ R, (2, 1) ∉ R).

Q6. If n(A) = 3 and n(B) = 5, find the number of functions and one-one functions from A to B.

  • Answer: functions \(5^3 = 125\); one-one \(^5P_3 = 5 \times 4 \times 3 = 60\).

Q7. Find the number of onto functions from a set of 4 elements to a set of 3 elements.

  • Answer: \(3^4 - \binom{3}{1}2^4 + \binom{3}{2}1^4 = 81 - 48 + 3 = 36\).

Q8. Find the domain of \(f(x) = \dfrac{1}{\sqrt{x^2 - 5x + 6}}\).

  • Answer: need \(x^2 - 5x + 6 = (x - 2)(x - 3) \gt 0\), so \(x \lt 2\) or \(x \gt 3\): domain \((-\infty, 2) \cup (3, \infty)\).

Q9. Is \(f : \mathbb{R} \to \mathbb{R}\), \(f(x) = x^2\), one-one or onto?

  • Answer: neither. f(–1) = f(1), so not one-one; negative numbers have no pre-image, so not onto. Restricted to [0, ∞) → [0, ∞) it becomes a bijection with inverse \(\sqrt{x}\).

Q10. If \(f(x) = \dfrac{x}{x - 1}\), x ≠ 1, find \((f \circ f)(x)\).

  • Answer: \(f(f(x)) = \dfrac{\frac{x}{x-1}}{\frac{x}{x-1} - 1} = \dfrac{x}{x - (x - 1)} = x\). So f is its own inverse.

© 2026 Winjeet Academy. These notes are for personal study. Copying, reposting or redistribution without permission is not allowed.

Want guided preparation?

Book a free demo class with our faculty online across India or online.

Admission Enquiry
📞 Call nowBook free demo