How to use this calculator
Count shortest paths on an open rectangular grid when each move goes one step right or one step up.
- Enter Grid width (steps right), Grid height (steps up). Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How Grid shortest-path count calculator works
Count shortest paths on an open rectangular grid when each move goes one step right or one step up.
Inputs and units
- Grid width (steps right): Number of rightward grid steps; a whole number at least zero.
- Grid height (steps up): Number of upward grid steps; a whole number at least zero.
Formula and method
(w+h)!/(w!h!) = C(w+h,w)
Worked example
A 3-by-2 grid needs three right moves and two up moves, giving C(5,2)=10 shortest paths.
Interpreting the result
The count is the number of distinct orderings of the required horizontal and vertical moves.
Assumptions and limits
This assumes every grid edge is available and all moves are monotone right/up. Obstacles, diagonal moves, or weighted edges change the problem.
Sources and method
- The nCr and nPr formulas distinguish unordered selections from ordered arrangements. OpenStax counting equations
Frequently asked questions
Why are paths with the same moves counted separately?
Different orders of the right and up steps trace different routes even though their lengths match.
Does this include blocked cells?
No. The formula counts an open rectangular grid only; blocked cells require a path-count recurrence.
How do I use the Grid shortest-path count calculator?
Enter Grid width (steps right), Grid height (steps up). Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Grid shortest-path count?
A 3-by-2 grid needs three right moves and two up moves, giving C(5,2)=10 shortest paths.
What does the Grid shortest-path count calculator calculate?
Count shortest paths on an open rectangular grid when each move goes one step right or one step up.