Number of monotonic paths touching the diagonal but not crossing it

42 Views Asked by At

We know the number of monotonic paths to reach from $(0,0)$ to $(n,n)$ of a square grid, without crossing the diagonal, is the Catalan number.

Reference https://en.wikipedia.org/wiki/Catalan_number#/media/File:Catalan_number_4x4_grid_example.svg

https://en.wikipedia.org/wiki/Catalan_number

This problem is similar to Catalan number, but it is mandatory that the path touches the diagonal at some point other than $(0,0)$ and $(n,n)$.

I have formulated it as $C(n)-C(n-1)$, where $C(n)$ is the nth Catalan number. $C(n) ->$ all paths not crossing diagonal, $C(n-1) ->$ all paths not crossing fatal diagonal (straight line from (1,0) to (n,n-1)).

Since $C(n)=\frac {\binom{2n}{n}}{n+1},C(n-1)=\frac{\binom{2n-2}{n-1}}{n}$

After calculating $C(n)-C(n-1)$, I am getting $\frac{3(2n-2)!}{(n+1)!(n-2)!}$.

But it is not tallying with the answer given to me $\frac{(2n-3)!}{2^{n-2}(n-2)!}$.

This is actually the answer to the question, how many binary trees we can make with $n$ leaves where each node can have either $0$ or $2$ nodes. I have modelled the problem as given above.

Any pointers on why the answer is not tallying, is welcome.