0

Number of monotonic functions which are either only increasing or only decreasing from the set {$1,2,3,4,5,6,7$} to itself should be $2* \binom{13}{6}$ , but what about the those functions for which $f(x) \leq x$ for all $x$ or $f(x) \geq x$ for all $x$ ? I think its should be done recursively but i am not getting it properly. My method was checking small cases like 2 numbers it would be $f(1) = 1$ ,$f(2)=2$ , or $f(1)=2$ ,$f(2)= 2$ for case of $f(x) \geq x$.

2 Answers2

2

First, let us deal with the functions $f:\{1,\dots,7\}\to \{1,\dots,7\}$ which are weakly increasing and satisfy $f(x)\le x$. Imagine graphing such in the Cartesian plane, meaning we plot the seven points of the form $(x,f(x))$ for $x\in \{1,\dots,7\}$. All of the points will lie in the right triangle $T$, whose vertices are $(1,1)$, $(7,1)$, and $(7,7)$.

There is another kind of famous combinatorial problem involving the lower half of a square in a rectangular grid. It is well known that the Catalan numbers count the number of lattice paths, where each step is one unit up or one unit to the right, from $(1,1)$ to $(n,n)$, such that the path stays weakly below the line $y=x$. You can find a bijection from the set of such lattice paths from $(1,1)$ to $(7,7)$, to the set of functions $f:\{1,\dots,7\}\to \{1,\dots,7\}$ under the given conditions.

Here is an example of the bijection I had in mind when $7$ is reduced to $3$. I am writing the functions $f:\{1,2,3\}\to \{1,2,3\}$ as a list, $(f(1),f(2),f(3))$.

Paths:

     |       |     _|       |       _|
     |      _|    |      _ _|     _|
_ _ _|  _ _|   _ _|    _|       _|

Functions:

$$ (1,1,1)\quad (1,1,2)\quad(1,1,3)\quad(1,2,2)\quad(1,2,3) $$


Finally, what happens when you change the condition $f(x)\le x$ to the condition $f(x)\ge x$? This time, the graph of $f$ will lie in the triangle $U$ whose vertices are $(1,1)$, $(1,7)$ and $(7,7)$. This is congruent to triangle $T$, and there is a simple bijection taking the graph of a function which fits in $T$ to the graph of a function that fits in $U$; just rotate it $180^\circ$ around the midpoint of the long edge of $T$. You should plot all of the functions for the smaller $\{1,2,3\}$, once for the $f(x)\le x$, once for the $f(x)\ge x$ version, to convince yourself they really are $180^\circ$ rotations of each other. Therefore, the two variants have the same solution.

Mike Earnest
  • 84,902
  • The recursion approach in my answer is very ugly. If there is a cleaner approach that leads to a generally computable value for $T(m,n)$, re my answer, I can't find it. – user2661923 May 06 '22 at 01:29
  • I think you can compute $T(m,n)$ exactly using the reflection principle. Using the idea in this answer you commented on, the functions counted by $T(m,n)$ correspond to lattice paths, and the $f(x)\ge x$ condition can be handled with the reflection principle. If you ask about $T(m,n)$ in a separate question post, I could go into more detail. – Mike Earnest May 06 '22 at 02:07
  • Thanks, for the feedback. What I really wanted to know, I suspect that you have answered, indirectly. I spent several hours looking for creative ways to use Stars and Bars theory &/or Inclusion-Exclusion theory, with some sort of elegance. I came up empty. I infer from your response that neither Stars and Bars nor Inclusion-Exclusion can elegantly conquer this problem. – user2661923 May 06 '22 at 02:21
1

It isn't clear from your posting. I am guessing that you want to know either

  • Q1: What is the formula for the number of functions under the 2nd constraint.
  • Q2: Why is the enumeration of functions different under the two constraints?

Easiest to stretch intuition by using the example of $S = \{1,2,3,4,5,6,7\}.$

Q1: Assume $f(x) \geq x.$

You have $7$ choices for $f(1)$, $6$ choices for $f(2), \cdots.$
So, the enumeration is $(7!)$.

Edit
Per OP's (i.e. original poster's) clarification, the above interpretation is wrong. In Q1, the OP is asking how many non-decreasing functions also satisfy the added constraint that $f(k) \geq k ~: ~k \in \{1,2,\cdots,7\}.$

I am going to use recursion to solve this. There may well be a more elegant approach, such as with Stars and Bars theory, or Inclusion-Exclusion. However, if there is, I couldn't find it.

Also, I will provide a partial solution only, as the Math gets extremely messy. I will then outline the general procedure for solving the general problem.


First, I will need formulas for $~\displaystyle \sum_{i=1}^n i^r ~: r \in \{1,2,3,4,5,6,7\}.$
Using Faulhaber's formula, I have the following chart:

$\displaystyle \sum_{i=1}^n i^1 = \frac{n(n+1)}{2}.$

$\displaystyle \sum_{i=1}^n i^2 = \frac{(n)(n+1)(2n+1)}{6}.$

$\displaystyle \sum_{i=1}^n i^3 = \left[\frac{n(n+1)}{2}\right]^2.$

$\displaystyle \sum_{i=1}^n i^4 = \frac{1}{30}(n)(n+1)(2n+1)(3n^2 + 3n - 1).$

$\displaystyle \sum_{i=1}^n i^5 = \frac{1}{12}(n)^2(n+1)^2(2n^2 + 2n - 1).$

$\displaystyle \sum_{i=1}^n i^6 = \frac{1}{42}(n)(n+1)(2n+1)(3n^4 + 6n^3 - 3n + 1).$

$\displaystyle \sum_{i=1}^n i^7 = \frac{1}{24}(n)^2(n+1)^2(3n^4 + 6n^3 - n^2 - 4n + 2).$


Let $S_k$ denote the set $\{1,2,\cdots,k\}$.
Let $T(m,n)$ denote the number of functions $f(k)$, from $S_m$ to $S_n$ such that:

  • $f(k)$ is a non-decreasing function.
  • For all $k \in S_m, f(k) \geq k.$

So, the goal will be to compute $T(m,n),$ for any positive integers $m$ and $n$. I will demonstrate the approach for $m \in \{1,2,3\}$, and then provide the general method for recursively computing $T(m,n).$


$\underline{\text{Computation of }T(1,n)}$
Since there are $n$ choices for $f(1)$.

$$T(1,n) = n.$$


$\underline{\text{Computation of }T(2,n)}$

When computing $T(2,n)$, I will let $a = f(1)$ run from $1$ through $(n)$. Since $f(2)$ must be $\geq 2$, I split this into two summations:

$\displaystyle T(2,n) = \sum_{a=1}^1 T(1,n-1) + \sum_{a=2}^{n}T(1,n+1-a).$

Then,
$~\displaystyle T(2,n) = (n-1) + \sum_{a=2}^n (n+1-a)$
$\displaystyle =~ (-1) + \sum_{a=1}^n (n+1 - a)$
$\displaystyle =~ (-1) + n(n+1) - \frac{n(n+1)}{2} .$

$$T_2 = \frac{n^2 + n - 2}{2} = \frac{(n+2)(n-1)}{2}.$$


$\underline{\text{Computation of }T(3,n)}$

Similarly, when computing $T(3,n)$, I will let $a = f(1)$ run from $1$ through $(n)$. Since $f(2)$ must be $\geq 2$, I split this into two summations:

$\displaystyle T(3,n) = \sum_{a=1}^1 T(2,n-1) + \sum_{a=2}^{n}T(2,n+1-a).$

Then,
$~\displaystyle T(3,n) = [T(2,n-1) - T(2,n)] + \sum_{a=1}^n T(2,n+1-a)$

$\displaystyle =~ \left[\frac{(n+1)(n-2)}{2} - \frac{(n+2)(n-1)}{2}\right]$

$\displaystyle + ~\sum_{a=1}^n \frac{(n+3-a)(n-a)}{2}$

$\displaystyle =~ -n + \sum_{a=1}^n \frac{(n+3)(n)}{2}$

$\displaystyle +~ \sum_{a=1}^n \frac{(-a)(2n+3) + a^2}{2}$

$\displaystyle = ~-(n) + \frac{n^2(n+3)}{2} $

$\displaystyle ~- \frac{(2n+3)(n)(n+1)}{4} + \frac{n(n+1)(2n+1)}{12}.$

As you can see, you have an extremely messy 3rd degree polynomial in $(n)$.


$\underline{\text{Computation of }T(m,n) ~: m > 3}$

When computing $T(m,n)$, I will let $a = f(1)$ run from $1$ through $(n)$. Since $f(2)$ must be $\geq 2$, I split this into two summations:

