Originally Posted by **rgep**

Try breaking it down like this. The number $\displaystyle N(A,E;B)$ of lattice paths from A to E avoiding B is the number $\displaystyle N(A,E)$ of all paths from A to E minus the number of paths from A to E that go via B: and this is the number $\displaystyle N(A,B)$ from A to B times the number $\displaystyle N(B,E)$ from B to E.

You need to generalise this using *inclusion-exclusion*. You get N(A,E;B,C) = N(A,E) - N(A,B)N(B,E) - N(A,C)N(C,E) + N(A,B)N(B,C)N(C,E) since otherwise the last term would have been counted in twice.