- Foundation
- About 20 min
- 5 practice questions
One-one, onto and bijective functions
Decide whether a function is one-one (injective), onto (surjective) or both (bijective), prove it with the standard tests, and see why the domain and co-domain matter.
If something looks wrong, please tell us.
By the end of this lesson you can
- Use the test f(x₁) = f(x₂) ⇒ x₁ = x₂ to prove a function is one-one, or find two inputs with the same image to show it is many-one.
- Prove a function is onto by solving y = f(x) for x inside the domain, or name a value of the co-domain that is never reached.
- Use the special fact about functions from a finite set to itself.
A function f : X → Y gives each element of the domain X exactly one image in the co-domain Y. The set of images actually produced is the range, and it may be smaller than Y. Two questions now matter: do different inputs always give different outputs, and is every element of Y actually reached? Their answers decide whether f can be undone, which is the topic of Lesson 5.
One-one (injective)
f : X → Y is one-one (injective) if distinct elements of X have distinct images; equivalently, for all x₁, x₂ ∈ X, f(x₁) = f(x₂) implies x₁ = x₂. Otherwise f is many-one: some two different inputs share an image.
Onto (surjective)
f : X → Y is onto (surjective) if every y ∈ Y is the image of at least one x ∈ X. Equivalently, range of f = co-domain Y. To prove onto, take an arbitrary y ∈ Y, solve f(x) = y, and check that the x you get really lies in X.
Bijective
f is bijective (a one-one correspondence) if it is both one-one and onto. Then every element of Y is reached by exactly one element of X.
Three kinds of function
-
One-one
- Different inputs, different outputs
- Test: f(x₁) = f(x₂) ⇒ x₁ = x₂
- Some of Y may be left unreached
-
Onto
- Every element of Y is reached
- Range = co-domain
- Two inputs may share an output
-
Bijective
- Both one-one and onto
- Each y reached by exactly one x
- Exactly the functions that have an inverse
One-one: f(x₁) = f(x₂) ⇒ x₁ = x₂. Onto: for every y in the co-domain there is an x in the domain with f(x) = y. Bijective: both.
Worked examples
Worked example 1. f : R → R, f(x) = 5x − 3. One-one: 5x₁ − 3 = 5x₂ − 3 ⇒ 5x₁ = 5x₂ ⇒ x₁ = x₂. Onto: for any real y, solve 5x − 3 = y to get x = (y + 3)/5, a real number, and f((y + 3)/5) = (y + 3) − 3 = y. So f is bijective.
Worked example 2. f : N → N, f(x) = 3x + 1. One-one: 3x₁ + 1 = 3x₂ + 1 ⇒ x₁ = x₂. Onto? Try y = 2: 3x + 1 = 2 gives x = 1/3, which is not a natural number. So 2 is never reached and f is one-one but not onto. The same formula on R → R would be onto: the co-domain and domain change the answer.
Worked example 3. f : R → R, f(x) = x² + 2. f(1) = 3 = f(−1) with 1 ≠ −1, so f is not one-one. Also x² + 2 ≥ 2 for every real x, so y = 0 (or any y < 2) is never reached: f is not onto.
Worked example 4. g : [0, ∞) → [0, ∞), g(x) = x². One-one: if x₁² = x₂² with x₁, x₂ ≥ 0, then (x₁ − x₂)(x₁ + x₂) = 0; if x₁ + x₂ = 0 both are 0, otherwise x₁ = x₂. Onto: any y ≥ 0 is the image of √y ≥ 0. So g is bijective, although x² on all of R is neither one-one nor onto. Restricting the domain and co-domain fixes both problems.
| Function | One-one? | Onto? | Reason |
|---|---|---|---|
| f : R → R, f(x) = 5x − 3 | Yes | Yes | x = (y + 3)/5 always real |
| f : N → N, f(x) = 3x + 1 | Yes | No | 2 has no natural pre-image |
| f : R → R, f(x) = x² + 2 | No | No | f(1) = f(−1); values below 2 missed |
| g : [0, ∞) → [0, ∞), g(x) = x² | Yes | Yes | √y is the unique pre-image |
| h : Z → Z, h(x) = x + 4 | Yes | Yes | pre-image of y is y − 4 |
Functions from a finite set to itself
If X is a finite set and f : X → X, then f is one-one if and only if f is onto. Reason: if X has n elements and f is one-one, the n images are all different, so they fill all n places of X; if f is onto, all n elements of X are images of n inputs, so no two inputs can share an image. For infinite sets this fails: f : N → N, f(x) = 3x + 1 is one-one but not onto.
Counting functions
If A has m elements and B has n elements: the number of functions A → B is nᵐ (each of the m elements has n choices). The number of one-one functions is n(n − 1)(n − 2)… (m factors), possible only when m ≤ n. The number of bijections from an n-element set to itself is n!. For example, from {1, 2, 3} to {a, b, c, d} there are 4³ = 64 functions, of which 4 × 3 × 2 = 24 are one-one, and none is onto because 3 inputs cannot reach 4 outputs.
Key takeaways: one-one means no two inputs share an output; onto means range equals co-domain; bijective means both. Always state the domain and co-domain, because changing them changes the answer. For a function from a finite set to itself, one-one and onto are the same thing.
Check your understanding
-
1. Which function is one-one but NOT onto?
- f : R → R, f(x) = 2x + 7
- f : N → N, f(x) = x + 2
- f : R → R, f(x) = x²
- f : Z → Z, f(x) = x − 5
Show answer
Answer: B. f(x) = x + 2 on N is one-one (x₁ + 2 = x₂ + 2 ⇒ x₁ = x₂), but 1 and 2 are never reached because x + 2 ≥ 3 for natural x. 2x + 7 on R and x − 5 on Z are bijective; x² on R is not one-one.
-
2. f : R → R is defined by f(x) = 7 − 2x. Which statement is true?
- f is bijective
- f is one-one but not onto
- f is onto but not one-one
- f is neither one-one nor onto
Show answer
Answer: A. 7 − 2x₁ = 7 − 2x₂ ⇒ x₁ = x₂, so f is one-one. For any real y, x = (7 − y)/2 is real and f(x) = 7 − (7 − y) = y, so f is onto. Hence bijective.
-
3. How many one-one functions are there from A = {1, 2} to B = {p, q, r, s}?
- 8
- 16
- 6
- 12
Show answer
Answer: D. The first element has 4 choices of image and the second must take a different one, 3 choices: 4 × 3 = 12. (16 = 4² counts all functions, one-one or not.)
-
4. Assertion (A): Every one-one function f : {1, 2, 3, 4} → {1, 2, 3, 4} is onto.
Reason (R): For a finite set X, a function f : X → X is one-one if and only if it is onto.- Both A and R are true, and R is the correct explanation of A
- Both A and R are true, but R is not the correct explanation of A
- A is true but R is false
- A is false but R is true
Show answer
Answer: A. R is the general fact about finite sets: n distinct images inside an n-element set must fill it. A is the special case with n = 4, so both are true and R explains A.
-
5. f : R → R, f(x) = |x|. Which statement is correct?
- f is one-one and onto
- f is onto but not one-one
- f is neither one-one nor onto
- f is one-one but not onto
Show answer
Answer: C. f(2) = 2 = f(−2), so f is not one-one. |x| ≥ 0, so a negative number such as −1 in the co-domain is never reached; f is not onto.
Sign in to keep track of the lessons you finish.