Counting Parentheses

How many ways are there to arrange 10 left parentheses and 10 right parentheses so that the resulting expression is correctly matched?

For example, ( ( ) ( ( ) ) ) (()(())) is correctly matched, but ( ( ) ) ) ( ( ) (()))(() is not.


The answer is 16796.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Mark Hennings
Feb 8, 2016

There are ( 20 10 ) {20 \choose 10} ways in which a score of 10 : 10 10:10 can be achieved in a football game between teams A A , B B . By the Reflection Principle, there are ( 20 9 ) {20 \choose 9} ways in which a score of 10 : 10 10:10 can be achieved for which A A is behind in the score at some time. Thus there are ( 20 10 ) ( 20 9 ) = 16796 {20 \choose 10} - {20 \choose 9} = 16796 ways in which a score of 10 : 10 10:10 , with team A A never falling behind in the score.

Regarding a left brace as a goal for team A A , and a right brace as a goal for team B B , the answer to the question is again 16796 \boxed{16796} .

Why are there (20, 10) ways for 10:10 score?

Junior Stu - 2 years, 2 months ago
Brian Riccardi
Feb 11, 2016

Let f ( n ) f(n) be the number of ways we can arrange n n pairs of parentheses.

f ( 0 ) = 1 f(0)=1 because 0 0 pairs of parentheses aren't rearrengeable.

Suppose we have n n pairs of parentheses, take the first pair p p : then there can be k k pairs of parentheses into p p and n 1 k n-1-k pairs out of p p for all possible k k .

So, f ( n ) = k = 0 n 1 f ( k ) f ( n 1 k ) f(n)=\displaystyle \sum_{k=0}^{n-1} f(k)f(n-1-k)

f ( 10 ) = 16796 f(10)= \boxed{16796}

From the question, we know that we are basically finding the 10th Catalan number, which is 16796.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...