$\displaystyle T(m,n) = \sum_{a=1}^1 T(m-1,n-1) + \sum_{a=2}^{n}T(m-1,n+1-a).$

Then,
$~\displaystyle T(m,n) = [T(m-1,n-1) - T(m-1,n)] $

$\displaystyle + ~\sum_{a=1}^n T(m-1,n+1-a).$


Q2: Assume $g(x)$ is non-decreasing.
I am unsure how you computed $~\displaystyle \binom{13}{6}.$

For me, this is a Stars and Bars problem, which is discussed here and here.

Let
$x_1 = f(1).$
$x_2 = f(2) - f(1).$
$\cdots$
$x_7 = f(7) - f(6).$
$x_8 = 7 - f(7)$.

Then, there is a bijection between the set of non-decreasing functions $g(x)$ and the set of solutions to

  • $x_1 + x_2 + \cdots + x_8 = 7$.
  • Where $x_1, \cdots, x_8$ are all non-negative integers.
  • Where $x_1 \geq 1.$

Setting $y_1 = x_1 - 1$,
the above set of solutions bijects to the set of non-negative integer solutions to
$\displaystyle y_1 + x_2 + \cdots + x_8 = 6 ~: ~\binom{6 + [8-1]}{8-1} ~:$ solutions.


To complete Q2, the intuitive difference between the enumerations in Q1 and Q2 is that in Q1, you always have $(8-k)$ choices for $f(k)$, regardless of the previous values of $f(1), f(2), \cdots, f(k-1)$.

In Q2, the number of possible values available to $g(k)$ is based on the choice taken for $g(k-1)$, and the number of possible values available to $g(k-1)$ is based on the choice taken for $g(k-2)$, and so on.

user2661923
  • 42,303
  • 3
  • 21
  • 46
  • For no of non decreasing functions why is this not correct Sir ? : As we have 7 elements which we need to give the codomain elements , let x1 denotes the number of times the element 1 from the codomain is taken for correpondence to domain elements , so we have x1+x2+...+x7 = 7 , we need to find no. Of nonnegative solutions which is 13C6 , which i think agrees with the 3 to 3 case where i am getting 10 total cases , and also i checked it with writing down all possible combinations . Why this gives a different from your answer of 13C7 Sir ?(automatically the elements we choose are given a order) – ProblemDestroyer May 05 '22 at 18:54
  • 2
    I explained why the number of nondecreasing functions $f: {1, 2, 3, \ldots, m} \to {1, 2, 3, \ldots, n}$ is the number of nonnegative integer solutions to the equation $x_1 + x_2 + x_3 + \cdots + x_m = n$ in this answer. – N. F. Taussig May 05 '22 at 19:53
  • 1
    @N.F.Taussig As usual, although my approach is valid, yours is more elegant. – user2661923 May 05 '22 at 20:45
  • 1
    @ProblemDestroyer Since $~\displaystyle \binom{13}{7} = \binom{13}{6}~$ our two answers agree. After reading N.F.Taussig's answer, I now understand the (valid) approach that you are taking. Beyond that, for your future MathSE postings, you might consider that I had trouble following your analysis, but was able to understand N.F.Taussig's answer. Your analysis was saying much the same thing, I simply had trouble visualizing why it was true. – user2661923 May 05 '22 at 20:50
  • Understood Sir thanks a lot , also though the f(x) >= x was with the condition of monotonic nature . So i think its not equal to 7! – ProblemDestroyer May 05 '22 at 20:54
  • @ProblemDestroyer Okay, I will need a few minutes to edit my answer. Going forward, for your future MathSE postings, please proofread your postings to remove any possibility of confusion/ambiguity in what you are asking. You don't want the MathSE reviewer to be forced to try to hit a moving target. – user2661923 May 05 '22 at 20:56
  • Oh yeah definitely i will keep that in mind Sir :) – ProblemDestroyer May 05 '22 at 21:14
  • @N.F.Taussig The recursion approach in my answer is very ugly. If there is a cleaner approach that leads to a generally computable value for $T(m,n)$, re my answer, I can't find it. – user2661923 May 06 '22 at 01:29
  • @ProblemDestroyer See the comment above, posted to N.F.Taussig. – user2661923 May 06 '22 at 01:30
  • Its okay Sir i have got a approach from your and Mike Earnest so i think thats sufficient , i was not looking for a very elegant method first of all :) – ProblemDestroyer May 06 '22 at 06:37