I have a question that requires me to find the number of non decreasing functions $f: A \longrightarrow B$ where $A=\{1,2,3,4,5\}$ and $B = \{-2,-1,0,1,2,3,4,5\}$
I tried doing this by finding the Total number of functions, which according to me is $8^5$. Then, I found the number of decreasing functions to be ${8 \choose 5}$ and there is only one way to order each of those combinations so number of decreasing functions is ${8 \choose 5}$. Correct me if I'm wrong here.
But here's why I don't get the next part, the answer for the number of non decreasing functions isn't $8^5- {8 \choose 5}$
- I don't get why this is, shouldn't the total number of functions $-$ number of decreasing functions $=$ number of non-decreasing functions? I need a few counter examples to convince me otherwise and I can't seem to be able to come up with one, any help on this/visualizing it would be appreciated.
- The number of decreasing functions I found to be ${8 \choose 5}$, which isn't asked in the question, just something that I calculated. However, the question also does ask for the number of increasing functions $f:A\longrightarrow B$, and that answer is stated as ${8 \choose 5}$, which makes me question whether my number of decreasing functions is valid. A confirmation here would be highly appreciated too.
Thanks in advance! (I know that there is a similar question from 2015, but since I had some trouble understanding the answers, and also had further questions of my own, I decided to repost rather than posting on a ~6 year old thread)
Here's the link to the old question: Number of non-decreasing functions?