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.
Tap an answer to check.
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
Onto
Every element of {1, 2, 3, 4} must be the image of some input.
4 inputsvs4 outputs
Same size on both sides, so onto also means one-one: no output can be shared.
Count the choices
1 → 4 choices
2 → 3 choices
3 → 2 choices
4 → 1 choice
Each input takes an output the earlier inputs did not use.
4! = 24
4 × 3 × 2 × 1 = 24 onto functions.
🧠 Visual concept
Element 14 choices
Element 23 choices
Element 32 choices
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
n
number 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?
The set has n = 5 elements, and a function from a finite set to itself is onto only when it is one-one.
So count the arrangements of the 5 elements: n! = 5!.
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.