Skip to main content
Mathovia

Algebra / Graphing and Functions

Relations: Ordered Pairs, Domain, and Range

A relation is any set of ordered pairs — nothing more. That sounds almost too loose to be useful, but it is the foundation the whole idea of a function is built on: a function is simply a relation with one extra rule attached. This lesson covers what a relation is, the four different ways the same relation can be written, how to read its domain and range, and what happens when you swap every pair around.

M
Written by
Mathovia Team
Editorial Team

Before you can say what a function is, you need a word for the thing a function is a special case of. That word is relation, and its definition is refreshingly short: any set of ordered pairs at all.

A relation as a set of ordered pairs with domain and range
A relation is a set of ordered pairs

The Definition

A relation is a set of ordered pairs. That is the whole thing. These are all relations:

There is no requirement that the pairs follow a pattern, that the inputs be evenly spaced, or that anything sensible happen at all. A relation just relates first coordinates to second coordinates.

A mapping diagram with the domain values 1, 2 and 3 in one oval and range values 2, 4 and 6 in another, connected by arrows
The relation {(1, 2), (2, 4), (3, 6)} drawn as a mapping.

The word “ordered” is doing real work. and are different pairs, so swapping them gives a different relation.

Domain and Range

Two sets come out of any relation:

  • The domain is the set of all first coordinates — every input that appears.
  • The range is the set of all second coordinates — every output that appears.

For , the domain is and the range is .

Two conventions matter when you write these down. List each value once, because a set has no repeats: the relation has range . And write them in increasing order, which is not required mathematically but is expected in an answer.

Domain and range get much more involved once relations are given by formulas rather than lists, and each has its own lesson.

Four Ways to Write the Same Relation

A relation can be presented in four ways, and part of the skill here is moving between them freely.

1. As a set of ordered pairs.

2. As a table.

123
246

3. As a mapping diagram — the figure above, with an arrow from each input to its output.

4. As a graph — one plotted point per pair.

The points (1, 2), (2, 4) and (3, 6) plotted on a coordinate plane
The same relation as points on the plane.

Each form makes something different obvious. The mapping diagram shows the pairing most directly, which is why it is the best tool for testing whether a relation is a function. The graph shows shape and trend. The table is easiest to extend. The set notation is the most compact.

Finite and Infinite Relations

The examples so far have been finite — a handful of pairs you can list. Relations can just as easily be infinite.

An equation like describes a relation containing infinitely many pairs: , , , , and so on forever. You cannot list them, so you describe them with a rule and draw them as a continuous graph.

This is why the graph of an equation matters. The graph is the relation, drawn.

Set-builder notation handles the infinite case: reads “the set of all pairs such that ”.

When a Relation Is Not a Function

Because a relation has no rules, it is free to do something a function may not: pair a single input with two different outputs.

A mapping diagram where the input 1 has two arrows leaving it, going to outputs 2 and 5, marked as not a function
Two arrows leaving one input — allowed for a relation, fatal for a function.

In , the input is paired with both and . Perfectly legitimate as a relation. But if you asked “what does this relation give for ?”, there is no single answer — and that ambiguity is exactly what functions exist to rule out.

On a mapping diagram the failure is visible instantly: count the arrows leaving each left-hand element. On a graph you use the vertical line test instead.

The Inverse of a Relation

Swap the coordinates in every pair and you get the inverse relation, written .

Two things happen when you do this. The domain and range trade places: the domain of is the range of . And on a graph, every point reflects across the line .

Points (1, 4) and (2, 6) with their swapped counterparts (4, 1) and (6, 2), each pair joined by a dashed line crossing the line y = x
Swapping coordinates reflects each point across y = x.

Note that the inverse of a function is not always a function. Reversing gives , where the input 4 now has two outputs.

Worked Example A: Domain and Range

Find the domain and range of .

  • Domain (first coordinates):
  • Range (second coordinates):

The output appears twice but is listed once.

Worked Example B: Table to Pairs

Write this table as a set of ordered pairs and give its domain.

