Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works
Create a free account to open Conditional probability and independence. The free chapters of Probability stay readable without one.

Recipe

Test whether a function is one-to-one

Use when: you're given f: A \to B by a formula or an explicit list of pairs and asked whether it's one-to-one (injective)

Goal: either a general derivation showing f(a_1) = f(a_2) forces a_1 = a_2, or one explicit counterexample pair disproving it

Taught in One-to-one functions

  1. 1

    Start by assuming f(a_1) = f(a_2) for two inputs, and see whether that assumption forces a_1 = a_2.

    Example

    For f(x) = 3x - 7: assume f(x_1) = f(x_2), so 3x_1 - 7 = 3x_2 - 7.

    Why: proving the contrapositive form, that equal outputs force equal inputs, is usually easier to work with algebraically than the original statement.

  2. 2

    Attempt to solve the equation from Step 1 for a_1 in terms of a_2, using only reversible operations like adding or dividing by a nonzero number.

    Example

    3x_1 - 7 = 3x_2 - 7: add 7 to both sides, giving 3x_1 = 3x_2, then divide by 3, giving x_1 = x_2. Every step here is reversible.

    • the algebra reduces cleanly to a1 = a2 — the function is one-to-one; write up the steps as the proof.
    • a step is not reversible, such as squaring, or you can already spot a repeated output — switch to hunting for a specific counterexample instead.

    Why: whether the algebra can be reversed determines whether the assumption truly forces the inputs equal, which is exactly what the definition demands.

  3. 3

    Try inputs that are natural candidates for colliding, such as a number and its negative, or two nearby integers, and compute both outputs.

    Example

    For f(n) = n^2: try n = -2 and n = 2. Both give f(-2) = 4 and f(2) = 4, even though -2 \ne 2.

    Why: one pair of distinct inputs with equal outputs disproves the property completely, so there is no need to check any other input.

  4. 4

    Write "one-to-one," backed by the completed derivation, or "not one-to-one," backed by the counterexample pair found.

    Why: the property is a claim about every possible pair of inputs, so the verdict is only trustworthy when it is tied to a general derivation or a specific counterexample.

Common mistakes

  • Testing only a couple of input pairs and calling the function one-to-one without a general derivation.
  • Squaring or taking an absolute value during the algebra, then treating that step as reversible when it isn't.
  • Finding a counterexample but reporting one-to-one anyway because most inputs behaved.
  • Checking that equal inputs give equal outputs (true of every function) instead of the reverse direction the definition actually requires.