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,

R={(1,2),(1,3),(2,3)}R = \{(1,2),(1,3),(2,3)\}

is a relation, but it is not a function. The input 11 is paired with both 22 and 33.

A function follows one rule:

each input has exactly one output\text{each input has exactly one output}

Different inputs can still share the same output. That is allowed.

For example,

f={(1,2),(2,3),(3,3),(4,5)}f = \{(1,2),(2,3),(3,3),(4,5)\}

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

f={(1,2),(2,3),(3,3),(4,5)}f = \{(1,2),(2,3),(3,3),(4,5)\}

we get

domain(f)={1,2,3,4}\text{domain}(f) = \{1,2,3,4\}

and

range(f)={2,3,5}\text{range}(f) = \{2,3,5\}

Notice that 33 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

A={2,1,0,1,2}A = \{-2,-1,0,1,2\}

and define a relation by

h={(x,x2):xA}h = \{(x,x^2) : x \in A\}

Writing out the pairs gives

h={(2,4),(1,1),(0,0),(1,1),(2,4)}h = \{(-2,4),(-1,1),(0,0),(1,1),(2,4)\}

Now check it step by step.

The domain is all first coordinates:

{2,1,0,1,2}\{-2,-1,0,1,2\}

The range is all outputs that actually occur:

{0,1,4}\{0,1,4\}

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 2-2 and 22 map to 44, and both 1-1 and 11 map to 11.

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 xx-value has more than one yy-value, so the graph does not represent a function.

This test only works because the graph is being read as pairs (x,y)(x,y). 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, {0,1,2,3,4,5}\{0,1,2,3,4,5\}, the range might still be only {0,1,4}\{0,1,4\}. Range means actual outputs, not all allowed outputs.

Forgetting domain restrictions

A formula by itself does not always tell the whole story. For example, f(x)=1/xf(x)=1/x is not defined at x=0x=0, so 00 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 {1,2,3}\{1,2,3\}. 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 →