Question
Mathematics Question on Functions
Let A=1,2,3,.....,n and B=a,b,c, then the number of functions from A to B that are onto is
A
3n−2n
B
3n−2n−1
C
3(2n−1)
D
3n−3(2n−1)
Answer
3n−3(2n−1)
Explanation
Solution
Number of onto functions: If A & B are two sets having m & n elements respectively such that 1≤ n ≤ m then number of onto functions from A to B is
∑r−1n(−1)n−r.nCrrn
Given A =\left\\{1,2,3,---- n\right\\}\& B=\left\\{a,b,c\right\\}
∴ Number of onto functions
=∑r−13(−1)3−r.3Crrn
= -1^{3-1}^{3} C_{1} 1^{n} + -1^{3-2}^{3}C_{2}2^{n} + ^{3}C_{3} 3^{n}-1 ^ {3-3}
=3C1−3C22n+3C33n
=2!1!3!−2!1!3!2n+3!0!3!3n
=3−3.2n+3n
=3n−3(2n−1)