Some grid

The diagram above shows a tiling of 7 squares with A A and B B denoting the initial point and destination point, respectively. The arrow signs indicate the direction that you're able to travel to (east, south, north-east). Find the total number of ways to reach point B B from point A A .


Bonus : Generalize this for n n squares.


The answer is 987.

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.

5 solutions

Arulx Z
Jul 5, 2015

sol sol

Generalization for n n squares (recognized from the pattern) -

f ( n ) = F 2 n + 2 f\left( n \right) ={ F }_{ 2n+2 }

where F n { F }_{ n } is n t h { n }^{ th } number in Fibonacci Series.

Moderator note:

Great image! That's a common first approach to solving these kind of "get from A to B" problems.

I couldn't solve without the clue :D

Thanh Viet - 5 years, 10 months ago

had a calculation mistake...

Ananya Aaniya - 4 years, 10 months ago
Abhisek Panigrahi
Nov 21, 2017

Here's a different approach and different formula.

Suppose you are taking k k diagonal steps, then your path length is n + k + 1 n + k + 1 . The important point to note is each diagonal step must precede exactly 1 down step and succeed exactly 1 down step. Therefore there is total 2 × k + 1 2 \times k + 1 down and diagonal steps.

Let us name the steps as follows

  • R - Right step
  • D - Down step
  • Di - Diagonal step

Suppose we are taking 1 diagonal step, then we can represent this as P D Q Di R D S . Where P , Q , R and S are zero or more right steps.

If we will take k k diagonal steps then the order of down and diagonal steps is always the same. Therefore we just need to find how many ways we can place the diagonal and down steps in n + k + 1 n + k + 1 places. And the remaining empty spaces can be filled by right steps.

\therefore Total number of ways to reach to the lower right corner from the upper left corner in n n square figure = k = 0 n ( n + 1 + k 2 k + 1 ) = \sum_{k = 0}^n {n + 1 + k \choose 2 k + 1}

Wonderful work!

As a bonus: Can you prove that the final sum is always a Fibonacci number?

Pi Han Goh - 3 years, 6 months ago
Laurent Shorts
Apr 5, 2016

To compute quickly the general formula F 2 n + 2 F_{2n+2} , use F k ϕ k 5 F_k\thickapprox\displaystyle \frac{\phi^k}{\sqrt{5}} with ϕ = 1 + 5 2 \phi=\frac{1+\sqrt{5}}{2} .

Here, it gives 3.07 , 8.02 , 21.01 , 3.07, 8.02, 21.01, \cdots and F 2 7 + 2 987.0002 F_{2·7+2}\thickapprox987.0002 .

THANK YOU FOR YOUR SOLUTION!

Pi Han Goh - 5 years, 2 months ago
Michael Biro
May 26, 2015

Define f ( n ) f(n) to be the number of paths from the top-left corner to the bottom-right corner in a grid of n n squares. Note that f ( 0 ) = F 2 = 1 , f ( 1 ) = F 4 = 3 f(0) = F_2 = 1, f(1) = F_4 = 3 , and so we argue that f ( n ) = F 2 n + 2 f(n) = F_{2n+2} , where F n F_n is the n n th Fibonacci number 1 , 1 , 2 , 3 , 1,1,2,3,\dots .

Now, we can see that F 2 n + 2 2 F 2 n = F 2 n 1 = F 2 n F 2 n 2 F_{2n + 2} - 2F_{2n} = F_{2n-1} = F_{2n} - F_{2n-2} , so it is sufficient to show that f ( n ) 2 f ( n 1 ) = f ( n 1 ) f ( n 2 ) f(n)-2f(n-1) = f(n-1) - f(n-2) . So we show that the two sides count the same number of paths.

Both count the paths that avoid the vertex C C to the right of A A . The left-hand side starts with all paths and removes the two subcases that go through C C . The right-hand side is the number of paths starting at C C and moving down in the first step, which is equivalent to the number of paths starting at the vertex below C C , which in turn is equivalent to the number of paths that avoid C C .

A n = F 2 n + 3 A_n=F_{2n+3} , where F n F_n is the n t h n^{th} Fibonacci number in the sequence: ( 0 , 1 , 1 , 2 , 3 , 5 , . . . ) (0,1,1,2,3,5,...)

Moderator note:

Can you elaborate on it? How did you arrive to that conclusion?

I hate myself for inputting 983 .... damn calculation errors !!!

Arian Tashakkor - 6 years ago

@Pi Han Goh Great problem; I didn't initially anticipate Fibonacci popping up, so that was a nice surprise. :)

Just wondering what would happen if we had a second such grid stacked above the first one, and then looked for the number of paths from the upper left corner to the lower right corner. Could be messy, but there is a chance for a nice result such as is the case here.

Brian Charlesworth - 6 years ago

Log in to reply

I'm already working on that a few days ago, I can't spot a pattern here, maybe some programming code would help! ;)

Pi Han Goh - 6 years ago

shouldn't the answer be 2584?

Tan Wei Xin - 6 years ago

Log in to reply

Nevermind I must be drunk. I swore the question said 8 grids

Tan Wei Xin - 6 years ago

Log in to reply

It did; the problem was changed shortly after. (Originally it said 7 squares but the picture had 8 squares, then the modification made the problem incorrect with both saying 8 squares. Now it's the correct one with 7 squares.)

Ivan Koswara - 6 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...