Counting the Lipschitz-Functions of two Sets

413 Views Asked by At

A function $\{0, …, n\} \rightarrow \mathbb{Z}$ is a Lipschitz function if consecutive values differ by at most $1$, i.e., $|f(i) - f(i-1)| \leq 1$ for all $i = 1, …, n$. Let $L(n)$ be the number of Lipschitz functions $f:\{0,…,n\} \rightarrow \mathbb{Z}$ with $f(0) = f(n) = f(0)$. What is $L(7)$?

1

There are 1 best solutions below

1
On BEST ANSWER

Thinking about the combinatorics (there are three ways to construct a function with $f(0)=f(n)=0$: you can choose $f(n-1)=1$, $f(n-1)=0$ or $f(n-1)=-1$ and then need to consider how many ways there are to connect $f(0)=0$ with each of those) leads to the Pascal-like triangle (just summing THREE numbers every time)

                1
             1  1  1
          1  2  3  2  1
       1  3  6  7  6  3  1
    1  4 10 16 19 16 10  4 1
  1 5 15 30 45 51 45 30 15 5 1

OEIS then tells you a lot about this and also that $L(7)=393$ if you are too lazy to compute it yourself (like me).