Lattice Path Counter Calculator
Enter the grid width and height to count the monotonic lattice paths.
Result
How it is calculated
A monotonic path from one corner of an m × n grid to the opposite corner takes exactly m steps right and n steps up, in any order. Choosing which m of the m + n steps go right gives paths = C(m+n, m) = (m+n)! ÷ (m! · n!). Here m and n are the number of unit moves (grid cells) along each side, not the number of grid points. The tool multiplies and divides in whole numbers using the smaller of m and n, so the count is exact with every digit shown (250 × 250 gives a 150-digit number), and it also reports the total steps (m + n) and the grid size. Inputs must be non-negative whole numbers and m + n may not exceed 500; decimals, negatives or larger grids give no result.
Worked example
Take a grid that is 4 units wide and 3 units tall, so m = 4 and n = 3. Every path has 4 + 3 = 7 steps, of which 4 are "right". The number of ways to pick those 4 steps is C(7, 4) = 7·6·5·4 ÷ (4·3·2·1) = 840 ÷ 24 = 35. The tool reports 35 paths, over 7 steps on a 4 × 3 grid.
Common mistakes
- Entering the number of grid points (intersections) instead of cells. A grid of 5 × 4 points is a 4 × 3 grid of moves, so enter 4 and 3.
- Typing m + n above 500 or a decimal such as 2.5; the tool shows no result for either rather than approximating.
- Expecting paths that may go left or down. The count covers only right and up moves, so routes that backtrack are not included.
- Using it for grids with blocked cells or a forbidden diagonal; the plain C(m+n, m) formula ignores obstacles.
- Assuming a zero side means no path. With m = 0 or n = 0 there is exactly one straight path.
About this calculator
A monotonic lattice path on an m × n grid is a route from one corner to the opposite corner that only moves right or up (never left or down) along the grid lines. The number of such paths is a classic combinatorics result: since any path consists of exactly m rightward moves and n upward moves in some order, the total count is the binomial coefficient C(m+n, m) — the number of ways to choose which m of the m+n total moves are “right” moves.
This is one of the first non-trivial results taught in combinatorics and discrete mathematics courses, and it connects directly to Pascal's triangle, binomial coefficients, and the reflection principle used to solve more advanced counting problems like paths that must avoid a diagonal (the basis of the Catalan numbers). Computer science students encounter the same structure in dynamic-programming grid problems, where counting lattice paths is a standard warm-up exercise before tackling weighted or obstacle-avoiding path counts.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments