The number of onto functions from a set with 5 elements to a set with 3 elements is
Answer: (B) 150 Status: Verified (T1). Checked by code and independent solves on 2026-11-20.
- 243
- 150
- 60
- 120
Solution
- All functions: 3⁵ = 243.
- Functions missing at least one image: 3 x 2⁵ - 3 x 1⁵ + 0 = 96 - 3 = 93 (inclusion-exclusion).
- Onto functions = 243 - 93 = 150.
Fast method
Onto functions = 3! x S(5,3) = 6 x 25 = 150, where S(5,3) = 25 counts the ways to split 5 items into 3 non-empty groups.
Expected time: about 130 seconds. Difficulty: medium.
Topic page: Functions: one-one, onto and composition