A relation is any set of ordered pairs that links inputs to outputs, such as {(1, 4), (2, 5), (2, 7)}. It can be shown as a list, table, mapping diagram or graph. A relation in which every input has exactly one output is a function; this one is not, because 2 has two outputs.
In Spanish
relación
Also called
mathematical relation, set of ordered pairs, binary relation
A relation is just a set of input-output pairs, in any form. It becomes a function only if no input has two different outputs.
Formal definition and notation
A relation from a set A to a set B is any subset of the Cartesian product A × B, that is, any set of ordered pairs (a, b) with a ∈ A and b ∈ B. Its domain is the set of first coordinates and its range is the set of second coordinates. A function is a relation in which no two different pairs share the same first coordinate.
Symbol
Read it as
Meaning
{(1, 4), (2, 5)}
the set of pairs 1 comma 4 and 2 comma 5
a relation listed as ordered pairs
(x, y)
x comma y
an input x paired with an output y
A × B
A cross B
all possible pairs from A and B; a relation picks some of them
Key facts
Every function is a relation, but not every relation is a function.
To test a relation for being a function, look for a repeated first coordinate with a different second coordinate.
An output may repeat in a function: {(1, 6), (2, 6)} is a function, because each input still has one output.
On a graph, a relation is a function when it passes the vertical line test.
Equations can define relations that are not functions, such as the circlex2 + y2 = 25, where x = 3 gives y = 4 and y = −4.
Try it: make the relation a function
Interactive
These four points form a relation. Points A and B share x = 1, so it is not a function. Drag A or B to a new x-value and the relation becomes a function.
This interactive needs JavaScript. The worked examples below show the same ideas step by step.
Relation examples, step by step
Example 1: Domain and range of a relation
Warm-up
For the relation {(3, −1), (0, 4), (3, 2), (−5, 4)}, list the domain and the range.
Domain: the first coordinates 3, 0, 3, −5, each listed once.
Range: the second coordinates −1, 4, 2, 4, each listed once.
Answer: Domain {-5, 0, 3}; range {-1, 2, 4}.
Example 2: Is it a function?
Core
A table pairs a student’s ID number (input) with a test score (output): (101, 88), (102, 92), (103, 88), (101, 75). Is this relation a function?
Look for repeated inputs: 101 appears twice.
Its outputs differ: 88 and 75.
One input with two outputs breaks the function rule. (The repeated output 88 for 101 and 103 is fine.)
Answer: No, it is not a function, because input 101 has two outputs.
Example 3: A relation from an equation
Test-style
Does x = y2 define y as a function of x? Test the input x = 9.
An equation is a statement like y = x + 1. The relation is the set of all pairs that make it true, such as (0, 1) and (5, 6).
Quick check: 3 questions
Question 1 of 3
Which relation is NOT a function?
Show answer and explanation
Answer: C. In the third relation the input 4 goes to both 1 and 3. The others never repeat an input; the second and fourth only repeat outputs, which is allowed.
Question 2 of 3
What is the range of {(2, −3), (6, 0), (−1, −3)}?
Show answer and explanation
Answer: A. The range is the set of second coordinates, each listed once: −3 and 0. {−1, 2, 6} is the domain, the third choice lists −3 twice, and the last mixes inputs with outputs.
Question 3 of 3
In a mapping diagram, which picture shows a relation that is not a function?
Show answer and explanation
Answer: C. A function needs one arrow out of every input. An input with two arrows breaks that rule. Two arrows landing on one output is allowed, and the other two pictures describe functions.
Relation: 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 with one extra rule: each input has exactly one output. So every function is a relation, but a relation such as {(2, 3), (2, 8)} is not a function, because the input 2 is paired with two different outputs.
What are the ways to represent a relation?
There are four common ways: a list of ordered pairs in braces, a table with an input column and an output column, a mapping diagram with arrows from inputs to outputs, and a graph of points on a coordinate plane. An equation or a description in words can also define a relation by saying which pairs belong.
Can a relation have just one ordered pair?
Yes. {(5, 2)} is a relation with domain {5} and range {2}, and it is also a function, since its only input has one output. Even the empty set, with no pairs at all, counts as a relation in set theory, though textbooks rarely use it.
Ordered PairAn ordered pair is two numbers written to locate a point on the coordinate plane. It is written as (x, y): the x-value comes first, and the y-value comes second. From the origin, move x units across, then y units up or down. The order matters: (2, 5) and (5, 2) are different points.Geometry · Grade 5, Grade 6, Grade 7FunctionA function is a rule that gives exactly one output for each input. If you put in one x-value, a function gives back one y-value. In f(x) = 2x + 1, the input 3 gives the output 7. Two inputs may share an output, but one input can never have two different outputs.Functions · Grade 8, Algebra 1, Algebra 2SubsetA subset is a set whose elements all belong to another set. If every element of A is also in B, then A is a subset of B, written A ⊆ B. Every set is a subset of itself, the empty set is a subset of every set, and a set with n elements has 2n subsets.Probability · Algebra 1, StatisticsDomainThe domain of a function is the set of all input values (usually x-values) the function can accept. Unless a problem says otherwise, it is every real number except values that would divide by zero or take an even root of a negative number. On a graph, the domain is how far the graph reaches left and right.Functions · Grade 8, Algebra 1, Algebra 2Vertical Line TestThe vertical line test is a way to tell from a graph whether it shows a function: if any vertical line crosses the graph more than once, it is not a function. If every vertical line crosses it at most once, each input x has only one output y, so the graph is a function.Functions · Grade 8, Algebra 1, Algebra 2CircleA circle is the set of all points in a flat plane that are the same distance from one fixed point, the center. That distance is the radius. A segment through the center from edge to edge is the diameter, twice the radius. The distance around is the circumference, 2π r, and the area inside is π r2.Geometry · Kindergarten, Grade 1, Grade 7NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2SubstituteSubstitute means to replace a variable with a number or with an equal expression. In 4x − 1, substituting 3 for x gives 4(3) − 1. You substitute to evaluate expressions, to check whether a number is a solution, and to solve systems of equations by swapping in an equal expression.Algebra · Grade 6, Grade 7, Grade 8EquationAn equation is a statement that two expressions are equal. It always has an equal sign, such as x + 5 = 12 or 3a = 18. Solving an equation means finding the value of the variable that makes it true: here x = 7 and a = 6. An expression like 4x + 7 has no equal sign, so it is not an equation.Algebra · Grade 6, Grade 7, Grade 8Coordinate PlaneThe coordinate plane is a flat grid formed by a horizontal x-axis and a vertical y-axis crossing at the origin, (0, 0). Every point is located by an ordered pair, x first then y, such as (3, −2). The two axes divide the plane into four quadrants, numbered I to IV counterclockwise from the upper right.Geometry · Grade 5, Grade 6, Grade 7InputAn input is the value you put into a function or a rule. The rule acts on the input to produce the output: for f(x) = x + 2, the input 5 gives the output 7. For many functions, the input is the x-value. In an input-output table, the inputs fill the first column.Functions · Grade 6, Grade 7, Grade 8Function NotationFunction notation is the way of writing a function as f(x), read “f of x”: f names the function, x is the input, and f(x) is the output. Writing f(x) = 2x + 5 means the same as y = 2x + 5, and f(3) = 11 says that the input 3 gives the output 11.Functions · Grade 8, Algebra 1, Algebra 2Range of a FunctionThe range of a function is the set of all output values (usually y-values) the function actually produces from its domain. For f(x) = x2, every output is 0 or more, so the range is y ≥ 0. On a graph, the range is how far the graph reaches down and up.Functions · Grade 8, Algebra 1, Algebra 2OutputAn output is the value a function or rule produces from a given input. You put a number in, apply the rule, and the result that comes out is the output. For y = 2x, the input 3 gives the output 6. In an input-output table the output sits in the second column.Functions · Grade 6, Grade 7, Grade 8