• Practice
  • About 18 min
  • 5 practice questions

Types of functions: one-one, many-one, onto, into and bijection

Classify a function as one-one or many-one and as onto or into, recognise a bijection, use the horizontal line test, and work with constant, identity and piecewise-defined functions.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Test whether a function is one-one (injection) or many-one, and whether it is onto (surjection) or into.
  • Identify bijections and use the horizontal line test on a graph.
  • Recognise constant, identity and real valued functions and evaluate a function defined in pieces.

Knowing that a rule is a function is only the start. We also want to know whether different inputs always give different outputs, and whether every element of the co-domain is used. These two questions sort functions into types, and a function that passes both tests can be 'undone', which is the basis of secret codes (cryptography).

One-one and many-one

A function f : A → B is one-one (an injection) if distinct elements of A have distinct images in B. Equivalently, f(a₁) = f(a₂) implies a₁ = a₂. A function is many-one if two or more elements of A have the same image; that is, it is not one-one.

Onto and into

A function f : A → B is onto (a surjection) if its range equals its co-domain: every element of B has at least one pre-image. It is into if at least one element of B is not the image of any element of A; then the range is a proper subset of the co-domain.

Bijection

A function that is both one-one and onto is a bijection, also called a one-one correspondence. Each element of A is paired with exactly one element of B and nothing in B is left over, so for finite sets n(A) = n(B).

The four types side by side

  • One-one
    • Distinct inputs, distinct outputs
    • f(a₁) = f(a₂) ⇒ a₁ = a₂
    • Needs n(A) ≤ n(B) for finite sets
  • Many-one
    • Two inputs share an output
    • Not one-one
  • Onto
    • Range = co-domain
    • Every element of B is hit
    • Needs n(A) ≥ n(B) for finite sets
  • Into
    • Range is a proper subset of B
    • Some element of B is missed
A bijection is one-one AND onto.

Worked example 1: f : ℕ → ℕ, f(x) = 2x + 3

Working: one-one test: suppose f(a) = f(b). Then 2a + 3 = 2b + 3, so 2a = 2b and a = b. Hence f is one-one. Onto test: the range is {5, 7, 9, 11, ...}; the natural numbers 1, 2, 3, 4, 6, 8, ... have no pre-image, so f is into. Pre-image of 21: 2x + 3 = 21 gives 2x = 18, x = 9. So f is one-one and into.

Worked example 2: finding B for an onto function

Let A = {−2, −1, 0, 1, 2} and f : A → B be onto with f(x) = x² + 2. Working: f(−2) = 4 + 2 = 6, f(−1) = 1 + 2 = 3, f(0) = 2, f(1) = 3, f(2) = 6. Since f is onto, B is exactly the range: B = {2, 3, 6}. Because f(−1) = f(1) = 3, this f is many-one and onto.

Worked example 3: a bijection on ℝ

Show that f : ℝ → ℝ, f(x) = 5x − 7 is a bijection. Working: one-one: 5a − 7 = 5b − 7 gives a = b. Onto: take any real y and solve 5x − 7 = y to get x = (y + 7)/5, which is a real number with f(x) = y. So every real y has a pre-image. Being one-one and onto, f is a bijection.

The horizontal line test

A function drawn as a graph is one-one if every horizontal line meets the curve in at most one point. The graph of y = x² fails: the line y = 4 meets it at x = 2 and x = −2, so y = x² on ℝ is many-one. The straight line y = 5x − 7 passes.

Special functions

FunctionRuleWhat to remember
Constant functionf(x) = c for every x ∈ ARange has only one element, {c}
Identity function I_Af(x) = x on a set AEvery element is its own image; it is a bijection
Real valued functionf : A → B with f(x) ∈ ℝRange is a subset of ℝ

Worked example 4: a function defined in pieces

Let f(x) = x + 4 when x < −1; f(x) = x² when −1 ≤ x < 2; f(x) = 3x − 1 when x ≥ 2. Find f(−3) + f(5) − f(0). Working: first decide which interval each input lies in. −3 < −1, so f(−3) = −3 + 4 = 1. 5 ≥ 2, so f(5) = 3 × 5 − 1 = 14. 0 lies in −1 ≤ x < 2, so f(0) = 0² = 0. Answer: 1 + 14 − 0 = 15.

One-one: f(a₁) = f(a₂) ⇒ a₁ = a₂. Onto: range = co-domain. Bijection: one-one and onto. Vertical line test checks 'function'; horizontal line test checks 'one-one'.

— Types of functions

Key takeaways: test one-one by assuming f(a) = f(b) and showing a = b, or by finding two inputs with the same output (many-one). Test onto by checking whether every element of the co-domain is an image. A bijection is both. A constant function has a one-element range; the identity function maps each element to itself. For a piecewise function, find the interval first, then use that piece's rule.

Check your understanding

  1. 1. f : {1, 2, 3} → {a, b, c, d} is given by f = {(1, a), (2, c), (3, d)}. Which describes f?

    1. One-one and onto
    2. Many-one and onto
    3. One-one and into
    4. Many-one and into
    Show answer

    Answer: C. Images a, c, d are all different, so f is one-one. The element b of the co-domain has no pre-image, so the range {a, c, d} is a proper subset of the co-domain and f is into.

  2. 2. If n(A) = 4 and n(B) = 3, which of these CANNOT exist from A to B?

    1. An onto function
    2. A one-one function
    3. A many-one function
    4. A constant function
    Show answer

    Answer: B. A one-one function needs 4 different images, but B has only 3 elements, so two elements of A must share an image. Onto, many-one and constant functions are all possible.

  3. 3. The function f : ℤ → ℤ, f(x) = x² is

    1. one-one and onto
    2. one-one and into
    3. many-one and onto
    4. many-one and into
    Show answer

    Answer: D. f(2) = f(−2) = 4, so it is many-one. Negative integers such as −1, and integers that are not perfect squares such as 2, are never outputs, so the range is a proper subset of ℤ and f is into.

  4. 4. For f : ℝ → ℝ, f(x) = 4x − 1, what is the pre-image of 23?

    1. 6
    2. 91
    3. 5.5
    4. 24
    Show answer

    Answer: A. Solve f(x) = 23: 4x − 1 = 23, so 4x = 24 and x = 6. (91 is the image of 23, not its pre-image.)

  5. 5. f(x) = 2x + 1 for x < 0; f(x) = x² − 1 for 0 ≤ x ≤ 3; f(x) = 10 − x for x > 3. What is f(−2) + f(2) + f(5)?

    1. 11
    2. 5
    3. −1
    4. 9
    Show answer

    Answer: B. −2 < 0, so f(−2) = 2(−2) + 1 = −3. 2 is in 0 ≤ x ≤ 3, so f(2) = 4 − 1 = 3. 5 > 3, so f(5) = 10 − 5 = 5. Sum: −3 + 3 + 5 = 5.

Privacy · Terms · Refunds · Delivery