Cha-cha-cha

A man is standing at the bottom left corner of an 11 × 11 11 \times 11 grid of city streets. He wants to get to the top right corner of the grid while only travelling up and to the right. The man does not want to turn too often along the route, so he will only take a path such that any time he walks up or right, he walks at least two consecutive blocks in that direction. How many different paths can he take to the top right corner if he starts by walking to the right ?

Details and assumptions

There are 11 city streets and hence 10 city blocks.


The answer is 648.

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.

6 solutions

Michael Tang
Oct 28, 2013

The man has to walk 10 10 block-lengths up and 10 10 block-lengths to the right; he has to take a path (right, up, right, up, etc.), where each section is at least 2 2 blocks long, So, we list out the partitions of 10 10 (ways to represent 10 10 as the sum of positive integers) with each part at least 2 , 2, divided up by the number of parts:

  1. 1 1 partition with 1 1 part: 11 x1 \begin{aligned} 11 &\text{ x1} \end{aligned}

  2. 7 7 partitions with 2 2 parts: 2 + 8 x2 , 3 + 7 x2 , 4 + 6 x2 , 5 + 5 x1 \begin{aligned} 2+8 &\text{ x2}, \\ 3+7 &\text{ x2}, \\ 4+6 &\text{ x2}, \\ 5+5 &\text{ x1} \end{aligned}

  3. 15 15 partitions with 3 3 parts: 2 + 2 + 6 x3 , 2 + 3 + 5 x6 , 2 + 4 + 4 x3 , 3 + 3 + 4 x3 \begin{aligned} 2+2+6 &\text{ x3}, \\ 2+3+5 &\text{ x6}, \\ 2+4+4 &\text{ x3}, \\ 3+3+4 &\text{ x3} \end{aligned}

  4. 10 10 partitions with 4 4 parts: 2 + 2 + 2 + 4 x4 , 2 + 2 + 3 + 3 x6 \begin{aligned} 2+2+2+4 &\text{ x4}, \\ 2+2+3+3 &\text{ x6} \end{aligned}

  5. 1 1 partition with 5 5 parts: 2 + 2 + 2 + 2 + 2 x1 \begin{aligned}2+2+2+2+2 &\text{ x1}\end{aligned}

(The multipliers after each partition are to adjust for ordering.)

Since the man starts by going right, the path must have either same number of right-parts as up-parts (for example, right-up-right-up), or 1 1 more right-part than up-parts (for example, right-up-right-up-right). Also, once the number of right-parts and up-parts is determined, any 2 2 partitions with those numbers of parts will work. Using these facts, we list out all possible cases:

  1. 1 1 part right, 1 1 part up - there are 1 × 1 = 1 1 \times 1 = 1 paths.
  2. 2 2 parts right, 1 1 part up - there are 7 × 1 = 7 7 \times 1 = 7 paths.
  3. 2 2 parts right, 2 2 parts up - there are 7 × 7 = 49 7 \times 7 = 49 paths.
  4. 3 3 parts right, 2 2 parts up - there are 15 × 7 = 105 15 \times 7 = 105 paths.
  5. 3 3 parts right, 3 3 parts up - there are 15 × 15 = 225 15 \times 15 = 225 paths.
  6. 4 4 parts right, 3 3 parts up - there are 10 × 15 = 150 10 \times 15 = 150 paths.
  7. 4 4 parts right, 4 4 parts up - there are 10 × 10 = 100 10 \times 10 = 100 paths.
  8. 5 5 parts right, 4 4 parts up - there are 1 × 10 = 10 1 \times 10 = 10 paths.
  9. 5 5 parts right, 5 5 parts up - there are 1 × 1 = 1 1 \times 1 = 1 paths.

Thus, in total, there are 1 + 7 + 49 + 105 + 225 + 150 + 100 + 10 + 1 = 648 1+7+49+105+225+150+100+10+1=\boxed{648} possible paths the man could take. \blacksquare

am I the only one who did exactly this but misunderstood the problem as 11x11 blocks -_- (I used all 3 tries before the clarification came out)

Ryan Soedjak - 7 years, 7 months ago

Log in to reply

If you did that, I think the answer should have been too large for Brilliant's range....

Michael Tang - 7 years, 7 months ago