Pairs: . Domain: . Range: .

Worked Example C: Is It a Function?

Which of these are functions?

The first is a function — three inputs all sending to the same output is fine, because each input still has one output. The second is not: the input has two outputs.

Worked Example D: The Inverse

Find the inverse of and state whether it is a function.

Swap each pair: .

Its inputs are , and — all different — so yes, the inverse is a function.

Worked Example E: An Infinite Relation

Describe the relation and give three of its pairs.

It contains every pair whose second coordinate is the square of the first: , , . Its graph is a parabola, its domain is all real numbers, and its range is .

Common Mistakes to Avoid

  • Listing repeats in the domain or range. Sets do not repeat elements; should be .
  • Swapping domain and range. Domain comes from the -values, the first coordinates.
  • Thinking a repeated output breaks the function rule. It does not. Only a repeated input with different outputs does.
  • Assuming every relation must have a formula. A random list of pairs is a relation with no rule at all.
  • Forgetting that order matters. and are different pairs.
  • Assuming the inverse of a function is a function. Often it is not.

Where Relations Lead Next

  • Functions — relations with the one-output rule attached.
  • Domain and range as full topics, once relations are given by formulas.
  • Inverse functions, where the swap has to produce a function again — possible only for a one-to-one function.
  • Graphs of equations. Every equation in and defines a relation, and its graph is the picture of that relation.
  • Databases and data science, where a “relation” in the same sense is literally what a table of records is called.

Practice Problems

Work each one before opening the answer.

Problem 1. State the domain and range of .

Show answer

Domain ; range .

Problem 2. State the domain and range of .

Show answer

Domain ; range — zero is listed once.

Problem 3. Is a function?

Show answer

No. The input is paired with both and .

Problem 4. Is a function?

Show answer

Yes. Every input has exactly one output; sharing an output is allowed.

Problem 5. Write as a table.

Show answer

: 0, 1, 2 across the top; : 2, 5, 8 beneath.

Problem 6. Find the inverse of .

Show answer

.

Problem 7. The inverse of a relation is . What was the original?

Show answer

Swap back: .

Problem 8. A relation has domain and range . Write it out.

Show answer

— both inputs map to the only available output.

Problem 9. Give two ordered pairs belonging to .

Show answer

Any pairs fitting the rule, for example and .

Problem 10. Is the inverse of a function?

Show answer

The inverse is . The input has two outputs, so no.

Quick Reference

TermMeaning
RelationAny set of ordered pairs
DomainThe set of all first coordinates
RangeThe set of all second coordinates
FunctionA relation where each input has exactly one output
InverseEvery pair swapped; reflects across
Four representationsPairs, table, mapping diagram, graph
Repeated outputsAllowed, and still a function
Repeated inputsAllowed for a relation, not for a function

A relation with the one-output rule attached is a function, written using function notation. The two sets it produces get full treatment in Domain and Range, and the pairs themselves are covered in Ordered Pairs. More Algebra lessons are available.

Frequently Asked Questions

What is a relation in math?+

A relation is any set of ordered pairs. is a relation, and so is any random collection of pairs — there is no requirement that the pairs follow a pattern or a rule.

What is the difference between a relation and a function?+

Every function is a relation, but not every relation is a function. A relation becomes a function only when each input is paired with exactly one output. A relation is allowed to pair one input with several outputs; a function is not.

How do you find the domain and range of a relation?+

The domain is the set of all first coordinates, and the range is the set of all second coordinates. List each value once, in increasing order, even if it appears in several pairs.

What are the four ways to represent a relation?+

As a set of ordered pairs, as a table of values, as a mapping diagram with arrows from inputs to outputs, and as a graph of plotted points. All four describe the same information.

What is the inverse of a relation?+

Swap the coordinates in every pair. The inverse of is . On a graph this reflects every point across the line , and the domain and range trade places.

Can a relation have repeated values?+

Yes, but a set lists each element only once. The relation has range , not , because 5 is a single member of the set even though it appears twice as an output.

Related lessons