正确排列括号的方法数
Number of ways of correctly arranging parenthesis
这个问题我想了很久:
What's the number of ways of correctly* arranging 2*n parenthesis.
*A correctly arranged sequence of parenthesis has an equal number of open and closed parenthesis at its end and a larger or equal amount of open parenthesis than the closed ones throughout the sequence.
例如n=3
,有5
种方式:((())), ()(()), ()()(), (())(), (()())
.
我一直在考虑将嵌套括号表示为树,但没有取得太大进展。
你的例子相当于Dyck words, which can be counted with combinatorics and will be equal to Catalan number的数量:
这个问题我想了很久:
What's the number of ways of correctly* arranging 2*n parenthesis.
*A correctly arranged sequence of parenthesis has an equal number of open and closed parenthesis at its end and a larger or equal amount of open parenthesis than the closed ones throughout the sequence.
例如n=3
,有5
种方式:((())), ()(()), ()()(), (())(), (()())
.
我一直在考虑将嵌套括号表示为树,但没有取得太大进展。
你的例子相当于Dyck words, which can be counted with combinatorics and will be equal to Catalan number的数量: