STAGE IC 3.1 · 8 PRACTICE PROBLEMS · 2 NEW-CONTEXT APPLICATIONS
Prefix Constraints and Catalan Numbers
Useful preparation: Recurrences from First Choices
Goal: Understand and apply prefix constraints and catalan numbers.
Before you begin: Recurrences from First Choices
Understand the idea
Balanced parentheses require equal final totals and also require every prefix to have at least as many opens as closes. The prefix condition excludes many strings with equal totals.
Choose and carry out a method
Count all equal-total strings, then subtract bad strings through a first-crossing reflection correspondence. The difference is C(2n,n)−C(2n,n+1).
Check the reasoning
For one pair the count is one, and for two pairs it is two. A string beginning with a close is invalid regardless of its final totals.
How many balanced parenthesis strings have 3 pairs of parentheses?
- A valid prefix never has more closes than opens; reflect the first bad prefix to count the complement.
- C_3=C(6,3)-C(6,4)=C(6,3)/(4).
- The count is 5. Equal final totals alone do not guarantee valid prefixes.
5
How many balanced parenthesis strings have 4 pairs of parentheses?
- A valid prefix never has more closes than opens; reflect the first bad prefix to count the complement.
- C_4=C(8,4)-C(8,5)=C(8,4)/(5).
- The count is 14. Equal final totals alone do not guarantee valid prefixes.
14
Common pitfalls
Possible mix-up: Equal numbers of opens and closes guarantee validity.
Every prefix must also keep the open count at least the close count.
Possible mix-up: A correct numerical answer alone explains the method.
State the governing relationship and check the conditions described above.
Explain it to yourself
Explain why ()() is valid but )( is not, despite balanced totals.
Preview the eight practice prompts
- How many balanced parenthesis strings have 6 pairs of parentheses?
- How many balanced parenthesis strings have 7 pairs of parentheses?
- How many balanced parenthesis strings have 8 pairs of parentheses?
- How many balanced parenthesis strings have 9 pairs of parentheses?
- How many balanced parenthesis strings have 10 pairs of parentheses?
- How many balanced parenthesis strings have 11 pairs of parentheses?
- A stack receives 12 pushes and 12 pops. A pop is forbidden when the stack is empty. How many push/pop patterns obey the rule? New context
- A stack receives 13 pushes and 13 pops. A pop is forbidden when the stack is empty. How many push/pop patterns obey the rule? New context

