Paths that never go below the axis: Catalan numbers
Statement
A path of length starts at height and at each step goes up by or down by . Prove that the number of such paths that end at height and never go below height is
Hint
Count all paths from to , then subtract the bad ones. For a bad path, reflect the part before the first visit to height .
Show solutionHide solution
Solution
Idea. The reflection principle: bad paths are in bijection with paths that are easy to count.
All paths. A path from to with steps has up-steps and down-steps, so there are of them.
Bad paths. A path from to is bad if it reaches height at some moment. Consider the first such moment , and reflect the portion of the path before about the line . The new path starts at , still reaches first at time , and ends at .
Conversely, any path from to with steps must cross ; reflecting the part before the first visit to gives a bad path from to . These operations are inverse, so bad paths are in bijection with all paths from to .
Counting those. A path from to in steps has up-steps and down-steps with and : , . So there are of them.
Conclusion.
The first values are
Remark. The same numbers count well-formed sequences of pairs of brackets and triangulations of a convex -gon.
Lesson. Reflection principle: reflect an initial segment to transform a constrained count into an unconstrained one.