A cat walk

Today Hakase will be taking Sakamoto-san for a walk (that's a cat). Unfortunately, they ended in town district that is notorious for dogs.

The district has 18 streets, 9 vertical, 9 horizontal ( image above ). If intersections marked with the triangle are "dog spots" (places where a person will definetely encounter a dog ), on how many ways Hakase and Sakamoto-san can arive safely to the finish point.

Hints: Assume that they will only go up and right .


The answer is 11468.

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.

2 solutions

Zk Lin
Feb 29, 2016

Without restriction, there are ( 18 9 ) = 48620 \left( \begin{matrix} 18 \\ 9 \end{matrix} \right)=48620 ways of walking Sakamoto-san.

Denote as A A the upper left dog spot, as B B the upper right dog spot, as C C the lower left dog spot, and as D D the lower right dog spot.

We will use the Principle of Inclusion-Exclusion to enumerate the number of routes passing through the dog spot(s) before taking the complement of it.

Let N ( X ) N(X) denotes the number of ways to complete the route walking through dog spot X X , while N ( X Y ) N(X \cap Y) denotes the number of ways to complete the route walking through both dog spots X X and Y Y , with X , Y { A , B , C , D } X,Y \in \{A,B,C,D\} .

In other words, we are trying to evaluate N ( A B C D ) = N ( A ) + N ( B ) + N ( C ) + N ( D ) N ( A B ) N ( A C ) N ( A D ) N ( B C ) N ( B D ) N ( C D ) + N ( A B C ) + N ( A B D ) + N ( A C D ) + N ( B C D ) N ( A B C D ) N(A \cup B \cup C \cup D)= N(A)+N(B)+N(C)+N(D)-N(A \cap B)-N(A \cap C)-N(A \cap D)-N(B \cap C)-N(B \cap D)-N(C \cap D)+N(A \cap B \cap C)+N(A \cap B \cap D)+N(A \cap C \cap D)+N(B \cap C \cap D)-N(A \cap B \cap C \cap D) .

Verify the following:

N ( A ) = ( 9 3 ) ( 9 3 ) = 7056 N(A)= \left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)=7056

N ( B ) = ( 12 6 ) ( 6 3 ) = 18480 N(B)=\left( \begin{matrix} 12 \\ 6 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=18480

N ( C ) = ( 12 6 ) ( 6 3 ) = 18480 N(C)=\left( \begin{matrix} 12 \\ 6 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=18480

N ( D ) = ( 9 3 ) ( 9 3 ) = 7056 N(D)=\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)=7056

N ( A B ) = ( 9 3 ) ( 6 3 ) = 1680 N(A \cap B)=\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=1680

N ( A C ) = ( 9 3 ) ( 6 3 ) = 1680 N(A \cap C)=\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=1680

N ( A D ) = 0 N(A \cap D)=0

N ( B C ) = ( 6 3 ) ( 6 3 ) ( 6 3 ) = 8000 N(B \cap C)=\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=8000

N ( B D ) = ( 9 3 ) ( 6 3 ) = 1680 N(B \cap D)=\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=1680

N ( C D ) = ( 9 3 ) ( 6 3 ) = 1680 N(C \cap D)=\left( \begin{matrix} 9 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=1680

N ( A B C ) = ( 6 3 ) ( 6 3 ) = 400 N(A \cap B \cap C)=\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=400

N ( A B D ) = 0 N(A \cap B \cap D)=0

N ( A C D ) = 0 N(A \cap C \cap D)=0

N ( B C D ) = ( 6 3 ) ( 6 3 ) = 400 N(B \cap C \cap D)=\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)\left( \begin{matrix} 6 \\ 3 \end{matrix} \right)=400

N ( A B C D ) = 0 N(A \cap B \cap C \cap D)=0

Therefore, we have

N ( A B C D ) = 18480 ( 2 ) + 7056 ( 2 ) 1680 ( 4 ) 8000 + 400 ( 2 ) = 37152 N(A \cup B \cup C \cup D)=18480(2)+7056(2)-1680(4)-8000+400(2)=37152

Taking the complement yields the answer.

48620 37152 = 11468 48620-37152=\boxed{11468}

Moderator note:

Good usage of the Principle of Inclusion and Exclusion. Can this be simplified even further?

Good usage of the Principle of Inclusion and Exclusion. Can this be simplified even further?

Calvin Lin Staff - 5 years, 3 months ago
Milan Milanic
Feb 27, 2016

Solution:

Movement can be written using letters R and U . They will go exactly 9 times up and 9 times right. Therefore, there are 48620 48620 different ways from start to finish point. Now, we will subtract every way that passes through dog spot, but we have to be careful, to avoid including some ways twice.

Passing through first dog spot (3, 3), there are ( 6 3 ) ( 12 6 ) = 18480 \left( \begin{matrix} 6 \\ 3 \end{matrix} \right) \left( \begin{matrix} 12 \\ 6 \end{matrix} \right) = 18480 ways in total.

Passing through the second (or third) dog sport (3, 6) or (6, 3), there are ( 9 6 ) ( 9 6 ) \left( \begin{matrix} 9 \\ 6 \end{matrix} \right) \left( \begin{matrix} 9 \\ 6 \end{matrix} \right) , but 20 × ( 9 6 ) 20 \times \left( \begin{matrix} 9 \\ 6 \end{matrix} \right) are already included when passing through the firs dog spot. When that is subtracted, there will be 5376 5376 new ways, that are not included until now.

Passing through the fourth (6, 6) dog spot. We will proceed similarly as for the third and the second one. Calculate all the ways that pass through 4th spot, then subtract those who pass through 4th and nth spot (n = 1, 2, 3). Leaving 7920 7920 .

When they are all subtracted from the all possible ways, 11468 \boxed{11468} safe ways are left.

Nice problem. I like the Nichijou reference as well :). I hope you won't mind me adding this problem to the set Mathematics in Anime .

ZK LIn - 5 years, 3 months ago

Log in to reply

It would be my honour, so to say. I will just say that I was very pleased when I had seen a problem with an anime picture ("Too much sugar in my coffee"). I haven't solved it though... but I liked it anyway :)

Milan Milanic - 5 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...