I am trying to solve part B. Here, I am trying to do number of total paths - ways to go through the shop. Which should yield the number of ways to get from A to B without going through the shop. However, I am really confused about how to calculate the number of ways going through the shop. Any pointers would greatly be appreciated.
If you know how to do part (a) for a general case with $n$ rows and $m$ columns, you can use that to solve (b).
- Count the total number of ways to get from home to school.
- Count the number of ways to go from home to the shop.
- Count the number of ways to go from the shop to school.
- Combine the previous two to get the total number of ways to go to the shop and then to school.
- Subtract this last result from the first one.