Parameter $k$ (length is $2k$) | |
Initial bitstring | |
Output format | |
100100111100
A Dyck path is a lattice path with no flaws. The Chung-Feller theorem [CF49] asserts that for each fixed number $e$ of flaws, the number of lattice paths of length $2k$ with $e$ flaws is given by the $k$-th Catalan number, independently of the value of $e$. In particular, Dyck paths are counted by the Catalan numbers. The paper by Mütze, Standke and Wiechert [MSW18] provides a new proof of the Chung-Feller theorem. Specifically, it describes a bijection between lattice paths of length $2k$ with $e$ flaws and $e+1$ flaws, with the additional property that the bijection only swaps two steps of the lattice path (an upstep with a downstep). This bijection is illustrated in the following figure for $k=3$, and it operates along the columns. When iterating the bijection from $e=0$ to $e=k$, every step of the lattice path is flipped exactly once, i.e., the bijection maps complementary paths onto each other (compare the first and last row).
flaws | |||||
0 | |||||
1 | |||||
2 | |||||
3 |
The algorithm running on this website implements the bijection described above, and it outputs the lattice paths in the table column by column. In the graphical output, flaws are highlighted in red, and in the textual output, the number of flaws is printed first.