Skip to content
Miscellaneous Exercise · Q4

Q.Find the number of all onto functions from the set {1,2,3,...,n}\{1, 2, 3, ..., n\} to itself.

Puducherry CbseNCERTSubjective· 2mImportance★★★★★est
56% · 58/104 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

For a finite set, an onto self-map is automatically a bijection, i.e. a permutation, so the number of onto functions from {1,2,…,n}\{1,2,\dots,n\} to itself is n!n!.

The key observation

Let S={1,2,…,n}S=\{1,2,\dots,n\} and let f:S→Sf:S\to S be onto. "Onto" means every one of the nn elements of SS is an output of ff. But ff has only nn inputs to produce those nn distinct outputs. If two different inputs mapped to the same value, then ff would produce at most n−1n-1 distinct outputs and could not cover all nn targets. So the outputs must all be distinct — ff is also one-one.

A map that is both one-one and onto is a bijection, and a bijection from a set to itself is exactly a rearrangement (permutation) of its elements.

Counting the permutations

Building a permutation, assign images one element at a time:

  • f(1)f(1) can be any of the nn elements — nn choices.
  • f(2)f(2) must differ from f(1)f(1) — n−1n-1 choices.
  • f(3)f(3) must differ from both — n−2n-2 choices. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.