On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Advanced Functions · Grade 6-8

Function as Mapping

A function is a mapping where every input has exactly one output.

f(x)=one output for each input

Quick Answer

A function is a mapping where every input has exactly one output. Picture it as arrows: each input in a left-hand column sends one arrow to an output in a right-hand column. Use this view to test a table, a list of ordered pairs or an arrow diagram: if some input sends arrows to two different outputs, it is not a function. Several inputs pointing at the same output is fine, the way many students can be given the same grade.

Why This Matters

The arrow picture turns the function rule into something you can check by counting, and it works even when there is no formula at all: students and bus routes, books and shelves. Once a mapping is a function, 'what does this input go to?' always has exactly one answer, which is what lets you write f(3) and mean something definite.

Intuitive Explanation

Draw two columns. On the left, list five students: Ana, Ben, Cal, Dee, Eli. On the right, list the school bus routes: A, B and C. Each student rides exactly one bus home, so draw one arrow from each student to their route. Every student sends out exactly one arrow. That arrow diagram is a function, a mapping from students to bus routes.

Route A might receive three arrows, and route C none at all. Both are fine. The rule only says each input sends out one arrow; it says nothing about how many arrows an output receives. As ordered pairs, the same diagram might read (Ana, A), (Ben, A), (Cal, B), (Dee, A), (Eli, B): the first entry of each pair is the input and the second is its output.

Now reverse the arrows, from routes to students. Route A points to Ana, Ben and Dee, so 'who rides route A?' has three answers. The reversed mapping is not a function. The same connections pass or fail depending on which side is the input. For ordered pairs, the quick check is this: if a first entry appears twice with different second entries, it is not a function.

Think of it like this. A function as a mapping is like a post office sorting letters into mailboxes: each letter goes into exactly one box, though one box can hold many letters. A letter copied into two different boxes would break the system, and that is what a non-function does with an input.

Core idea. A function is a rule that assigns each allowed input exactly one output.


When to Use

Think of a mapping when a relationship is given as a list of pairs, a table or an arrow diagram, especially with names or categories rather than formulas: students to bus routes, products to prices. Check that each input has exactly one output. If the question is whether each output comes from only one input, you are testing one-to-one instead. For a graph, use the vertical line test.

Tip. Ask: Does any input point to two different outputs?

How to Recognize It

Before deciding, look at each input on the left side of the mapping and count the arrows leaving it.

  1. Does every input in the left-hand set have an arrow?

    It must. If an input in the set has no arrow, the mapping is only a relation, not a function on that set. Either remove the unused input or give it one output.

  2. Do two or more arrows land on the same output?

    That is allowed: a function can send several inputs to one output, like many students sharing one bus route. It only stops the mapping from being one-to-one, which matters when you want to run it backwards.

  3. Are the inputs or outputs words, like names or colors, rather than numbers?

    That is fine: a mapping from students to favorite colors is still a function if each student names one color. No formula is needed, so check the arrows, not an equation.

  4. Is the mapping drawn as a graph instead of an arrow diagram?

    Then use the vertical line test: each vertical line is one input, and if it crosses the graph twice, that input has two outputs and the graph shows a relation.

Function as Mapping compared with Relation and One-to-one mapping

All three rows are sets of arrows from inputs to outputs, which is why they look the same at first. Ask which direction you are checking: one output per input (function), no rule at all (relation), or one input per output as well (one-to-one).

Function as Mapping

Meaning
Use this when a relationship assigns outputs to inputs and you must decide whether it is a function.
Key test
Does any input point to two different outputs?
Formula
f(x)=one output for each input
Example
Is {(1,4), (2,4), (3,5)} a function?

Relation

Meaning
Any set of input-output pairs.
Key test
Use when the one-output rule may fail.
Example
(2,3) and (2,5)

One-to-one mapping

Meaning
A function where outputs are not repeated either.
Key test
Use when reversing the function matters.
Example
Each student has one ID and each ID has one student

Formula & Notation

f(x)=one output for each input
f ⁣:X→Y is a mapping such that ∀ x∈X,  ∃! y∈Y:y=f(x). Equivalently, f⊆X×Y is a set of ordered pairs with unique first elements.

How to read it: f(x) names the output assigned to input x.

Worked Examples

Example 1 — Ordered pairs

Easy

Is {(1,4), (2,4), (3,5)} a function?
Show the steps and the answer
  1. Draw the mapping: inputs 1, 2, 3 on the left, outputs 4 and 5 on the right, with arrows 1→4, 2→4, 3→5.

    An arrow diagram makes it easy to count how many arrows leave each input.

  2. Count the arrows leaving each input: 1 has one, 2 has one, 3 has one.

    The function rule is about inputs: each must send out exactly one arrow.

  3. Notice that two arrows arrive at 4.

    Arrows meeting at an output are allowed; only arrows splitting from one input are not.

Answer: Function

Takeaway: Count arrows leaving each input. One each means a function, however many arrive at a single output.

Example 2 — Repeated input

Standard

