I got this math problem online:
A gambler starts with $\$10$ and plays a game for $20$ rounds. At each round, his wealth either increases by $\$1$ or decreases by $\$1$, but the moment his wealth falls below $\$5$, he is not allowed to play anymore. How many wealth sequences are possible in which he ends with the exact same amount $\$10$ after $20$ rounds?
Clearly, the answer has to be below $20$ choose $10$ but I haven't done much combinatorics so I don't know the answer.
Consider the following diagram:
A path from X to Y through non-empty cells, moving up or right, is equivalent to a trajectory the gambler's wealth can take: up means "lose a dollar", right means "win a dollar" and the empty zone at the top-left means the wealth cannot go below $5.
The path must pass through exactly one numbered cell. If that number is 1 to 6, then the path cannot possibly pass through the cut corner and the number of ways from X to Y through that number is a simple product of binomials. Indeed, it is a squared binomial since the graph is symmetric about the numbered axis.
For 7 and 8, look at this inset:
The number of ways to get to $abcde$ are $\binom{5}{0}, \binom{6}{1}, \binom{7}{2}, \binom{8}{3}, \binom{9}{4}=1,6,21,56,126$ respectively. Count the number of ways you can get to 7 and 8 à la Pascal's triangle, adding the numbers below and to the left:
So there are 209 ways to get from X to 7 and 110 ways to get from X to 8. By symmetry, these are also the number of ways to get from 7 or 8 to Y, so the number of paths from X to Y passing through 7 or 8 are the squares of these numbers: $209^2=43681$ and $110^2=12100$ respectively.
We have covered all possible paths, so the answer to the original question is the sum of all the numbers we have calculated: 1 + 100 + 2025 + 14400 + 44100 + 63504 + 43681 + 12100 = 179911 wealth sequences. This is indeed less than $\binom{20}{10}=184756$.