Cross Twice or More

How many ways are there to get from the bottom left corner of a 10 × 10 10\times 10 grid to the top right corner in 20 steps, if you must cross the main diagonal (in red) two times or more?

In the above example, the blue path crosses the red diagonal three times, so it is a valid path.

The paths are monotonic, i.e, only moves to the right and the top are allowed.


The answer is 100776.

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

Daniel Liu
Jun 27, 2015

We will proceed with complementary counting: count the number of ways to get to the end with zero or one crossing, and subtract it from the total number of paths possible.

First, the total number is ( 20 10 ) = 184756 \dbinom{20}{10}=184756 .

Now, let's count the number of paths that do not cross. But we recognize this as a famous problem of "how many paths without going above the diagonal" with the answer simply C 10 C_{10} , where C n C_n is the n n th Catalan number. But note that we can either be always below the diagonal or always above it so there are actually 2 C 10 2C_{10} ways.

Now, let's count the number of paths that cross exactly once. If the point of crossing is at ( k , k ) (k,k) , then we have divided the problem into two smaller problems of "how many paths without going above the diagonal". Thus, for this case there are C k C 10 k C_k\cdot C_{10-k} ways. But note that again, we can start out above the diagonal or below the diagonal, so there are 2 C k C 10 k 2C_k\cdot C_{10-k} ways for each 1 k 9 1\le k\le 9 .

Thus, the number of ways for the path to not cross or cross once is 2 C 10 + k = 1 9 2 C k C 10 k = 2 k = 1 10 C k C 10 k 2C_{10}+\sum_{k=1}^92C_k\cdot C_{10-k}=2\sum_{k=1}^{10}C_k\cdot C_{10-k}

How do we calculate this? We notice that C 11 = k = 0 10 C k C 10 k \displaystyle C_{11}=\sum_{k=0}^{10}C_k\cdot C_{10-k} by the recurrence relation of C n C_n so 2 k = 1 10 C k C 10 k = 2 ( C 11 C 0 C 10 ) = 2 ( 1 12 ( 22 11 ) 1 11 ( 20 10 ) ) = 83980 2\sum_{k=1}^{10}C_k\cdot C_{10-k}=2(C_{11}-C_0\cdot C_{10}) = 2\left(\dfrac{1}{12}\dbinom{22}{11}-\dfrac{1}{11}\dbinom{20}{10}\right)=83980

So our final answer is 184756 83980 = 100776 184756-83980=\boxed{100776}

Great problem, and very nicely explained solution! I followed the same method, except for the summation which I calculated by adding the 6 terms manually. I had forgotten this recurrence relation of Catalan numbers.

C n + 1 = i = 0 n C i C n i C_{n+1} = \displaystyle \sum _{i=0} ^{n} C_{i}C_{n - i}

Pranshu Gaba - 5 years, 11 months ago

I was highly motivated to solve this problem cause of your name, haha. Too bad I failed, guess I must read more theory before challenging myself with lv 5 problems.

Really nice problem tho, you got me wondering about the solution for almost an hour.

Daniel Luis Costa - 5 years, 11 months ago

Log in to reply

Thanks! I'm honored to be a source of motivation for you.

Daniel Liu - 5 years, 11 months ago

I looked at this, and was confused because I did basically the same thing but without the recurrence and got a different answer. Then I realized that I had changed a plus to a minus in the summation when entering it on a calculator... someday I will learn. ಠ_ಠ

Dylan Pentland - 5 years, 11 months ago

Log in to reply

Yikes, those types of mistakes are the most frustrating.

Daniel Liu - 5 years, 11 months ago

Log in to reply

AWESOME QUESTION...... AND ALSO NICELY EXPLAINED SOLUTION

Sid 2108 - 5 years, 11 months ago

Straight-forward path to solution!

Takvïrul Alãm Khãñ Tãkvïr - 5 years, 7 months ago

That reccurence thing is cool. I just went for

f[n_] := Binomial[2 n, n] - 2 Sum[CatalanNumber[i] CatalanNumber[n - i], {i, 1, n}]

Agnishom Chattopadhyay - 5 years, 7 months ago

For a general formula, we have ( 2 n n ) 2 ( C n + 1 C n ) = ( n 2 ) ( n 1 ) ( n + 2 ) C n = ( n 2 ) ( n 1 ) ( n + 1 ) ( n + 2 ) ( 2 n n ) \left(\begin{array}{c}2n\\n\end{array}\right)-2\left(C_{n+1}-C_n\right)=\frac{(n-2)(n-1)}{(n+2)}C_n=\boxed{\frac{(n-2)(n-1)}{(n+1)(n+2)}\left(\begin{array}{c}2n\\n\end{array}\right)} .

For n = 10 n=10 , answer is 8 9 11 12 18 4 756 = 10 0 776 \frac{8·9}{11·12}·184'756=100'776 .

Laurent Shorts - 5 years, 2 months ago

It is a bit confusing without top indices

Dhruv Joshi - 4 years, 2 months ago

Same way :)

Andrea Virgillito - 4 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...