Skip to content
5 MIN LESSON · MATHEMATICS

Relations and Functions: Cartesian Products, Domain and Range

Ordered pairs and Cartesian products, relations as subsets, functions as special relations, domain, codomain and range, standard real functions and their graphs, and algebra of functions.

Ordered pairs and Cartesian products

An ordered pair (a, b) has a first element a and a second element b. Order matters: (2, 3) ≠ (3, 2). Two ordered pairs are equal only if their corresponding elements are equal: (x + 1, 4) = (5, y − 2) means x = 4 and y = 6.

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

A × B = {(a, b) : a ∈ A, b ∈ B}

Example. A = {1, 2}, B = {x, y, z}. A × B = {(1, x), (1, y), (1, z), (2, x), (2, y), (2, z)}.

  • If A has p elements and B has q, then A × B has pq elements.

  • A × B ≠ B × A in general.

  • If A or B is empty, A × B is empty.

  • ℝ × ℝ is the set of all points in the plane, the familiar xy-plane.

Relations

A relation R from A to B is any subset of A × B. If (a, b) ∈ R, we say a is related to b and write a R b.

  • The set of first elements is the domain of R.

  • The set of second elements is the range of R.

  • The whole set B is the codomain.

Example. A = {1, 2, 3, 4} and R = {(a, b) : b = a + 1, a, b ∈ A}. Then R = {(1, 2), (2, 3), (3, 4)}, domain {1, 2, 3} and range {2, 3, 4}.

Since A × B has 2^(pq) subsets, there are 2^(pq) possible relations from A to B.

Functions

A function f from A to B, written f : A → B, is a relation in which every element of A has exactly one image in B.

Two conditions must hold:

  1. every element of A appears as a first element, and

  2. no element of A appears with two different second elements.

Example. For A = {1, 2, 3}:

  • {(1, 4), (2, 5), (3, 4)} is a function. Two elements having the same image is allowed.

  • {(1, 4), (1, 5), (2, 6), (3, 7)} is not: 1 has two images.

  • {(1, 4), (2, 5)} is not a function on A: 3 has no image.

Vertical line test: a graph in the plane is the graph of a function of x if and only if no vertical line meets it more than once. A circle fails the test.

For f : A → B, A is the domain, B the codomain, and the set of actual images {f(x) : x ∈ A} is the range. The range is a subset of the codomain.

Finding the domain and range of real functions

A real function has a domain and range that are subsets of ℝ. When only a formula is given, the domain is the set of all real x for which the formula makes sense.

Example. f(x) = 1/(x − 3). Division by zero is not allowed, so the domain is ℝ − {3}.

Example. f(x) = √(x − 2). The square root needs x − 2 ≥ 0, so the domain is [2, ∞) and the range is [0, ∞).

Example. f(x) = x² + 1. The domain is ℝ; since x² ≥ 0, the range is [1, ∞).

Standard real functions

Function

Rule

Domain

Range

Identity

f(x) = x

ℝ

ℝ

Constant

f(x) = c

ℝ

{c}

Polynomial

f(x) = a₀ + a₁x + … + aₙxⁿ

ℝ

depends

Rational

f(x) = p(x)/q(x)

ℝ except zeroes of q

depends

Modulus

f(x) = x if x ≥ 0, and −x if x < 0

ℝ

[0, ∞)

Signum

f(x) = 1 if x > 0, 0 if x = 0, −1 if x < 0

ℝ

{−1, 0, 1}

Greatest integer

f(x) = [x], the greatest integer ≤ x

ℝ

ℤ (the integers)

The graph of the identity function is a straight line through the origin at 45°. The modulus graph is V-shaped. The greatest integer function has a step graph: [2.7] = 2, [−1.3] = −2, [5] = 5.

Algebra of real functions

For f, g : X → ℝ:

  • (f + g)(x) = f(x) + g(x)

  • (f − g)(x) = f(x) − g(x)

  • (fg)(x) = f(x) g(x)

  • (f/g)(x) = f(x)/g(x), provided g(x) ≠ 0

  • (αf)(x) = α f(x) for a real number α

Example. f(x) = x² and g(x) = 2x + 1. (f + g)(x) = x² + 2x + 1 = (x + 1)², and (f/g)(x) = x²/(2x + 1), for x ≠ −½.

Summary

  • A × B is the set of ordered pairs; n(A × B) = n(A) × n(B).

  • A relation is any subset of A × B; a function gives each element of the domain exactly one image.

  • Range ⊆ codomain; find the domain by excluding values where the formula fails.

  • Know the modulus, signum and greatest integer functions and their graphs.

Practise this topic →

Discussion

Sign in to join the discussion.

Sign in

No comments yet. Be the first to share your thoughts.