In one of the applications of Catalan number,it calculates the number of Dyck word in which a string consisting of n $X's$ and n $Y's$ such that no prefix of the string has more $Y's$ than $X's$, and the number given is $C(2n,n) - C(2n,n-1)$. This formula is also correct for any numbers of X and Y, i.e.,$C(m + n,n) - C(m + n,n-1)$
What if the requirement changes to 'no prefix and suffix of the string has more Y's than X's'? It should be more than $C(m + n,n)-2C(m + n,n-1)$, but I am not sure how to determine the exact close form solution. Any ideas?
These objects are called "bidirectional ballot sequences" and were first introduced in the paper "Constructing MSTD sets using bidirectional ballot sequences" by Yufei Zhao (see http://arxiv.org/pdf/0908.4442.pdf).
Unfortunately, as far as I'm aware, there is no known closed form for the number $B_{n}$ of bidirectional ballot sequences of length $n$ (unlike the case for the Catalan numbers). The paper shows that, asymptotically, $B_{n} = \Theta(2^{n}/n)$.