Question
Question: Let $A=\{1,2,3,4,5\}$ and $B=\{-2,-1,0,1,2,3,4,5\}$. Then which of the following statements is (are)...
Let A={1,2,3,4,5} and B={−2,−1,0,1,2,3,4,5}. Then which of the following statements is (are) true?

The number of increasing functions from A to B is 56
The number of non-decreasing function from A to B is 792
The number of onto functions from A to A such that f(i)=i is equal to 44
The number of onto functions from B to A is 126000
All options are true
Solution
1. Increasing functions from A to B:
A strictly increasing function f:A→B means f(1)<f(2)<⋯<f(5). Such a function is determined by choosing 5 elements in increasing order from the 8 element set B.
No. of functions=(58)=56.2. Non-decreasing functions from A to B:
A non-decreasing function satisfies f(1)≤f(2)≤⋯≤f(5). Using the stars and bars method, the number of ways to choose 5 values out of 8 (with repetition allowed) is given by:
(58+5−1)=(512)=792.3. Onto functions from A to A with f(i)=i:
Onto functions f:A→A are bijections (permutations) on a 5-element set. The condition f(i)=i for all i means we need the number of derangements of 5 elements. The number of derangements of n objects is given by:
!n=n!(1−1!1+2!1−3!1+⋯+(−1)nn!1).For n=5:
!5=120(1−1+21−61+241−1201)=44.4. Onto functions from B to A:
To count onto functions f:B→A with ∣B∣=8 and ∣A∣=5 use the inclusion-exclusion principle:
No. of onto functions=j=0∑5(−1)j(j5)(5−j)8.Calculating term by term:
j=0:j=1:j=2:j=3:j=4:j=5:(05)58=1⋅390625=390625,−(15)48=−5⋅65536=−327680,(25)38=10⋅6561=65610,−(35)28=−10⋅256=−2560,(45)18=5⋅1=5,−(55)08=0.Now summing these:
390625−327680+65610−2560+5=126000.