Problem 1483. Number of paths on a grid

Consider a grid formed by n vertices vertically down, and m vertices horizontally right. Your starting point is at the top left vertex. Your destination is the bottom right vertex. You are permitted at each vertex to choose to move down or right, that is in the direction towards the destination. You are not to move on what constitutes a back step like moving left or up. If you hit the bottom boundary, or right boundary take it to be given there is only 1 way to the destination, that is following along the boundary.

Ex: in a 2x2 grid there are two ways. One way: First down, then right. The other way: First right, then down.

4x3 has 10 ways

6x5 has 126 ways

This problem can be solved using dynamic programming but there are other methods too.

Problem 7) Prev: 1482 Next: 1484

Solution Stats

62.26% Correct | 37.74% Incorrect
Last solution submitted on Mar 21, 2016

Problem Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more