[Math] How to find the number of the shortest paths between two points on a 3D lattice grid

combinatorics

A similar question has been asked here , but what if we want to find the shortest path between two points in a 3d-space?

Of course we are jut allowed to move along the lattice.

Best Answer

Assuming that you’re talking about lattice paths, say from $\langle 0,0,0\rangle$ to $\langle k,m,n\rangle$ for some non-negative integers $k,m,n$, you want the multinomial coefficient

$$\binom{k+m+n}{k,m,n}=\frac{(k+m+n)!}{k!m!n!}\;.$$

You must take a total of $k+m+n$ steps, $k$ of them in the positive $x$-direction, $m$ of them in the positive $y$-direction, and $n$ of them in the positive $z$-direction. There are $\binom{k+m+n}k$ ways to choose when to take the steps in the $x$-direction, and there are then $\binom{m+n}m$ ways to choose which of the remaining $m+n$ steps are to be in the $y$-direction. Finally,

$$\binom{k+m+n}k\binom{m+n}m=\frac{(k+m+n)!}{k!m!n!}\;.$$