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 ={1,2,3,−−−−n}&B={a,b,c} ∴ Number of onto functions =∑r−13(−1)3−r.3Crrn =3C1−3C22n+3C33n =2!1!3!−2!1!3!2n+3!0!3!3n =3−3.2n+3n =3n−3(2n−1)