Daily

Random

Practice set

Baltic Way 2019 · Problem 9

Combinatorics

For a positive integer nn, consider all nonincreasing functions f:{1,…,n}→{1,…,n}f:\{1,\ldots,n\}\to\{1,\ldots,n\}. Some of them have a fixed point (i.e. a cc such that f(c)=cf(c)=c), some do not. Determine the difference between the sizes of the two sets of functions.

Remark. A function ff is nonincreasing if f(x)≥f(y)f(x)\ge f(y) holds for all x≤yx\le y.

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Counting and enumeration · Induction and recursion

Solutions

Solution

Lemma. Let AA be a set of aa consecutive integers and let BB be a set of bb consecutive integers. There are exactly (a+b−1a)\binom{a+b-1}{a} nonincreasing functions f:A→Bf: A \to B. Proof. Let (wlog) A={1,…,a}A = \{1, \dots, a\}, B={1,…,b}B = \{1, \dots, b\}. A function f:A→Bf: A \to B is nonincreasing if and only if the function g:A→C={1,…,a+b−1}g: A \to C = \{1, \dots, a+b-1\} given by g(x)=f(x)+(a−x)g(x) = f(x) + (a-x) is strictly decreasing. Any such function gg is uniquely identified with the set of its values g(A)g(A); and the latter has size aa. So there are as many functions ff in question as there are aa-element subsets of CC; the lemma is ready.

Now we count the functions of the two types under consideration. A function ff that has a fixed-point c∈{1,…,n}c \in \{1, \dots, n\} maps {1,…,c−1}\{1, \dots, c-1\} (nonincreasingly) into {c,…,n}\{c, \dots, n\}, and it maps {c+1,…,n}\{c+1, \dots, n\} (nonincreasingly) into {1,…,c}\{1, \dots, c\}; and there are no further restrictions. So, on the left side of cc, we have (by the lemma with a=c−1,b=n−c+1a=c-1, b=n-c+1) (n−1c−1)\binom{n-1}{c-1} choices; and right to cc (again by the lemma, with a=n−c,b=ca=n-c, b=c) we have also (n−1c−1)\binom{n-1}{c-1} choices. The number of nonincreasing functions with a fixed-point is therefore equal to

Fn=∑c=1n(n−1c−1)(n−1c−1).F_n = \sum_{c=1}^{n} \binom{n-1}{c-1} \binom{n-1}{c-1}.

If ff has no fixed-point then there exists c∈{1,…,n−1}c \in \{1, \dots, n-1\} such that f(x)>xf(x) > x for x≤cx \le c and f(x)<xf(x) < x for x>cx > c. A similar reasoning applies: ff maps {1,…,c}\{1, \dots, c\} into {c+1,…,n}\{c+1, \dots, n\} and it maps {c+1,…,n}\{c+1, \dots, n\} into {1,…,c}\{1, \dots, c\} (arbitrarily nonincreasingly). On the left piece (lemma with a=c,b=n−ca=c, b=n-c) there are (n−1c)\binom{n-1}{c} choices; on the right piece (lemma, a=n−c,b=ca=n-c, b=c) (n−1c−1)\binom{n-1}{c-1} choices. So the number of nonincreasing functions without a fixed-point equals

Gn=∑c=1n−1(n−1c)(n−1c−1).G_n = \sum_{c=1}^{n-1} \binom{n-1}{c} \binom{n-1}{c-1}.

Consider the polynomial Pn(x)=(1+x)n−1P_n(x) = (1+x)^{n-1}. We recognize FnF_n and GnG_n as the coefficients of xn−1x^{n-1} and xnx^n in the product Pn(x)Pn(x)=(1+x)2n−2P_n(x)P_n(x) = (1+x)^{2n-2}. Thus Fn=(2n−2n−1)F_n = \binom{2n-2}{n-1} and Gn=(2n−2n)G_n = \binom{2n-2}{n}, with the difference Fn−Gn=(2n−2n−1)−(2n−2n)F_n - G_n = \binom{2n-2}{n-1} - \binom{2n-2}{n}. (This gets us another characterization of Catalan numbers.)

Contest context

Results from Baltic Way 2019

11 teams

Mean score
3.1 / 5
Scores of 4 or 5
7 / 11
Estonia
5 / 5

Score distribution

04
10
20
30
41
56
All team scores
TeamScore
St. Petersburg5 / 5
Poland5 / 5
Estonia5 / 5
Lithuania5 / 5
Germany5 / 5
Norway0 / 5
Finland5 / 5
Denmark0 / 5
Sweden4 / 5
Latvia0 / 5
Iceland0 / 5