If we want to count how many possible pairs $n$ of parenthesis we have when $n = 1$ then I think the way to count is $2 \choose 1$ since if we have $2$ symbols and we pick $one$ position to place $1$ the other will be at the other position hence total of ${2 \choose 1} = 2$.
But we have:
$()$ and $)($ and $(($ and $))$ total of $4$
For the case of $n = 2$, following the same reasoning i.e. I have $4$ positions for the symbols, I pick any $2$ and use that as the count I get ${4 \choose 2} = 6$ but when I actually enumerate all the cases I count $9$
I.e.
- $()()$
- $(())$
- $))()$
- $((()$
- $()))$
- $())($
- $)()($
- $(((($
- $))))$
I thought the idea is that we have $n + n$ positions and we care about choosing $n$ and get the total count.
E.g. I have seen the same logic when counting lattice paths
What am I messing up here?
(())is valid,()()is valid, but())(is not and)()(is not. For that see Dyck words and Catalan numbers. – JMoravitz Apr 26 '22 at 12:10