I have task that touches the problem around Catalan numbers. I have multiple types of parentheses (2 and 3 is enough right now) and I am given number of pairs for each parentheses. I know that with Catalan numbers I can calculate number of combinations for one with Catalan calculated through binomial coefficient $$ \frac{{2n}\choose{n}}{(n+1)}$$ for two $$ \frac{{{2n+2m}\choose{n+m}}\cdot{{n+m}\choose{n}}}{(n+m+1)} $$ etc.
But what to do if I am given a suffix?
For example I know that the combinations need to end with ")])". How many combinations I need to divide from the result?
Thank you for the help.
Think about how to derive the formula for $n$ pairs of parentheses and $m$ pairs of brackets. First we pretend that we have $n+m$ pairs of parentheses, and calculate the number of balanced strings. Then we choose $m$ of the pairs to be brackets. In the example you give, one pair is already determined to be a bracket and two are determined to be parentheses, so you have to choose $m-1$ pairs out of the remaining $n+m-3$ pairs to be brackets.
That is, instead of $\binom{n+m}{m},$ the second factor needs to be $\binom{n+m-3}{m-1}.$