Log in to reply

Ya, I think so.

Zi Song Yeoh - 7 years, 7 months ago

I did calculated by 11X11 but answer was in thousands.

Mirza Baig - 7 years, 7 months ago

I mean it's not like the wording is ambiguous. Clarification or not, you should know that 11 streets means 10 blocks.

Michael Tong - 7 years, 7 months ago

Log in to reply

Right, it's not ambiguous per se, but I think many people just skimmed the problem and thought the man had to go 11 blocks. (Plus some may not be very fluent in English.)

Michael Tang - 7 years, 7 months ago

Log in to reply

@Michael Tang FTW killed my reading skills.

Ryan Soedjak - 7 years, 7 months ago
Jon Haussmann
Oct 28, 2013

We start with the following result: For positive integers n n and m m , the number of solutions to a 1 + a 2 + + a n = m , a_1 + a_2 + \dots + a_n = m, where each a i a_i is a positive integer that is at least 2, is ( m n 1 n 1 ) \binom{m - n - 1}{n - 1} .

Proof : Let b i = a i 1 b_i = a_i - 1 , so each b i b_i is a positive integer. Then a i = b i + 1 a_i = b_i + 1 . Substituting and simplifying, we get b 1 + b 2 + + b n = m n . b_1 + b_2 + \dots + b_n = m - n. By stars-and-bars, the number of solutions to this equation is ( m n 1 n 1 ) . \binom{m - n - 1}{n - 1}. It is easy to see that every solution in the b i b_i corresponds to a solution in the a i a_i . \blacksquare

We can represent each path as a string of Rs and Us, where each R corresponds to a step to the right, and each U corresponds to a step up. This string will contain 10 Rs and 10 Us. Furthermore, by the specifications in the problem, each "block" of Rs and Us will contain at least two letters. (For example, the string RRRUURRRRRUUUU consists of the four blocks RRR, UU, RRRRR, and UUUU.)

Let r r be the number of blocks of Rs, and let u u be the number of blocks of Us. Since the first step is to the right, and the blocks must alternate between Rs and Us, either r = u r = u or r = u + 1 r = u + 1 .

Consider the case r = u r = u . Each block of Rs must contain at least two Rs, and there are 10 Rs total, so 1 r 5 1 \le r \le 5 . By the result we proved at the start, there are ( 9 r r 1 ) \binom{9 - r}{r - 1} ways to distribute 10 Rs among r r blocks, and since u = r u = r , we have the same number for the Us.

Next, consider the case r = u + 1 r = u + 1 . In this case, 2 r 5 2 \le r \le 5 . Again, there are ( 9 r r 1 ) \binom{9 - r}{r - 1} ways to distribute 10 Rs among r r blocks, and since u = r 1 u = r - 1 , there are ( 9 u u 1 ) = ( 10 r r 2 ) \binom{9 - u}{u - 1} = \binom{10 - r}{r - 2} ways to distribute the Us.

Therefore, the total number of possible paths is r = 1 5 ( 9 r r 1 ) ( 9 r r 1 ) + r = 2 5 ( 9 r r 1 ) ( 10 r r 2 ) = 648. \sum_{r = 1}^5 \binom{9 - r}{r - 1} \binom{9 - r}{r - 1} + \sum_{r = 2}^5 \binom{9 - r}{r - 1} \binom{10 - r}{r - 2} = 648.

There is also a solution using recursion. Let f ( r , u ) f(r,u) denote the number of strings containing r r Rs and u u Us, so that each block contains at least two letters. Then f f satisfies the recursion f ( r , u ) = f ( r 1 , u ) + f ( r , u 1 ) f ( r 1 , u 1 ) + f ( r 2 , u 2 ) f(r,u) = f(r - 1, u) + f(r, u - 1) - f(r - 1, u - 1) + f(r - 2, u - 2) for all r 2 r \ge 2 and u 2 u \ge 2 , except when r = u = 2 r = u = 2 . (I will leave the proof of this as an exercise.)

Here are the first few values of f ( r , u ) f(r,u) :

