A relation is any set of ordered pairs. A function is a relation where each input has exactly one output. To find the domain, collect the first coordinates. To find the range, collect the outputs that actually appear.
That is the core idea behind most "relations and functions" questions. Once you can check the one-input-one-output rule, domain, range, and mapping type become much easier to sort out.
Relation vs. function: the key difference
A relation can pair inputs and outputs in any way. For example,
is a relation, but it is not a function. The input is paired with both and .
A function follows one rule:
Different inputs can still share the same output. That is allowed.
For example,
is a function because no first coordinate is paired with two different second coordinates.
How to find domain and range
The domain is the set of all inputs, so it comes from the first coordinates. The range is the set of outputs that actually appear, so it comes from the second coordinates.
Using
we get
and
Notice that appears twice as an output, but in a set it is still written once. The range lists distinct outputs, not how many times they occur.
If a problem also gives a codomain, do not automatically treat it as the range. The codomain is the larger target set that outputs are allowed to come from. The range is the subset that the function actually hits.
Mapping types: which ones can be functions
When people classify relations and functions, they usually mean one of these patterns:
- One-to-one: each input has one output, and different inputs give different outputs.
- Many-to-one: different inputs can share the same output.
- One-to-many: one input is paired with more than one output.
- Many-to-many: repeated inputs and repeated outputs both occur in a less restricted way.
Only the first two can be functions. A one-to-many relation is never a function, because one input would have multiple outputs.
Worked example: domain, range, and type in one relation
Let
and define a relation by
Writing out the pairs gives
Now check it step by step.
The domain is all first coordinates:
The range is all outputs that actually occur:
Is it a function? Yes. Each input appears once and has exactly one output.
What type is it? It is many-to-one, not one-to-one, because both and map to , and both and map to .
This is the point many students miss: repeated outputs do not break a function. Repeated inputs with different outputs do.
How to tell from a graph
If a relation is shown on a graph, the vertical line test is a quick check. If some vertical line intersects the graph at more than one point, then one -value has more than one -value, so the graph does not represent a function.
This test only works because the graph is being read as pairs . It is a visual restatement of the same rule: one input, one output.
Common mistakes with relations and functions
Thinking repeated outputs break a function
They do not. A function can be many-to-one. The problem is repeated inputs with different outputs.
Mixing up range and codomain
If the codomain is given as, say, , the range might still be only . Range means actual outputs, not all allowed outputs.
Forgetting domain restrictions
A formula by itself does not always tell the whole story. For example, is not defined at , so cannot be in the domain.
Assuming every relation is a function
Relations are the broader idea. Functions are the stricter case inside that broader category.
Where relations and functions are used
Relations are useful whenever you want to describe which objects are connected to which others. That appears in set theory, databases, graph theory, and coordinate geometry.
Functions are even more central. Algebra, calculus, statistics, physics, and computer science all use functions to describe how one quantity depends on another. Whenever you see a rule like "input this value, get that output," you are usually looking at a function.
Try a similar problem
Make a small relation using the domain . First create one that is not a function by giving one input two different outputs. Then change only one pair so it becomes a function, and compare the domain and range before and after. That is one of the fastest ways to make the distinction stick.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →