Walking through houses

Imagine yourself standing at the origin of a grid of streets that divide the city into square blocks of equal size.

You want to reach the point 5 blocks north and 5 blocks east from your current location, and you can (as usual) walk along the streets to the north and east, but you can also walk diagonally through a block (You can make the moves (0,1), (1,0) and (1,1)).

How many ways are there to reach your destination?


The answer is 1683.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Henry U
Feb 9, 2019

These numbers are called Delannoy numbers


If we define D ( n , k ) D(n,k) to be the number of ways through a grid of size n × k n \times k under the given conditions, then we can set up the following recursive formula

D ( n , k ) = D ( n 1 , k ) + D ( n , k 1 ) + D ( n 1 , k 1 ) D(n,k) = D(n-1,k) + D(n,k-1) + D(n-1,k-1)

This is because there are three possibilities for the last move and for each of them the number of ways to do all moves before is given by a previous Delannoy number.

Using this recursion, we can set up a table that gives the number of ways to reach the point ( n , k ) (n,k) . We start with 1's in the first row and column and then use the recursion. Every number is the sum of the number above it, to the left of it and above and to the left of it.

0 1 2 3 4 5 n 0 1 1 1 1 1 1 1 1 3 5 7 9 11 2 1 5 13 25 41 61 3 1 7 25 63 129 231 4 1 9 41 129 321 681 5 1 11 61 231 681 1683 k \begin{array}{ccccccc} & 0 & 1 & 2 & 3 & 4 & 5 & n \\ 0 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 3 & 5 & 7 & 9 & 11 \\ 2 & 1 & 5 & 13 & 25 & 41 & 61 \\ 3 & 1 & 7 & 25 & 63 & 129 & 231 \\ 4 & 1 & 9 & 41 & 129 & 321 & 681 \\ 5 & 1 & 11 & 61 & 231 & 681 & \boxed{1683} \\ k \end{array}

@Henry U Yeah.......these are great right???? Related to these are Schroeder Numbers ..........!!

Aaghaz Mahajan - 2 years, 4 months ago

Log in to reply

That's really cool!!

I actually found them because I thought of this variation of Pascal's triangle and then I noticed what kind of sequences they describe.

Henry U - 2 years, 4 months ago

Log in to reply

Ohhh nice!!! Well, I came to know about this after solving Bertrand's Ballot problem........There, I thought that while doing grid walks, why do we consider them to be up and right only............thus leading me here............!! Its crazy that almost everything has a name linked with it........!!

Aaghaz Mahajan - 2 years, 4 months ago

Log in to reply

@Aaghaz Mahajan And it's also cool how all these problems are connected and can be solved by taking different perspectives! For example, by representing states of a system as a walk in a grid.

Henry U - 2 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...