r \ u 0 1 2 3 4 5 0 1 0 1 1 1 1 1 0 0 0 0 0 0 2 1 0 2 2 3 4 3 1 0 2 2 3 4 4 1 0 3 3 6 9 5 1 0 4 4 9 14 \begin{array}{c|ccccc} r \backslash u & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline 0 & 1 & 0 & 1 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 2 & 1 & 0 & 2 & 2 & 3 & 4 \\ 3 & 1 & 0 & 2 & 2 & 3 & 4 \\ 4 & 1 & 0 & 3 & 3 & 6 & 9 \\ 5 & 1 & 0 & 4 & 4 & 9 & 14 \end{array}

Continuing the table, we find f ( 10 , 10 ) = 1296 f(10,10) = 1296 , so the answer is 1296 / 2 = 648 1296/2 = 648 . (We divide by 2, because in the problem, the first step is to the right.)

Different approach; good use of various mathematical theorems and ideas, instead of usual counting method. Nice one.

Mirza Baig - 7 years, 7 months ago

I also found a recursion. f ( m , n , d ) f(m,n,d) is the number of ways to travel a m n m*n grid going direction d d ( u u : up, r r : right) (except for base cases): f ( m , n , u ) = f ( m 2 , n , r ) + f ( m 1 , n , u ) f(m,n,u)=f(m-2,n,r)+f(m-1,n,u) f ( m , n , r ) = f ( m , n 2 , u ) + f ( m , n 1 , r ) f(m,n,r)=f(m,n-2,u)+f(m,n-1,r) I made a 10x10 grid of doubles of numbers (and got the answer after catching an arithmetic mistake in the middle of the grid the first time :) ).

Daniel Chiu - 7 years, 7 months ago

Log in to reply

I got the same recursion. Here's my approach (probably not the simplest one):
Any path that travels a m × n m \times n grid with it's last step being \uparrow must intersect the right border at some point, say ( m , k ) (m,k) , where 0 k n 2 0 \leq k \leq n-2 . The previous step must be \rightarrow . From our definition, there are f ( m , k , r ) f(m,k,r) ways to reach this. Since k k can be any integer between 0 0 and n 2 n-2 , we obtain f ( m , n , u ) = k = 0 n 2 f ( m , k , r ) f(m,n,u)= \sum \limits_{k=0}^{n-2} f(m,k,r) = k = 0 n 3 f ( m , k , r ) + f ( m , n 2 , r ) = \sum \limits_{k=0}^{n-3} f(m,k,r) + f(m,n-2,r) = f ( m , n 1 , u ) + f ( m , n 2 , r ) = f(m,n-1,u) + f(m,n-2,r) The other recursion can be obtained similarly. I guess I messed somewhere in the arithmetic calculations, and used up all three tries. :(

Sreejato Bhattacharya - 7 years, 7 months ago
Michael Tong
Nov 2, 2013

Simple exhaustion method:

The man can take the paths

2 2 2 2 2 2-2-2-2-2 ,

2 2 2 4 , 2 2 3 3 2-2-2-4, 2-2-3-3 ,

2 2 6 , 2 3 5 , 2 4 4 , 3 3 4 2-2-6, 2-3-5, 2-4-4, 3-3-4 ,

2 8 , 3 7 , 4 6 , 5 5 2-8, 3-7, 4-6, 5-5 ,

10 10 .

With order into account, this makes 1 , 10 , 15 , 7 , 1 1, 10, 15, 7, 1 paths of length 5 , 4 , 3 , 2 , 1 5, 4, 3, 2, 1 , respectively. He starts with the right; if he takes a n n step path in the right direction then he must take either a n n or n 1 n-1 step path in the up direction. Thus, the sum is 1 ( 10 + 1 ) + 10 ( 10 + 15 ) + 15 ( 15 + 7 ) + 7 ( 7 + 1 ) + 1 ( 1 ) = 648 1(10 + 1) + 10(10 + 15) + 15(15 + 7) + 7(7+1) + 1(1) = 648 .

Avi Eisenberg
Oct 31, 2013

So first we note that any path must either have the same number of horizontal and vertical segments, or one more horizontal segment. Each solution will be a pairing of a two partitions of 10 into parts of at least 2. Now let's count the partitions of 10 into parts of at least 2, grouping by number of parts:

1 part: 1

2 parts:7

3 parts:15

4 parts:10