Is {(1,4), (1,5), (2,6)} a function?
Show the steps and the answer
  1. Group the pairs by input: 1 sends arrows to both 4 and 5; 2 sends one arrow to 6.

    Sorting by the first entry puts each input's arrows side by side.

  2. Spot the split: input 1 points to two different outputs.

    Asked 'what does 1 map to?', you would have no single answer.

  3. Compare with Example 1, where 1 and 2 shared the output 4.

    Shared outputs are allowed; a split input is not, so the direction of the repeat decides it.

Answer: No, not a function.

Takeaway: One input with two arrows going out is enough to stop a set of pairs from being a function.

Example 3 — Find the mistake: a repeated output

Application

A table maps four students to their favourite colour: Ana → blue, Ben → green, Cal → blue, Dev → red. Kim says: "Blue appears twice, so this is not a function." Find the mistake and correct it.
Show the steps and the answer
  1. Count the outputs for each input: Ana 1, Ben 1, Cal 1, Dev 1.

    The function test is about the inputs, which here are the students.

  2. Identify Kim's reasoning: blue is the output for two different inputs, Ana and Cal.

    Kim looked for repeats among the outputs, which is the wrong direction.

  3. Apply the rule: repeated outputs are allowed, so the mapping is a function.

    Each student has one favourite colour, so 'Ana's favourite colour' always has a single answer.

  4. Show what would break it: if Dev were listed with both red and yellow, Dev would have 2 outputs.

    Only an input with more than one output makes a mapping fail.

Answer: It is a function: each student has exactly one favourite colour, and two students sharing blue is allowed.

Takeaway: Look for an input repeated with different outputs, not for an output that appears twice.

Where You'll See It

  • Students to homerooms

    A school assigns each of its 600 students to one of 24 homerooms. Every student maps to exactly one room, so this is a function, even though about 25 students share each room. The reverse mapping, room to student, is not a function.

  • Books to library shelves

    A library catalogue maps each book to one shelf code, such as 510 for mathematics. Many books share a shelf code, which is allowed. A book listed under two different codes would make the mapping fail, and the book would be hard to find.

Common Mistakes

  1. The slip: Rejecting a function because two inputs share an output

    Instead: repeated outputs are allowed.

  2. The slip: Accepting a relation with one input and two outputs

    Instead: that violates the function rule.

  3. The slip: Thinking every graph is a function

    Instead: use the vertical line test.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. The mapping x→x2 uses the inputs {−2,−1,0,1,2}. List the outputs. How many different outputs are there?

    Hint: Square each input. Negative inputs give positive squares.

  2. A mapping diagram has arrows 1→6, 2→7, 3→8 and 2→9. Is it a function? Which input breaks the rule, if any?

    Hint: Count the arrows leaving each input.

  3. A mapping sends each input x to 2x+1. The inputs are {0,1,2,3}. List the ordered pairs.

    Hint: Compute 2x+1 for each input in turn.

  4. Students map to shoe sizes: Ana →7, Ben →8, Cal →7, Dee →9. Is this a function? Would the reverse, sizes to students, be a function?

    Hint: For each direction, check whether any input has two outputs.

  5. A mapping sends 1→10, 2→10, 3→30. Is it a function only, or also one-to-one?

    Hint: One-to-one needs a different output for every input.

  6. A student says '{(5,2),(6,2),(7,8)} is not a function, because 2 appears twice.' Find and correct the mistake.

    Hint: Does 2 appear as an input or as an output?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

If every input goes to the same output, is it still a function?

Yes. If every student in a class gets the same homework, each student still has exactly one assignment, so it is a function. It is called a constant function; with number inputs, its graph is a flat line. It breaks no rule, because many inputs may share one output. It just cannot be run backwards: knowing the homework tells you nothing about which student you have.

Can the inputs be something other than numbers?

Yes. Inputs and outputs can be people, dates, words or anything you can list. 'Each person maps to their birthday' is a function, because nobody has two birthdays. Reversed, it fails: one date, like March 3, can belong to many people. Numbers are just the most common kind of input, because they let you write a formula.

Why is the vertical line test the same idea as counting arrows?

On a graph, each xx-value is an input, and every point straight above or below it is one of its outputs. A vertical line through x=2x=2 collects all the outputs of the input 2. If the line hits the graph twice, the input 2 has two arrows leaving it, which breaks the function rule. So the test is arrow-counting done with a ruler.

Does a function have to use every output in the right-hand column?

No. The right-hand column can contain outputs that no arrow reaches. If the outputs listed are the grades A, B, C, D and F, and no student got a D, the mapping is still a function. The outputs that are actually reached form the range; the full list on the right is sometimes called the codomain.

Learning Path

← Before

Function
Function as Mapping

You are here

You need Function: the idea that a rule gives each input one output. Function as Mapping adds the arrow-diagram picture, which works for names, categories and numbers alike. Next, Domain is the set of inputs on the left, Range is the set of outputs that actually receive arrows, and One-to-One Mapping asks for at most one arrow into each output.

See Also