<s>[INST] Find the the number of functions $f:A\to B$ whose domain is $A$ such that if $x_1\geq x_2$ then $f(x_1)\geq f(x_2)\forall x_1,x_2\in A$ Let set $A=\left\{1,2,3,4,5\right\}$ and $B=\left\{-2,-1,0,1,2,3,4,5\right\}$
Find the the number of functions $f:A\to B$ whose domain is $A$ such that if $x_1\geq x_2$ then $f(x_1)\geq f(x_2)\forall x_1,x_2\in A$.

How can i solve it,i learnt a question in which number of strictly increasing functions were to count but now this is different and i could not solve it.Please help me.
 [/INST] Here we have to find number of non-decreasing function from $A = \left\{1,2,3,4,5\right\}$ to
$B=\left\{-2,-1,0,1,2,3,4,5\right\}.$
Means $f(1)\leq f(2)\leq f(3)\leq f(4)\leq f(5).$ 
Where $f(1),f(2),f(3),f(4),f(5)\in \left\{-2,-1,0,1,2,3,4,5\right\}$
Now we will break into Different cases.
$\bullet\; $ If $f(1)<f(2)<f(3)<f(4)<f(5)\;,$ So  we will get $\displaystyle \binom{8}{5}$ ways
$\bullet\; $ If $f(1)=f(2)<f(3)<f(4)<f(5)\;,$ So will get $\displaystyle \binom{8}{4}\times 4$ ways
$\bullet\; $ If $f(1)=f(2)=f(3)<f(4)<f(5)\;,$ So will get $\displaystyle \binom{8}{3}\times 6$ ways
$\bullet\; $ If $f(1)=f(2)=f(3)=f(4)<f(5)\;,$ So will get $\displaystyle \binom{8}{2}\times 4$ ways
$\bullet\; $ If $f(1)=f(2)=f(3)=f(4)=f(5)\;,$ So will get $\displaystyle \binom{8}{1}$ ways
So Total number of ways $\displaystyle = \binom{8}{5}+\binom{8}{4}\times 4 +\binom{8}{3}\times 6+\binom{8}{2}\times 4+\binom{8}{1}$ 
$\displaystyle = \left[\binom{8}{5}+\binom{8}{4}\right]+3\cdot [\binom{8}{4}+\binom{8}{3}]+ 3\cdot \left[\binom{8}{3}+\binom{8}{2}\right]+\left[\binom{8}{2}+\binom{8}{1}\right]$
Now Using $\displaystyle \bullet\; \binom{n}{r}+\binom{n}{r-1} = \binom{n+1}{r}$
So we get $\displaystyle = \binom{9}{5}+3\cdot \left[\binom{9}{4}+\binom{9}{3}\right]+\binom{9}{2} = \binom{12}{5}.$
</s>