4

I have another counting functions question! My solution is as follows, but I am not 100% sure if I am correct.

Q: I have a function $f$ which maps from $\{1,2,3,4,5,6\}$ to $\{1,2,3\}$. I want to count how many functions $f$ such that for all $i,j \in \{1,2,3,4,5,6\}$, if $ i \leq j $, then $f(i) \leq f(j)$.

My solution:

There are 3 cases:

Case 1: The case that $f(6)$ is 3. Then there are 3 options (namely 1,2 or 3) each for $f(5), f(4), ... f(1)$ so in total $3^5 = 243 $

Case 2: The case that $f(6)$ is 2. Then there are 2 options (namely 2 or 1) for $f(5), f(4), ... f(1)$ so then in total $ 2^5 = 32 $

Case 3 : The case that $f(6) $ is 1. Then $f(5), f(4), ... f(1)$ have 1 choice ( namely 1 ) so 1 such function.

So in total we have 276 such functions.

Am I correct - I have an exam tomorrow so would be very much appreciated if someone could answer :)

N. F. Taussig
  • 79,074
Sophie
  • 81
  • 3

1 Answers1

3

Hint:

It is the same as puting two bars between the numbers in the domain, say like $$1\;\; 2\;\;|\;\;3\;\;4\;\;5\;\;|\;\;6$$ Does that help? You probably know the stars and bars method?


Edit:

Ok, say we have this expression with stars and bars $$*\;\; *\;\;|\;\;*\;\;*\;\;*\;\;|\;\;*$$ What does that mean? It means that $1,2$ goes to $1$, $3,4,5$ goes to $2$ and $6$ goes to $3$.

Another one $$*\;\; *\;\;*\;\;*\;\;|\;\;|*\;\;*$$ This one means: $1,2,3,4$ goes to $1$, no one goes to $2$ and $5,6$ goes to $3$.

We can do this also vice versa. Say $1$ gose to $1$, 2 goes to $2$ and all other gose to $3$. How would you express this with stars and bars? The answer is: $$*\;|\;*\;|\;*\;\;*\;\;*\;\;*$$

So this process is reversible and the answer is the same as number of permutation with 2 elements where one element apear 2 times and second 6 times. So the answer is: ?

nonuser
  • 91,557
  • 1
    To add to Aqua's answer, the above arrangement would correspond to the mapping $f(1)=f(2)=1$, $f(3)=f(4)=f(5)=2$, $f(6)=3$. –  Dec 08 '19 at 20:06
  • Sorry - I am still quite confused. Would you be able to explain in depth if possible? Thanks – Sophie Dec 08 '19 at 20:25
  • Is now better? If yes, then please accept the answer. – nonuser Dec 08 '19 at 20:48