
It's the famous Pascal's triangle. Ones on the roof. Each element below is equal to the sum of its two upstairs neighbors. My first attempt to write a program that calculated Pascal's triangle, thirty years ago, failed because I actually tried to reproduce this equilateral picture from books.

When I draw it like this, it becomes way more programming-friendly. We pay for it with left-right symmetry, but in return we get a clear and uniform recurrence relation:
The neighbors now live directly upstairs and upstairs to the left.
The next thing with which I'm not quite comfortable even now is skew transform:. It's because we are talking about the robot who wants to make x steps to the right (x ones) and y steps down (y zeros). There are ways to create the string which consists of x ones and y zeros. Or - because of the symmetry. This way you can see exactly the table from the previous post.

So far, we've seen two faces of binomial coefficients: recurrence and combinatorics. Now we can use them to count paths for the robot. Be careful. In the problem statement and are height and width of the rectangular grid. The numbers of steps in each direction is one smaller: to the right and down. One last step remains: calculate efficiently. Let's do it next time.