Lesson 1 of 8 · 15 min

Relations and functions

Describe a relation as a mapping, a set of ordered pairs, a graph or a rule, and use the vertical line test to decide whether it is a function.

What you will be able to do

  • Describe a relation as a mapping between sets, a set of ordered pairs, a graph or a rule.
  • Classify a relation as one-to-one, many-to-one, one-to-many or many-to-many.
  • Decide whether a relation is a function from its ordered pairs, its graph (the vertical line test) or its rule.

Type B4 into a vending machine and you expect the same drink every time. If B4 sometimes gave you water and sometimes juice, you couldn't rely on it. That reliability — one input, exactly one output — is the idea behind a function.

You have been working with relationships between quantities for years: the cost of nn tickets, the area of a circle of radius rr, the line y=2x+1y = 2x + 1. Mathematics calls any such pairing of inputs with outputs a relation.

Definition

Relation

A relation is a set of ordered pairs (x,y)(x, y): each pair links an input xx to an output yy. You can show a relation as

  • a mapping from a set of inputs to a set of outputs,
  • a list or table of ordered pairs,
  • a graph — the points (x,y)(x, y) on the Cartesian plane, or
  • a rule or formula that gives one variable in terms of another, such as C=12nC = 12n or x2+y2=9x^2 + y^2 = 9.

The relation {(1,2),(2,4),(3,6)}\{(1, 2), (2, 4), (3, 6)\} as a mapping. Each arrow goes from an input to its output; the rule is y=2xy = 2x.

The same relation can be written as the ordered pairs {(1,2),(2,4),(3,6)}\{(1, 2), (2, 4), (3, 6)\}, drawn as three points on a graph, or given by the rule y=2xy = 2x for x∈{1,2,3}x \in \{1, 2, 3\}. Each representation shows something different: the mapping shows which inputs share outputs, the graph shows the shape, and the rule lets you calculate.

Relations are sorted by how inputs and outputs are matched up.

The four kinds of relation. Only the first two are functions.
TypeWhat happensExampleFunction?
One-to-oneEach input has one output, and no output is sharedy=2x+1y = 2x + 1Yes
Many-to-oneEach input has one output, but different inputs can share an outputy=x2y = x^2Yes
One-to-manySome input has two or more outputsy2=xy^2 = xNo
Many-to-manyOutputs are shared and some input has several outputsx2+y2=25x^2 + y^2 = 25No

Key idea

Function

A function is a relation in which every input is paired with exactly one output.

One-to-one and many-to-one relations are functions. One-to-many and many-to-many relations are not.

Is the relation {(1,3),(2,5),(1,7),(4,9)}\{(1, 3), (2, 5), (1, 7), (4, 9)\} a function?

Choose one answer

On a graph, all the points with the same xx-value lie on one vertical line. So if some vertical line crosses a graph twice, that xx-value has two yy-values — and the graph is not a function.

The vertical line x=1x = 1 meets the circle x2+y2=9x^2 + y^2 = 9 twice, so the input x=1x = 1 has two outputs. The circle is not a function.

Key idea

The vertical line test

A graph represents a function exactly when no vertical line meets it more than once.

Imagine sliding a vertical ruler across the graph from left to right. If it ever touches the graph at two or more points at once, the relation is not a function.

The graph of y=x3−3xy = x^3 - 3x is shown. The dashed horizontal line meets it three times. Does the graph represent a function?

Choose one answer

You can also test a rule without drawing it. Choose an xx-value and work out how many yy-values it produces.

  • y=x2−4y = x^2 - 4: any xx gives a single value of x2−4x^2 - 4. Function.
  • x2+y2=25x^2 + y^2 = 25: x=3x = 3 gives y2=16y^2 = 16, so y=4y = 4 or y=−4y = -4. Not a function.
  • x=5x = 5 (a vertical line): the input 55 has infinitely many outputs. Not a function.
  • y=5y = 5 (a horizontal line): every input has the single output 55. Function.

An equation with y2y^2 in it is a warning sign: solving it usually gives a ±\pm.

Worked example

Decide whether each relation is a function

  • Simple familiar
  • Technology free

Decide whether each relation is a function. Justify each answer.

(a) y=x2−4y = x^2 - 4 (b) x2+y2=25x^2 + y^2 = 25 (c) x=y2−1x = y^2 - 1

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Choose an xx-value and solve for yy.

  2. If one xx-value gives two yy-values, it is not a function — quote that counterexample.

  3. If every xx-value gives exactly one yy-value, it is a function.

  4. Check with the vertical line test if you can picture the graph.

Watch out for

  • Choosing x=5x = 5 in (b): it gives only y=0y = 0, which proves nothing. Choose a value strictly inside the circle.

  • Rejecting (a) because x=2x = 2 and x=−2x = -2 give the same yy. Shared outputs are allowed.

Common mistake

Many-to-one is still a function

Students often reject y=x2y = x^2 because x=2x = 2 and x=−2x = -2 both give y=4y = 4. That is two inputs sharing an output, which is fine. The definition only forbids one input with two outputs.

The same mix-up happens with graphs: a horizontal line crossing a graph twice does not stop it being a function.

How would you classify the relation y=x2y = x^2?

Choose one answer

Exam tip

Justify with a counterexample

When a question asks you to show or justify that a relation is not a function, one specific counterexample is the clearest proof: "When x=0x = 0, y=3y = 3 or y=−3y = -3, so one input has two outputs." Naming the vertical line test is good, but say which vertical line fails.

Summary

  • A relation is a set of ordered pairs. It can be shown as a mapping, a list or table, a graph or a rule.

  • A function is a relation where every input has exactly one output.

  • One-to-one and many-to-one relations are functions; one-to-many and many-to-many relations are not.

  • Vertical line test: a graph is a function exactly when no vertical line meets it more than once.

  • To test a rule, substitute an xx-value: if you get two yy-values (a ±\pm), it is not a function.

  • To justify "not a function", give one xx-value and its two yy-values.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 1 of 80% read

Save your progress with a free account