How many functions are there from a set A to a set B? A function must assign to each element of A exactly one element of B — no input left out, no input given two outputs. Counting them is a clean application of the multiplication principle.
All functions
Go through the elements of A one at a time. The first element can be sent to any of the ∣B∣ elements of B; so can the second, and every element after it — each choice is independent. If ∣A∣=m and ∣B∣=n, the total number of functions is
m timesn×n×⋯×n=nm=∣B∣∣A∣.
Example. With A={1,2,3} and ∣B∣=4, there are 43=64 functions from A to B.
Watch out
This is different from the number of relations, which is 2∣A∣×∣B∣. A relation may pair an input with zero, one, or many outputs; a function must pick exactly one — hence nm, not 2mn.
One-one (injective) functions
For a one-one function no two inputs may share an output, so once an image is used it's gone. This needs m≤n. The first input has n choices, the second n−1, the third n−2, and so on:
n(n−1)(n−2)⋯(n−m+1)=(n−m)!n!=nPm.
Example. One-one functions from a 2-element set to a 4-element set: 4P2=4×3=12. …
A function that is both one-one and onto (a bijection) can only exist between two sets that have exactly the same number of elements, which immediately …
Same / Similar Concept — real previous-year questions on the same or a closely similar concept, not this exact question.
CBSE 2025Set E1 markMCQ
Q.Let A={1,2,3,…,n}. How many bijective functions f:A→A can be defined?
(a) n
(b) ⌊n
(c) 21⌊n
(d) ⌊(n−1)
›Reveal solutionSolution
Bijections of an n-set onto itself are permutations, so there are n! of them.
A bijective function f:A→A with ∣A∣=n is just a permutation of the n elements. The first element has n choices of image, the next n−1, and so on, giving