On this concept: Formula

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

Math · Advanced Functions · Grade 6-8

One-to-One Mapping

A one-to-one (injective) function sends distinct inputs to distinct outputs — no output is ever repeated.

f(a)=f(b)  ⟹  a=b

Quick Answer

A one-to-one (injective) function sends distinct inputs to distinct outputs — no output is ever repeated. Use it when you need to run a function backwards: if each output comes from only one input, the output tells you the input for certain, so an inverse exists. Check with the horizontal line test (no horizontal line crosses the graph twice) or with algebra (if f(a)=f(b), then a=b). Lines like y=3x−2 pass; y=x2 fails, because 2 and −2 both give 4.

Why This Matters

One-to-one is what makes working backwards safe. A locker number identifies exactly one student because no two students share a locker. When outputs repeat, as with students' grades, the output cannot tell you which input it came from, so no inverse exists until you restrict the inputs.

Intuitive Explanation

In a school, every student has their own locker, and no two students share one. Give the office a locker number and they can tell you exactly whose it is. That is a one-to-one mapping: different students always go to different lockers. Compare favourite sports: many students pick football, so knowing someone picked football does not tell you who they are.

With numbers, f(x)=3x−2 is one-to-one. The inputs 1, 2, 3 give 1, 4, 7, and since every step adds 3, the outputs never repeat. On a graph, a horizontal line at any height crosses this line exactly once. The function f(x)=x2 is different: 2 and −2 both give 4, so the horizontal line y=4 crosses the parabola twice.

One-to-one is easy to confuse with being a function, because both are about 'one'. A function needs one output for each input, checked with vertical lines. One-to-one adds the reverse: one input for each output that is used, checked with horizontal lines. So x2 is a function but not one-to-one, while 3x−2 is both.

Think of it like this. A one-to-one function is like assigned seats on a plane: every passenger has their own seat, so the seat number tells you exactly who should be sitting there. If two passengers were booked into seat 14C, the seat number would no longer identify one person, and the mapping would not be one-to-one.

Core idea. A one-to-one function never lets two distinct inputs share the same output.


When to Use

Test one-to-one when a problem asks whether you can reverse or undo a function, whether an output identifies the input, or whether an inverse exists. Use the horizontal line test on a graph, look for repeated outputs in a table, or check that f(a)=f(b) forces a=b. If the question is only whether a relation is a function at all, use the vertical line test; if outputs repeat, the function is many-to-one.

Tip. Ask: Does every output value come from at most one input?

How to Recognize It

Before calling a function one-to-one, look at its outputs to see whether any of them is shared, and at whether the problem needs you to work backwards from an output.

  1. Can you find two different inputs that give the same output, such as 3 and −3 in y=x2?

    If yes, the function is many-to-one, not one-to-one, and it has no inverse unless you cut down its domain. If you cannot find such a pair, confirm it with the horizontal line test or with algebra.

  2. Does the question ask you to undo the function, or to find the input when you are told the output?

    If yes, one-to-one is exactly what you must check, because an inverse exists only when each output points back to a single input. If you only need outputs, the property may not matter.

  3. Is the question only whether each input has exactly one output?

    If yes, that is the test for being a function at all, done with the vertical line test. One-to-one is a stricter extra condition, checked with horizontal lines.

  4. Is the question about whether every possible output value actually gets used?

    If yes, that is onto (surjective), a question about coverage, not uniqueness. A function can be one-to-one without being onto: with whole-number inputs and outputs, y=2x never gives 3.

One-to-One Mapping compared with Many-to-one mapping, Function (in general), and Onto (surjective)

All four rows describe how inputs and outputs are paired, so they blur together. Ask which direction you are checking: one output per input (any function), one input per output (one-to-one), or every output used (onto).

One-to-One Mapping

Meaning
Use this when you must check whether a function is reversible, i.e. whether each output comes from a unique input.
Key test
Does every output value come from at most one input?
Formula
f(a)=f(b)  ⟹  a=b
Example
Is f(x)=3x−2 one-to-one?

Many-to-one mapping

Meaning
The opposite: different inputs can share an output, so it has no inverse.
Key test
Use when several inputs legitimately give the same output.
Formula
f(a)=f(b), a≠b
Example
x2 is many-to-one (3 and −3 give 9)

Function (in general)

Meaning
Requires one output per input (vertical line test), a weaker condition.
Key test
Use when only confirming it is a function at all.
Formula
vertical line test
Example
Every one-to-one function is a function, but not vice versa

Onto (surjective)

Meaning
Every codomain value IS hit, a different property about coverage, not uniqueness.
Key test
Use when asking whether outputs fill the whole target set.
Example
A function can be one-to-one without being onto

Formula & Notation

f(a)=f(b)  ⟹  a=b
f ⁣:X→Y is injective   ⟺   ∀ a,b∈X:f(a)=f(b)  ⟹  a=b

How to read it: f(a)=f(b)  ⟹  a=b is the algebraic test for one-to-one (injective). Graphically: horizontal line test.

Worked Examples

Example 1 — Test one-to-one

Easy

Is f(x)=3x−2 one-to-one?
Show the steps and the answer
  1. Suppose two inputs a and b give the same output: 3a−2=3b−2.

    One-to-one means equal outputs can only come from equal inputs, so test that directly.

  2. Add 2 to both sides to get 3a=3b, then divide by 3: a=b.

    Equal outputs forced equal inputs, so no two different inputs can share an output.

  3. Check with numbers: f(1)=1, f(2)=4, f(3)=7, all different.

    Each step to the right raises the output by 3, so the line never returns to an earlier height.

Answer: Yes — it is one-to-one

