2

Given $A=\{1,2,3..,n\}$, $B=\{1,2,3,..,m\},$$\space \space $while $5<m,n$ $\space$ and $\space \Omega = \{ \space f \mid f: A \rightarrow B\space \}$

How many functions are monotonically increasing in $\Omega$ while $m>n$?

My answer is $m-n+1$.

Basic example is $A=\{1,2,3,4,5\}$ and $B=\{1,2,3,4,5,6\}$. hence: $$f_1(1) = 1, \space \space f_1(2) = 2, \space \space f_1(3) = 3, \space \space f_1(4) = 4, \space \space f_1(5) = 5$$ $$f_2(1) = 2, \space \space f_2(2) = 3, \space \space f_2(3) = 4, \space \space f_2(4) = 5, \space \space f_2(5) = 6$$

So we get 2 functions, and while the diffrence between $m$ and $n$ getting bigger, the result's getting bigger. Am I missing somthing?

Ofek Pintok
  • 351
  • 2
  • 9
  • 1
    You can also have e.g. $f_3(n) = n$ for $1 \le n \le 4$ and $f_3(5) = 6.$ – Dfrtbx Jan 05 '18 at 21:07
  • @Dfrtbx True, there are few more examples such as this one.. So how do I solve this one? – Ofek Pintok Jan 05 '18 at 21:13
  • 1
    Apparently you are only counting *strictly* increasing functions. If so, you should *say* strictly increasing. "Monotonically increasing" is not usually understood to mean "strictly increasing"; usually it's just a verbose synonym for "increasing". – bof Jan 05 '18 at 21:37
  • It can be linked also to the number of injections, since there is only one order among the $n!$ permutations that preserves monotonicity. https://math.stackexchange.com/questions/401616/find-the-number-of-injections-surjections – zwim Jan 05 '18 at 22:54

2 Answers2

4

$${m}\choose{n}$$

Or it is probably easier to think about the answer as ${m}\choose{m-n}$, but that is equal to ${m}\choose{n}$ of course. We can construct all of the functions of $\Omega$ in the following way. Think of $m$ "blanks". So if $m=5$ for example, we have 5 blanks, which I will denote by underscores ( _ ):

_ _ _ _ _

Then if $n=2$ for example, mark out $m-n = 3$ of these blanks with x's. Here's one way to do this:

x _ x x _

Note that this is merely one way to put x's in. There are ${m}\choose{m-n}$ total ways to do it.

Then fill in the remaining blanks with $1,2,\ldots, n$ (in order) until there are no blanks left:

x 1 x x 2

This is the function $f(1) = 2,\ f(2) = 5.$ Every such function can be uniquely constructed in this way. Therefore there are ${m}\choose{m-n}$ such functions.

Dfrtbx
  • 806
  • 3
    Or more directly, just choose which $n$ elements of $B$ are in the image of $f$ and then $f$ is uniquely determined. – Daniel Schepler Jan 05 '18 at 21:46
  • @DanielSchepler That works too! – Dfrtbx Jan 05 '18 at 21:47
  • @Dfrtbx Sorry for the late comment. Let me see if I understood this one correctly.. I have a total of $m$ options (images). now lets look at the first strict increasing monotonic function - $f(1) = 1$, so I could say that I chose $n=1$ for this specific choice. then its clearly that for this specific case, I have $m-n$ options that was not been chosen. In general, the trick is to look at a basic case and assume we got the right answer for every case? – Ofek Pintok Jan 06 '18 at 15:26
  • Sorry, I am not sure I understand what you're saying. I did not make a complete, formal argument. I just did one specific example (constructing one function for $m=5,\ n=2)$ that illustrates the general case. I think this is what you're getting at by saying, "In general, the trick is to look at a basic case and assume we got the right answer for every case?" but I am not sure. – Dfrtbx Jan 08 '18 at 17:46
0

In question, number of monotonically increasing functions from $A$ to $B$ is asked, NOT that of "strictly increasing".

The question can be thought as number of ways of slicing $A$ to $m$ pieces while keeping order of its elements. So we have to make $m-1$ cuts to cut $A$ to $m$ pieces such that if $a$ is in $kth$ slice, $f(a)= k$. Imagine slices as follows:

_ /_ /_ /_ ... / _ 

Here there are $m$ slots (_) and $m-1$ slicers (/). We are after the number of ways to order this slicers and the elements of A. For example suppose $m = 4$ and $A = \{1,2,3\}$ One possible slicing would be:

1,2/ _ /_ / 3

which means: $f(1)=f(2)=1, f(3)=4$

So we have $n$ elements from $A$ and $m-1$ slicers to order. To place all these, now imagine we have $n+m-1$ slots. If we choose $m-1$ slots among these to place the slicers, there will be one way to place elements from $A$, since we must keep the order among them.

So the number of ways to place all n+m-1 slicers and elements of A is ${n+m-1\choose n-1}$