Relations and Functions
Cartesian Product and Relations
An ordered pair $(a, b)$ is two objects written in a fixed order — a first component $a$ and a second component $b$. Unlike a set, order is essential: $(a, b) = (c, d)$ only if $a = c$ and $b = d$. So $(2, 3) \ne (3, 2)$, whereas $\{2,3\} = \{3,2\}$.
The Cartesian product $A \times B$ is the set of all ordered pairs whose first component comes from $A$ and second from $B$:
Think of it as every possible pairing — one element of $A$ matched with one element of $B$, exhaustively. Because each of the $n(A)$ first components can be paired with each of the $n(B)$ second components, the size multiplies:
Key properties:
| Property | Statement |
|---|---|
| Not commutative | $A \times B \ne B \times A$ in general (unless $A = B$ or one is empty) |
| Empty factor | If $A = \varnothing$ or $B = \varnothing$, then $A \times B = \varnothing$ |
| Distributes over $\cup,\cap$ | $A \times (B \cup C) = (A \times B) \cup (A \times C)$ |
| Plane and space | $\mathbb{R} \times \mathbb{R} = \mathbb{R}^2$ (the plane); $\mathbb{R}^3$ is the ordered triples $(x,y,z)$ |
The familiar $xy$-plane is exactly $\mathbb{R} \times \mathbb{R}$: every point is an ordered pair of real numbers. This is why the chapter matters — coordinate geometry, graphs of functions and the whole of calculus live inside a Cartesian product.
Deeper Insight — why "ordered" changes everything: The single word ordered is what separates this chapter from the previous one on sets. A set answers only "is this object in or out?"; an ordered pair additionally records "in which role?" — first or second, input or output, $x$ or $y$. That extra bit of structure is precisely what lets a Cartesian product model relationships between two collections rather than just a lump of objects. Once you grasp that $A \times B$ lists every conceivable pairing, the next two ideas fall out naturally: a relation is just a chosen subset of those pairings (the ones that actually satisfy some rule), and a function is a relation disciplined by one extra condition. Everything downstream — domain, range, graphs, even the coordinate plane you have used since Class 9 — is built on this one move from unordered membership to ordered pairing.
- Pair each element of $A$ with every element of $B$.
- $A \times B = \{(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)\}$.
- $n(A \times B) = 2 \times 3 = 6$.
Answer: $6$ ordered pairs as listed above.
- Equal ordered pairs ⇒ components equal: $x + 1 = 3$ and $y - 2 = 1$.
- $x = 2$, $y = 3$.
Answer: $x = 2,\ y = 3$.
- $n(A \times B) = n(A) \cdot n(B) = 3 \times 4 = 12$.
- $n(A \times A) = 3 \times 3 = 9$.
Answer: $12$ and $9$ respectively.
- First components form $A$: $\{p, m\}$.
- Second components form $B$: $\{q, r\}$.
- Check: $2 \times 2 = 4$ pairs ✓.
Answer: $A = \{p, m\}$, $B = \{q, r\}$.
- $A \times A = \{(1,1),(1,2),(2,1),(2,2)\}$.
- $(1,2)$ appears in the list — yes.
- $3 \notin A$, so $(1,3)$ cannot be in $A \times A$ — no.
Answer: $(1,2) \in A \times A$; $(1,3) \notin A \times A$.
- $n(A \times A \times A) = 2^3 = 8$.
- The triples are all $(\pm1, \pm1, \pm1)$: $(-1,-1,-1),(-1,-1,1),(-1,1,-1),(-1,1,1),(1,-1,-1),(1,-1,1),(1,1,-1),(1,1,1)$.
Answer: $8$ ordered triples (the eight $(\pm1,\pm1,\pm1)$ combinations).
- An ordered pair $(a,b)$ fixes order: $(a,b) = (c,d) \iff a = c$ and $b = d$.
- $A \times B = \{(a,b) : a \in A,\ b \in B\}$ — every possible pairing.
- $n(A \times B) = n(A) \cdot n(B)$; the product is empty if either factor is empty.
- $A \times B \ne B \times A$ in general; the $xy$-plane is $\mathbb{R} \times \mathbb{R}$.
Functions, Domain and Range
A relation $R$ from set $A$ to set $B$ is any subset of $A \times B$. So a relation simply selects the ordered pairs that satisfy some rule, leaving the rest out:
For each relation we name three sets:
| Term | Meaning |
|---|---|
| Domain | set of all first components in $R$ — the inputs actually used |
| Range | set of all second components in $R$ — the outputs actually produced |
| Codomain | the whole target set $B$ — every output that could appear |
The range is always a subset of the codomain ($\text{range} \subseteq B$), but they need not be equal — the codomain is the "menu", the range is "what was ordered".
Counting relations: a relation is a subset of $A \times B$, which has $n(A)\cdot n(B)$ pairs. Since a set with $k$ elements has $2^k$ subsets, the number of possible relations from $A$ to $B$ is
Relations are often given by a rule, e.g. $R = \{(x, y) : y = x + 1,\ x \in A\}$, which you then list in roster form by testing each input.
Deeper Insight — a relation is a filter, and that is the bridge to functions: The whole content of this idea is "subset of the Cartesian product". $A \times B$ offers every possible pairing; a relation keeps only the pairings that obey a chosen condition — it is a filter on pairings. Reading the definition this way makes the domain/range distinction obvious: the domain is which inputs survived the filter, the range is which outputs they map to. It also explains the codomain, the subtlest of the three: we declare a target set $B$ in advance (the codomain) before we know which of its members will actually be hit (the range). This advance declaration is exactly what makes the next section possible — a function is nothing more than a relation with one extra rule imposed on the filter ("each input is used once, and exactly once"), so understanding a relation as a constrained subset is the conceptual key to the rest of the chapter.
- $x=1 \Rightarrow y=4$; $x=2 \Rightarrow y=5$; $x=3 \Rightarrow y=6$.
- $R = \{(1,4),(2,5),(3,6)\}$.
- Domain $= \{1,2,3\}$; Range $= \{4,5,6\}$.
Answer: $R = \{(1,4),(2,5),(3,6)\}$; domain $\{1,2,3\}$, range $\{4,5,6\}$ (codomain is $\{4,5,6,7\}$).
- $n(A \times B) = 3 \times 2 = 6$.
- Number of relations $= 2^{6} = 64$.
Answer: $64$ relations.
- Keep only pairs where both $x$ and $2x$ lie in $A$.
- $x=1 \to 2$; $x=2 \to 4$; $x=3 \to 6$. For $x=4,5,6$, $2x$ exceeds $6$.
Answer: $R = \{(1,2),(2,4),(3,6)\}$.
- Primes below $10$: $2, 3, 5, 7$.
- $R = \{(2,4),(3,9),(5,25),(7,49)\}$.
Answer: Domain $= \{2,3,5,7\}$; Range $= \{4,9,25,49\}$.
- Every pair has its first component in $A$ and second in $B$, so $R \subseteq A \times B$ — valid.
- Domain $= \{1,2\}$ (first components).
- Range $= \{3,5\}$ (second components).
Answer: Yes, valid; domain $\{1,2\}$, range $\{3,5\}$. (Note $1$ relates to two values — fine for a relation.)
- Natural-number pairs summing to $5$: $(1,4),(2,3),(3,2),(4,1)$.
- ($a=5$ would need $b=0 \notin \mathbb{N}$.)
Answer: $R = \{(1,4),(2,3),(3,2),(4,1)\}$; range $= \{1,2,3,4\}$.
- A relation $R$ from $A$ to $B$ is any subset of $A \times B$.
- Domain = first components used; range = second components produced; codomain = the whole target $B$.
- Always $\text{range} \subseteq \text{codomain}$, but they may differ.
- Number of relations from $A$ to $B$ is $2^{n(A)\cdot n(B)}$.
Types and Special Functions
A function $f$ from $A$ to $B$ is a relation in which every element of $A$ is paired with exactly one element of $B$. Two demands, both essential: every input is used (no element of $A$ left out), and each input gives one output (never two). We write $f : A \to B$ and $y = f(x)$.
The vertical line test captures this graphically: a curve is a function exactly when no vertical line meets it more than once (one $x$, one $y$).
Standard real functions you must recognise by formula and graph:
| Function | Rule | Domain | Range |
|---|---|---|---|
| Identity | $f(x) = x$ | $\mathbb{R}$ | $\mathbb{R}$ |
| Constant | $f(x) = c$ | $\mathbb{R}$ | $\{c\}$ |
| Modulus | $f(x) = |x|$ | $\mathbb{R}$ | $[0, \infty)$ |
| Signum | $f(x) = \dfrac{|x|}{x}\,(x\ne0)$ | $\mathbb{R}$ | $\{-1, 0, 1\}$ |
| Greatest integer | $f(x) = [x]$ | $\mathbb{R}$ | $\mathbb{Z}$ |
| Reciprocal | $f(x) = \dfrac{1}{x}$ | $\mathbb{R}\setminus\{0\}$ | $\mathbb{R}\setminus\{0\}$ |
Algebra of real functions: for functions with overlapping domains you may add, subtract, multiply and divide them pointwise: $(f \pm g)(x) = f(x) \pm g(x)$, $(fg)(x) = f(x)g(x)$, and $\left(\tfrac{f}{g}\right)(x) = \tfrac{f(x)}{g(x)}$ wherever $g(x) \ne 0$.
Finding the domain of a real function means listing every $x$ for which the rule gives a real value — exclude inputs that cause division by zero or an even root of a negative number. The range is the resulting set of outputs.
Deeper Insight — "exactly one output" is the entire idea, and it is what makes calculus possible: A function is a relation that has been disciplined by a single rule: one input, one output. That rule looks modest but it is the reason functions, not arbitrary relations, became the central object of mathematics — because a unique output per input is exactly what lets us speak of "the value of $f$ at $x$", differentiate it, integrate it, and invert it. The vertical line test is just this rule drawn on a graph. The standard functions in the table are worth memorising not as trivia but as a vocabulary: nearly every function you meet later is built by combining, transforming or composing these few, so knowing their shapes (the V of $|x|$, the steps of $[x]$, the three-level jump of the signum) lets you predict the behaviour of complicated expressions at a glance. Master "unique image" and the standard graphs, and the leap to Limits and Derivatives in Chapter 12 becomes a short step rather than a cliff.
- Check each input has a unique output.
- Input $1$ maps to both $2$ and $4$ — two images.
Answer: No — it is a relation but not a function, since $1$ does not have a unique image.
- The denominator must be non-zero: $x^2 - 4 \ne 0$.
- $x^2 \ne 4 \Rightarrow x \ne \pm 2$.
Answer: Domain $= \mathbb{R} \setminus \{-2, 2\}$.
- The radicand must be $\ge 0$: $x - 3 \ge 0 \Rightarrow x \ge 3$.
- The square root yields values $\ge 0$.
Answer: Domain $= [3, \infty)$; Range $= [0, \infty)$.
- $[x]$ is the greatest integer $\le x$.
- $[2.7] = 2$.
- $[-2.7] = -3$ (since $-3 \le -2.7 < -2$).
- $[5] = 5$.
Answer: $[2.7] = 2$, $[-2.7] = -3$, $[5] = 5$.
- $(f+g)(x) = f(x) + g(x) = x^2 + 2x + 1$.
- $(fg)(2) = f(2) \cdot g(2) = (2^2)(2\cdot2+1) = 4 \times 5 = 20$.
Answer: $(f+g)(x) = x^2 + 2x + 1$; $(fg)(2) = 20$.
- $|x-2| \ge 0$ for all $x$, with minimum $0$ at $x = 2$.
- So $f(x) = |x-2| + 1 \ge 0 + 1 = 1$, and it grows without bound.
Answer: Range $= [1, \infty)$.
- A function $f:A\to B$ assigns to every $x\in A$ exactly one image $f(x)\in B$.
- Vertical line test: a graph is a function if no vertical line cuts it more than once.
- Know the standard functions and graphs: identity, constant, $|x|$, signum, $[x]$, $1/x$.
- Domain excludes division by zero and even roots of negatives; functions add/subtract/multiply/divide pointwise.