5 parts:1

Now we square each of these and add them to get 1 + 7 7 + 15 15 + 10 10 + 1 = 376 1+7*7+15*15+10*10+1=376 Now we add each times the one after for the case where the number of segments are not equal: 1 7 + 7 15 + 15 10 + 10 1 = 272 1*7+7*15+15*10+10*1=272 . 272+376=648

Mirza Baig
Oct 29, 2013

Each way is made of alternating R (right) and U (up) 's starting with R. For each such way number of R's would decide which partition of 10 we need to use. Same applies for U's.

Example: If we have RURUR as path pattern, then we will use 3 part for R's and 2 part for U's.

Ways to distribute 10 into smaller integers such that each part is greater than or equal to 2 is:

Into 1 part : - 10 10

Into 2 part : - 2 + 8 , 3 + 7 , 4 + 6 , 5 + 5 2+8 \space , \space 3+7 \space , \space 4+6 \space , \space 5+5

Into 3 part : - 2 + 2 + 6 , 2 + 3 + 5 , 2 + 4 + 4 , 3 + 3 + 4 2+2+6 \space , \space 2+3+5 \space , \space 2+4+4 \space , \space 3+3+4

Into 4 part : - 2 + 2 + 2 + 4 , 2 + 2 + 3 + 3 2+2+2+4 \space , \space 2+2+3+3

Into 5 part : - 2 + 2 + 2 + 2 + 2 2+2+2+2+2

Number of ways partitions can be used can be calculated as the number of different permutations of that particular partitions

Example: 2 Part can have 2 permutation each of ( 2 + 8 , 3 + 7 , 4 + 6 ) ( 2+8 \space , \space 3+7 \space , \space 4+6 ) and 1 permutation of 5 + 5 5+5 . Thus total of 7 permutations.

We get,

1 Part = 1 = 1

2 Part = 7 = 7

3 Part = 15 = 15

4 Part = 10 = 10

5 Part = 1 = 1

To get the number of ways any particular pattern can be traveled we simply need to multiply R's part ways to U's part ways, since they are mutually independent.

Example: RURUR can be traveled in ( 3 P a r t ) × ( 2 P a r t ) = 15 × 7 = 105 w a y s (3 Part) \times (2 Part) = 15 \times 7 = 105 \space ways .

Now counting the number of ways the man can travel along particular path pattern:

RU = 1 × 1 = 1 1 \times 1 = 1

RUR = 7 × 1 = 7 7 \times 1 = 7

RURU = 7 × 7 = 49 7 \times 7 = 49

RURUR = 15 × 7 = 105 15 \times 7 = 105

RURURU = 15 × 15 = 225 15 \times 15 = 225

RURURUR = 10 × 15 = 150 10 \times 15 = 150

RURURURU = 10 × 10 = 100 10 \times 10 = 100

RURURURUR = 1 × 10 = 10 1 \times 10 = 10

RURURURURU = 1 × 1 = 1 1 \times 1 = 1

Adding up we get 648 \boxed{648}

Cody Johnson
Nov 3, 2013

Look at the possible partitions of 10 10 using numbers only greater than or equal to 2 2 :

10 , 8 + 2 , 7 + 3 , 6 + 4 , 5 + 5 , 6 + 2 + 2 , 5 + 3 + 2 , 4 + 4 + 2 , 4 + 3 + 3 , 4 + 2 + 2 + 2 , 3 + 3 + 2 + 2 , 2 + 2 + 2 + 2 + 2 10,8+2,7+3,6+4,5+5,\\6+2+2,5+3+2,4+4+2,4+3+3,\\4+2+2+2,3+3+2+2,2+2+2+2+2

But since we also have to consider permutations of these partitions, there is 1 1 partition with length 1 1 , 7 7 with length 2 2 , 15 15 with length 3 3 , 10 10 with length 4 4 , and 1 1 with length 5 5 . A possible path can either have two with the same length or one with length 1 1 less than the other one, so the answer is

1 + 7 ( 7 + 1 ) + 15 ( 15 + 7 ) + 10 ( 10 + 15 ) + 1 ( 1 + 10 ) = 648 1+7(7+1)+15(15+7)+10(10+15)+1(1+10)=\boxed{648}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...