Let $n \ge 2$ be a positive integer and $\mathcal{F}$ the set of functions $f:\{1,2,\ldots,n\} \to \{1,2,\ldots,n\}$ that satisfy $f(k) \le f(k+1) \le f(k)+1,$ for all $k \in \{1,2,\ldots,n-1\}.$ a) Find the cardinal of the set $\mathcal{F}.$ b) Find the total number of fixed points of the functions in $\mathcal{F}.$
Problem
Source: Romanian National Olympiad 2024 - Grade 10 - Problem 3
Tags: function, combinatorics