A combinatorial question: Let $S = \{1,2,3,4\}$ and $X = \{f:S\rightarrow S | x<y \implies f(x)\leq f(y)\}.$ Find $|X|$.

13 Views Asked by At

Let $S = {1,2,3,4}$ and $X = \{f:S\rightarrow S \ | \ x<y \implies f(x)\leq f(y)\}.$ Find $|X|$.

The solution is $\binom{7}{3}$, and the explanation was using stars and bars. I don't see how it could possibly be connected to a stars and bars problem.

Can someone help me with this.