I was doing some math problems in my spare time when I saw this:
Suppose you have a m by n grid, and you start at the lower left corner and go to the upper right corner by moving only up and right. Suppose that m = 30; n = 40 and you cannot travel through the intersections (4,5) and (22,27). How many possible paths are there?
When I started this, I came across this question and I figured that the way to do this would be to take the paths going to (30,40), and then subtracting the paths from: (0,0) to (4,5), (4,5) to (30,40), (0,0) to (22,27), (22,27) to (30,40).
Is this the correct way to approach this problem? Is there a better or more "elegant" way?