= Balanced parentheses
A string of opening and closing parentheses is balanced when its total numbers of openings and closings agree and every prefix has at least as many openings as closings. Thus `(()())` is balanced, while `())(()` has equal totals but an invalid prefix. Reading `(` as an up step and `)` as a down step gives a <bijection> with <Dyck paths>: height is the number of openings awaiting a closing parenthesis. \b[There are $C_n$ balanced strings with $n$ pairs], including one empty string. This models nested syntax and the <stack> discipline that remembers the most recently opened unfinished part.
Back to article page