Skip to content
MathsMaths
Start learning

Maths · Lesson 2.3

Relations & Functions

Cartesian products, relations, domain, range and function notation.

Core syllabus1 linked experiment
01

Learning objectives

By the end of this lesson, you should be able to:

  • Form Cartesian products and list relations.
  • Identify the domain and range of a relation.
  • Decide whether a relation is a function.
  • Evaluate and interpret function notation.
02

Lesson

A relation is any set of ordered pairs. A function is a special relation in which each input has exactly one output. This single restriction is what makes functions predictable and allows us to write y = f(x).

The Cartesian product gives the raw material for relations. From there we select pairs, identify domains and ranges, and test whether the result is a function.

An input value entering a function machine and an output value leaving it.
A function maps each input to one output

Cartesian products and relations

The Cartesian product A × B is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B. If A has m elements and B has n elements, then A × B has mn elements. A relation from A to B is any subset of A × B.

The domain of a relation is the set of all first coordinates that appear, and the range is the set of all second coordinates. For example, the relation {(1, 2), (1, 3), (2, 4)} has domain {1, 2} and range {2, 3, 4}.

Functions and the vertical line test

A relation is a function if no two pairs have the same first coordinate but different second coordinates. In a graph, this is the vertical line test: a vertical line may meet the graph at most once. The notation f : A → B means that f maps elements of A to elements of B.

The domain of a function is the set of allowed inputs. For f(x) = 1/(x - 2), the domain is all real numbers except 2, because division by zero is undefined. The range is the set of outputs that actually occur.

03

Worked example

For A = {1, 2, 3} and B = {4, 5}, list A × B. Is the relation R = {(1, 4), (2, 5), (3, 4)} a function?

A × B = {(1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5)}.

The relation R contains three pairs, one for each element of A.

Each first coordinate 1, 2 and 3 appears exactly once, so each input has exactly one output.

Therefore R is a function from A to B.

04

Equations

Cartesian productA × B = {(a,b) : a ∈ A, b ∈ B}
Functionf : A → B, y = f(x)
Domain and rangeDomain = set of inputs; Range = set of outputs
05

Key points

  • A × B contains all ordered pairs with first coordinate from A and second from B.
  • A relation is any subset of a Cartesian product.
  • A function assigns exactly one output to each input.
  • The vertical line test detects whether a graph represents a function.
06

Common misconceptions

Common mistake

Every relation is a function.

Correct understanding

Only relations in which each input has exactly one output are functions. The relation {(1, 2), (1, 3)} is not a function.

07

Check your understanding

1. Which relation is a function?

2. What is the domain of f(x) = √(x - 3)?

08

Frequently asked questions

Can a function have the same output for two different inputs?

Yes. For example, f(x) = x2 gives f(2) = f(-2) = 4. A function only requires one output per input, not one input per output.

What is the difference between domain and range?

The domain is the set of inputs, and the range is the set of outputs.

NERDLYY · FEEDBACK

Help shape Nerdlyy

Your feedback goes directly to the team. We read every submission.

No reply needed — you can send feedback without sharing contact details.