Takeaway: If f(a)=f(b) forces a=b, the function is one-to-one; every line that is not horizontal passes this test.

Example 2 — Many-to-one, not one-to-one

Standard

Is f(x)=x2 one-to-one over all reals?
Show the steps and the answer
  1. Try the algebra test: a2=b2 allows a=b or a=−b.

    The second possibility lets two different inputs share an output.

  2. Give a concrete pair: f(2)=4 and f(−2)=4.

    One shared output is enough to fail one-to-one.

  3. Draw the horizontal line y=4: it meets the parabola at (−2,4) and (2,4).

    A horizontal line hitting twice is how a graph shows a repeated output.

  4. Note that x2 is still a function, since each input has one square.

    Failing one-to-one does not stop it being a function; it only means it cannot be run backwards uniquely.

Answer: No — it is many-to-one

Takeaway: A parabola fails the horizontal line test, so x2 is many-to-one; keeping only x≥0 would make it one-to-one.

Example 3 — Find the mistake: the wrong line test

Application

Ella checks whether g(x)=(x−3)2 is one-to-one. She writes: "Every vertical line crosses the U-shaped graph once, so g is one-to-one." Find the mistake and correct it.
Show the steps and the answer
  1. Name what Ella's test shows: one crossing per vertical line means each input has one output.

    That proves g is a function, which is a different property.

  2. Use horizontal lines instead: y=1 meets the graph where (x−3)2=1, at x=2 and x=4.

    One-to-one is about outputs, so lines of constant output are the right ones to draw.

  3. Confirm with numbers: g(2)=(−1)2=1 and g(4)=12=1.

    Two different inputs share the output 1, so g is not one-to-one.

Answer: g is a function but not one-to-one: g(2)=g(4)=1, so the horizontal line y=1 crosses the graph twice.

Takeaway: Vertical lines test whether a graph is a function; horizontal lines test whether it is one-to-one.

Where You'll See It

  • Student ID numbers

    A school gives each student a unique ID, such as 20417. Because student → ID is one-to-one, typing an ID into the system brings up exactly one record. If two students shared 20417, a grade could be posted to the wrong student.

  • Number plates and traffic cameras

    Each registered car has its own number plate, so the mapping car → plate is one-to-one. That is what lets a camera read a plate and look up exactly one owner; two cars with the same plate would make the lookup ambiguous.

Common Mistakes

  1. The slip: Confusing one-to-one with being a function

    Instead: a function needs one output per input; one-to-one needs one input per output.

  2. The slip: Using the vertical line test for one-to-one

    Instead: one-to-one is checked by the horizontal line test.

  3. The slip: Calling a function one-to-one when an output repeats

    Instead: any repeated output value breaks it.


Mini Practice

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

  1. Is {(1,5),(2,8),(3,5)} one-to-one?

    Hint: Check whether any output appears more than once.

  2. Is f(x)=x+7 one-to-one? Which input gives the output 12?

    Hint: Can two different inputs plus 7 ever give the same answer?

  3. Is g(x)=∣x∣ one-to-one? If not, give two inputs that share an output.

    Hint: Try a positive input and its negative.

  4. Is h(x)=x2 one-to-one when its domain is only {1,2,3,4}?

    Hint: List all four outputs and look for repeats.

  5. In a vending machine, button A1 gives chips, A2 gives chips and B1 gives a cookie. Is this a one-to-one mapping or a many-to-one function?

    Hint: Does each button give one snack? Do any buttons share a snack?

  6. A student checks y=x2−4 with vertical lines, sees each one hits the graph once, and says it is one-to-one. Find and correct the mistake.

    Hint: Which line test checks for repeated outputs?

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

Is y=x2 one-to-one if I only use positive numbers?

Yes. If the inputs are limited to x≥0x \ge 0, different inputs always give different squares: only 2 gives 4, because −2-2 is no longer allowed. Cutting down the inputs like this is called restricting the domain. The same rule can be one-to-one on one set of inputs and not on another, so always check which inputs the problem allows before you decide.

Can a graph that rises and then falls be one-to-one?

Not if it is drawn in one piece. If an unbroken graph goes up and then comes down, a horizontal line drawn just below the top crosses it twice, once on the way up and once on the way down, so two inputs share that height. A one-to-one graph drawn without lifting your pencil must keep moving in one direction. It may rise slowly in one place and steeply in another, but it cannot turn around.

Is matching people to their thumbprints a one-to-one mapping?

As far as anyone knows, yes, and that is why prints are used as ID. Each person's thumbprint differs from everyone else's, so a print found on a glass points back to one person. Names fail the test: thousands of people share the name Maria Garcia, so a name alone does not identify anyone. Passport numbers and phone numbers are designed to be one-to-one for the same reason.

Why does showing that f(a)=f(b) leads to a=b prove a function is one-to-one?

The statement says: whenever two inputs give the same output, they were the same input all along. That rules out two different inputs sharing an output. For f(x)=5x+1f(x) = 5x + 1, set 5a+1=5b+15a + 1 = 5b + 1, subtract 1 to get 5a=5b5a = 5b, then divide by 5 to get a=ba = b. For x2x^2 the algebra gets stuck: a2=b2a^2 = b^2 only gives a=±ba = \pm b, which allows a=3a = 3 and b=−3b = -3.

Learning Path

← Before

Function
One-to-One Mapping

You are here

You need Function, including the fact that a function is allowed to repeat outputs. One-to-One Mapping adds the stronger rule that outputs never repeat, and the horizontal line test to check it. Next, Inverse Function runs a one-to-one function backwards, and the Horizontal Line Test is studied as a graph tool in its own right.

See Also