Skip to content
NEW Today's quiz is live — 10 questions, 5 minutes. Play now

How many onto functions are there from {1, 2, 3, 4} to itself?

What this question tests: Counting the onto functions from a finite set to itself.

Show the answer

Answer: C. 24

For a finite set mapped to itself, onto means one-one too, so the count is 4! = 24.

Report a problem

Simple explanation

When a function goes from a finite set to a set of the same size, onto and one-one go together: if all 4 outputs must be reached using only 4 inputs, no two inputs can share an output. So every onto function from {1, 2, 3, 4} to itself is simply an arrangement (a permutation) of the 4 elements.
Now count the choices: 1 can go to any of the 4 elements, 2 to any of the 3 still free, 3 to either of the 2 left, and 4 to the last one. That gives 4 × 3 × 2 × 1 = 4! = 24 onto functions.

Why not the other options?

  • A. 4 — 4 is only the size of the set (or the choices for one element), not the number of complete functions.
  • B. 16 — 16 = 4² is the number of ordered pairs in A × A, not the number of onto functions.
  • D. 256 — 256 = 4⁴ counts every function from the set to itself, including those that miss some outputs, so most of them are not onto.

Animated explanation

  1. Onto

    Every element of {1, 2, 3, 4} must be the image of some input.

  2. 4 inputs4 outputs

    Same size on both sides, so onto also means one-one: no output can be shared.

  3. Count the choices

    1. 1 → 4 choices
    2. 2 → 3 choices
    3. 3 → 2 choices
    4. 4 → 1 choice

    Each input takes an output the earlier inputs did not use.

  4. 4! = 24

    4 × 3 × 2 × 1 = 24 onto functions.

Visual concept

  1. Element 14 choices
  2. Element 23 choices
  3. Element 32 choices
  4. Element 41 choice → 4 × 3 × 2 × 1 = 24
Choices for each element

Real-life example

  • Seating 4 friends on 4 chairs, one friend per chair with no chair empty, can be done in 4! = 24 ways — the same count.
  • Giving 4 different prizes to 4 students so that each student gets exactly one prize: 24 ways.

Key points

  • A function from a finite set to itself is onto exactly when it is one-one.
  • The number of one-one onto functions from a set of n elements to itself is n!.
  • All functions from an n-element set to itself number nⁿ; for n = 4 that is 256.
  • For {1, 2, 3, 4}: 4! = 24.

Formula

n! = n × (n − 1) × (n − 2) × … × 2 × 1

nnumber of elements in the set
n!n factorial — the number of onto (one-one) functions from the set to itself

Holds for a finite set mapped to itself, or to any set with the same number of elements.

Solved example

Problem: How many onto functions are there from {a, b, c, d, e} to itself?

  1. The set has n = 5 elements, and a function from a finite set to itself is onto only when it is one-one.
  2. So count the arrangements of the 5 elements: n! = 5!.
  3. 5! = 5 × 4 × 3 × 2 × 1 = 120.

Answer: 120 onto functions

Common mistakes

  • Counting all functions: 4⁴ = 256.

    An onto function must use every output; from 4 elements onto 4 elements only the 4! = 24 arrangements do.

  • Multiplying 4 × 4 = 16 instead of 4 × 3 × 2 × 1.

    Once an output is used it cannot be used again, so the choices drop by one each time.

  • Treating onto and one-one as unrelated for a finite set mapped to itself.

    For a finite set to itself, onto, one-one and bijective all mean the same thing.