Sunday, January 29, 2012

Problem 15


Problem Statement :Problem15


Starting in the top left corner of a 2×2 grid, there are 6 routes (without backtracking) to the bottom right corner.

How many routes are there through a 20×20 grid?

Algorithm:
  • We need 40 steps to reach to the bottom right corner
  • We have a choice of 2 directions Down and Right
  • Fill any 20 steps with D the remaining will be filled with R
  • The straight of answer is 40C20 ie (40!/(20!*20!))

No comments:

Post a Comment