Compute how many ways to get to (n,n) from (0,0) you must cross x=y only once at (k,k+1)

47 Views Asked by At

In the question we have a cat in $(0,0)$. The cat can only go right or up. The cat wants to reach $(n,n)$, but must go through one of the points above $(x=y)$. Meaning a point $(k,k+1)$. Compute how many different ways can the cat reach (n,n)?

I realized I need to denote a step to the right by $0$ and a step up by $1$ and sum the valid sequences though I'm not sure how to do this.

A solution would be very appreciated!

1

There are 1 best solutions below

1
On

Hint

Look up Catalan numbers (paths that never cross the diagonal)

You already know how to compute total paths.

What further do you need to do ?