Solveeit Logo

Question

Mathematics Question on Functions

Let A=1,2,3,.....,nA = \\{1,2,3,....., n\\} and B=a,b,cB = \\{a,b,c\\}, then the number of functions from AA to BB that are onto is

A

3n2n3^n - 2^n

B

3n2n13^n - 2^n -1

C

3(2n1)3 (2^n - 1)

D

3n3(2n1)3^n - 3(2^n - 1)

Answer

3n3(2n1)3^n - 3(2^n - 1)

Explanation

Solution

Number of onto functions: If A & B are two sets having m & n elements respectively such that 1\le n \le m then number of onto functions from A to B is
r1n(1)nr.nCrrn\sum^{^n}_{_{_{r-1}}}\left(-1\right)^{n-r} .^{n}C_{r} r^{n}
Given A =\left\\{1,2,3,---- n\right\\}\& B=\left\\{a,b,c\right\\}
\therefore\quad Number of onto functions
=r13(1)3r.3Crrn=\sum ^{^3}_{_{_{r-1}}}\left(-1\right)^{3-r} .^{3}C_{r} r^{n}
= -1^{3-1}^{3} C_{1} 1^{n} + -1^{3-2}^{3}C_{2}2^{n} + ^{3}C_{3} 3^{n}-1 ^ {3-3}
=3C13C22n+3C33n=^{3}C_{1}-^{3}C_{2} 2^{n}+^{3}C_{3} 3^{n}
=3!2!1!3!2!1!2n+3!3!0!3n=\frac{3!}{2!1!}-\frac{3!}{2!1!} 2^{n} +\frac{3!}{3!0!}3^{n}
=33.2n+3n=3-3.2^{n}+3^{n}
=3n3(2n1)=3^{n}-3\left(2^{n}-1\right)