A relation between two sets A and B is any subset of the Cartesian product A × B. If an ordered pair (x, y) belongs to that subset, we say x is related to y. In symbols, a relation R from A to B is R ⊆ A × B and (x, y) ∈ R means "x is related to y by R".
Example. Let A = {Kuala Lumpur, Jakarta, Canberra, Washington DC} and B = {Malaysia, Indonesia, Australia, USA}. Define the relation
R = {(x, y) : x is the capital city of the country y, x ∈ A, y ∈ B}.
Then
Relations are often represented in different ways: as a set of ordered pairs, as an arrow diagram, as a matrix, or by a rule.

Let R be a relation from A to B (that is R ⊆ A × B).
For the example above, Domain = {Kuala Lumpur, Jakarta, Canberra, Washington DC}, Range = {Malaysia, Indonesia, Australia, USA}, Codomain = B = {Malaysia, Indonesia, Australia, USA}.
Empty relation: A relation R is called the empty relation (written R = ∅) on A × B if R has no elements.
Universal relation: A relation R on A × B is called the universal relation if R = A × B, that is every possible ordered pair (a, b) with a ∈ A and b ∈ B belongs to R.
Examples:
Certain properties of relations are central in mathematics. Three important properties are:
If a relation is reflexive, symmetric and transitive, it is called an equivalence relation.
Let R be a relation on A = {1, 2, 3} given by
R = {(1,1), (2,2), (3,3), (1,2), (2,3), (1,3)}.
Solution:
Check reflexive:
(1,1), (2,2) and (3,3) are all in R, so R is reflexive on A.
Check symmetric:
(1,2) ∈ R but (2,1) ∉ R, so R is not symmetric.
Check transitive:
(1,2) ∈ R and (2,3) ∈ R and (1,3) ∈ R, so transitivity holds for these elements; checking all required cases shows R is transitive.
Try yourself: Which of the following relations is reflexive, symmetric, and transitive?
A function (also called a mapping) from a set X to a set Y is a relation f ⊆ X × Y with the property that every element of X is related to exactly one element of Y. We write f : X → Y and write y = f(x) when (x, y) ∈ f.
Key points for a function f : X → Y:
Consider the sets A = {1, 2, 3, 4, 5} and B = {2, 4, 6, 8, 1} with a mapping shown in the diagram below.
To decide whether the diagram represents a function, check whether each element of A has exactly one arrow pointing to some element of B. If any element of A is not mapped, or is mapped to more than one element of B, the relation is not a function.
Note: For a function defined as f : A → B, the domain is A (every element of A must be assigned an image). The range (image) is the subset of B that actually contains values f(x) for x ∈ A.

Each element of the domain in this diagram is paired with one and only one element of the range. Even though two domain elements (5 and 10 here) may share the same image (2), the rule of exactly one image per domain element is satisfied. Therefore the relation shown is a function.

In this diagram, each domain element also points to a single range element. Several domain values can share a common range value; this relation is also a function.

If any single element of the domain is paired with more than one element of the range (one domain element with multiple arrows to different range elements), the relation is not a function.

If any element of the domain has no arrow (no image), the correspondence is not even a relation defined as a function from that domain. Hence it is neither a relation (as a function from the whole domain) nor a function.

Functions may be classified according to how elements of the domain and codomain correspond.
One-one (injective): A function f : X → Y is one-one if different inputs give different outputs. Formally, f is injective if f(x1) = f(x2) implies x1 = x2 for all x1, x2 ∈ X. Equivalently, no two distinct elements of X have the same image in Y.
Many-one: If two or more distinct elements of X map to the same element of Y, the function is many-one (not injective). Many-one functions are acceptable as functions, they are just not injective.
Check each element of the domain manually. If every element of X has a unique image (no repeats among images for distinct inputs), the function is one-one. This method is practical when X is small and presented as a table or diagram.
Ques 1: Check if the following is a one-one function?
| Element | Image |
|---|---|
| a1 | b1 |
| a2 | b2 |
| a3 | b3 |
| a4 | b4 |
Since each domain element has a distinct image, the mapping shown is a one-one function.
Ques 2:
| Element | Image |
|---|---|
| 1 | 2 |
| 2 | 6 |
| 3 | 6 |
| 4 | 6 |
| 5 | 1 |
Elements 2, 3 and 4 share the same image 6. Thus the mapping is not one-one; it is a many-one function.
When domains are infinite (for example ℕ, ℤ, or ℝ) or functions are given by a formula, use algebraic reasoning:
Set f(x1) = f(x2) and simplify. If you can deduce x1 = x2 for all x1, x2 in the domain, then f is injective. If you obtain x1 ≠ x2 for some solutions, it is not injective.
Try yourself: Which of the following functions is a one-one function?
Onto (surjective): A function f : X → Y is onto if every element of Y is the image of at least one element of X. That is, for every y ∈ Y there exists x ∈ X such that f(x) = y. The range of f equals the codomain Y.
Examine whether every element of the codomain Y has at least one pre-image in X. If all elements of Y are "hit" by f, the function is onto.
Ques 1: Check whether the following is an onto function?
Solution: Every element of the codomain B shown in the diagram has a pre-image in A, so the mapping is onto.
Ques 2:

Solution: Since the element b in the codomain has no pre-image in the diagram, the mapping is not onto.
When f : X → Y is given by a formula and X, Y are infinite sets like ℕ, ℤ or ℝ:
A function is called many-one if two or more distinct elements of the domain map to the same element of the codomain. This is simply the negation of one-one; many-one functions are valid functions provided each domain element still has exactly one image.

A function f : X → Y is bijective if it is both one-one (injective) and onto (surjective). A bijection establishes a perfect pairing between elements of X and Y; thus X and Y have the same cardinality.
Ques 1: Check whether the following is a bijective function?

Solution: Every element of the domain has a unique image and every element of the codomain has a pre-image; therefore the mapping shown is both injective and surjective. Hence it is bijective.
Ques 2: Find if the following is a bijective function?

Solution: The mapping is injective because every element of the domain maps to a distinct image in the codomain, but it is not surjective because the element s in the codomain has no pre-image from the domain. Therefore the function is not bijective.
| 1. What is a relation? | ![]() |
| 2. What is an empty relation? | ![]() |
| 3. What is a universal relation? | ![]() |
| 4. What is a reflexive relation? | ![]() |
| 5. What is a transitive relation? | ![]() |