Types of Relations
Theory
A relation is any set of ordered pairs; a function is a relation in which each \(x\)-value is paired with exactly one \(y\)-value. This Year 11 Mathematics Advanced page shows how to decide whether a relation is a function from a list of ordered pairs, a table, an arrow diagram, an equation or a graph, using the vertical line test, and how to split a relation such as \(y^{2}=x+9\) into two functions.
A relation is a set of ordered pairs \((x,y)\). It can be shown as a list such as \(\{(2,3),(4,6),(2,8)\}\), a table of values, an arrow diagram, an equation such as \(x^{2}+y^{2}=36\), or a graph. The domain is the set of first coordinates and the range is the set of second coordinates, each value listed once.
A function is a relation in which each \(x\)-value is paired with exactly one \(y\)-value. Different \(x\)-values may share the same \(y\)-value: \(\{(1,5),(2,5)\}\) is a function. What is not allowed is one \(x\)-value with two different \(y\)-values, like \((2,3)\) and \((2,8)\).
In an arrow diagram, a relation from \(X\) to \(Y\) is a function when every element of \(X\) has exactly one arrow leaving it. In everyday terms, “each person → their year of birth” is a function (everyone has one year of birth), but “each year → the people born in it” is not (a year can have many people).
The vertical line test: a graph represents a function if every vertical line meets it at most once. This works because a vertical line \(x=a\) contains every point with \(x\)-value \(a\). The horizontal line test is not a test for a function.
The definition of a function, in symbols:
Common relations that are not functions, with an \(x\)-value that gives two \(y\)-values:
| Relation | Graph | Two \(y\)-values |
|---|---|---|
| \(x^{2}+y^{2}=r^{2}\) | circle, centre \(O\), radius \(r\) | \(x=0\): \(y=\pm r\) |
| \(x=y^{2}\) or \(y^{2}=x\) | parabola opening to the right | \(x=4\): \(y=\pm 2\) |
| \(x=c\) | vertical line | every \(y\) at \(x=c\) |
Functions include lines \(y=mx+c\) (and horizontal lines \(y=c\)), parabolas \(y=ax^{2}+bx+c\), cubics, \(y=\sqrt{x}\) and \(y=|x|\).
How to decide whether a relation is a function
- Ordered pairs or a table: look for a repeated \(x\)-value. If the same \(x\) appears with two different \(y\)-values, it is not a function. Repeated \(y\)-values do not matter.
- Arrow diagram: check that every element of the first set has exactly one arrow leaving it.
- Equation: make \(y\) the subject where possible. If you get \(\pm\), or \(y^{2}\) on its own, substitute one \(x\)-value (such as \(x=0\)) and show it gives two \(y\)-values.
- Graph: apply the vertical line test. Look carefully at endpoints: two closed dots directly above each other fail the test; an open dot is not part of the graph.
Other question types
- Write a relation as ordered pairs: substitute each \(x\) in the given domain into the rule.
- Number of elements in the domain or range: list the values as a set, each once, then count.
- Find the parameter that stops it being a function (Example 4): if all the \(y\)-values are different, the relation fails exactly when two \(x\)-values are equal. Set each pair of \(x\)-values equal and solve.
- A vertical line \(x=k\) and a circle \(x^{2}+y^{2}=r^{2}\): substitute \(x=k\) to get \(y^{2}=r^{2}-k^{2}\). There are two points when \(r^{2}-k^{2}\gt 0\), that is \(-r\lt k\lt r\).
(i) State its domain and range.
(ii) Is the relation a function? Give a reason.
(i) Domain = set of first coordinates; range = set of second coordinates:
Domain \(=\boldsymbol{\{2,3,5\}}\) (list \(2\) once)
Range \(=\boldsymbol{\{1,4,6\}}\) (list \(4\) once)
(ii) A relation is a function if each \(x\)-value is paired with exactly one \(y\)-value.
The pairs \((2,1)\) and \((2,6)\) have the same \(x\)-value, \(2\), but different \(y\)-values.
\(\therefore\) the relation is not a function. (\(3\) and \(5\) both going to \(4\) is allowed.)
(i) \(y=x^{2}-4x\) (ii) \(x^{2}+y^{2}=36\) (iii) \(x=y^{2}+2\)
(iv) Write relation (iii) as two separate functions.
(i) \(y=x^{2}-4x\) gives one \(y\) for each \(x\) (a parabola): a function.
(ii) Substitute \(x=0\):
| \(y^{2}\) | \(=\) | \(36\) |
| \(y\) | \(=\) | \(\pm 6\) |
One \(x\)-value gives two \(y\)-values: not a function.
(iii) Substitute \(x=6\):
| \(6\) | \(=\) | \(y^{2}+2\) |
| \(y^{2}\) | \(=\) | \(4\) |
| \(y\) | \(=\) | \(\pm 2\) |
\(x=6\) gives \(y=2\) or \(y=-2\): not a function.
\(\therefore\) only (i) is a function.
(iv) Solve for \(y\):
| \(y^{2}\) | \(=\) | \(x-2\) |
| \(y\) | \(=\) | \(\pm\sqrt{x-2}\) |
Upper half: \(\boldsymbol{y=\sqrt{x-2}}\); lower half: \(\boldsymbol{y=-\sqrt{x-2}}\). Each passes the vertical line test.
(ii) Describe one change that would make it a function.
(iii) After your change, state the domain and range.
(i) Vertical line test: \((3,3)\) and \((3,1)\) are both closed (included) points, so the line \(x=3\) meets the graph twice.
\(\therefore\) \(x=3\) has two \(y\)-values: not a function.
(ii) Change one of these endpoints to an open circle, e.g. exclude \((3,1)\), so \(x=3\) has only the \(y\)-value \(3\).
(iii) The \(x\)-values run from \(0\) to \(5\) with no gaps, and the \(y\)-values from \(0\) (at the origin) up to \(3\).
\(\therefore\) domain \(\boldsymbol{[0,5]}\), range \(\boldsymbol{[0,3]}\)
The \(y\)-values \(2,5,8\) are all different, so the relation fails when two \(x\)-values are equal:
\(a^{2}=9\): \(a=\pm 3\)
\(a+6=9\): \(a=3\)
Set \(a^{2}=a+6\):
| \(a^{2}-a-6\) | \(=\) | \(0\) |
| \((a-3)(a+2)\) | \(=\) | \(0\) |
so \(a=3\) or \(a=-2\)
\(\therefore\) not a function when \(\boldsymbol{a=-3,\ -2}\) or \(\boldsymbol{3}\).
Check \(a=-2\): the pairs are \((4,2)\), \((9,5)\) and \((4,8)\), and \(x=4\) has two \(y\)-values.
Common pitfalls
Frequently asked questions
What is the difference between a relation and a function?
A relation is any set of ordered pairs. A function is a relation in which each \(x\)-value is paired with exactly one \(y\)-value. Every function is a relation, but not every relation is a function.
What is the vertical line test?
A graph represents a function if every vertical line meets it at most once. If some vertical line meets the graph twice, one \(x\)-value has two \(y\)-values, so it is not a function.
Is a circle a function?
No. For \(x^{2}+y^{2}=36\), \(x=0\) gives \(y=6\) and \(y=-6\), so a vertical line meets the circle twice. The upper semicircle \(y=\sqrt{36-x^{2}}\) is a function.
Can two x-values have the same y-value in a function?
Yes. A function may pair different \(x\)-values with the same \(y\)-value, as \(y=x^{2}\) does with \(x=2\) and \(x=-2\). It is one \(x\)-value with two \(y\)-values that is not allowed.
How do you tell if an equation is a function without a graph?
Make \(y\) the subject. If one \(x\)-value can give two \(y\)-values, for example because of a \(\pm\) square root, it is not a function. Show it with a specific \(x\)-value.