Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
You should make it explicit that you want steps along the lattice. Otherwise, there is one shortest path, the straight segment. – Ross Millikan Feb 9 '13 at 22:19
of course... thank you. – powermetal114 Feb 9 '13 at 22:21
I am not sure, but I think multinomials solve your question. – CBenni Feb 9 '13 at 22:25

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


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,


share|cite|improve this answer
Generally, the answer in n dimension is $$\sum_{i=1}^nk_i\choose k_1,...,k_n$$ then? – CBenni Feb 9 '13 at 22:28
Perfect answer. Thank you! – powermetal114 Feb 9 '13 at 22:29
@powermetal114: You’re welcome! – Brian M. Scott Feb 9 '13 at 22:34
@CBenni: Yes, that’s right. – Brian M. Scott Feb 9 '13 at 22:35
@powermetal114, accept the answer then. – vonbrand Jan 25 '14 at 15:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.