Proper Brackets

With one instance each of 2 distinct brackets, there are 4 possible properly bracketed sequences.

  • []()
  • ()[]
  • ([])
  • [()]

How many properly bracketed sequences are constructible with one instance each of 8 distinct brackets?

You may use a calculator for the final step of your calculation.


The answer is 57657600.

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.

1 solution

Ivan Koswara
Jul 22, 2016

Observe that a given bracket sequence of n n distinct brackets can be identified with two things: a permutation of the n n kinds of brackets, and a proper bracket sequence of n n identical brackets. Here, we call the original bracket sequence as varied sequence , and the resulting bracket sequence with only one kind of bracket as standardized sequence ; so a varied sequence is identified by a permutation of brackets and a standardized sequence. For example, the sequence ([]<{}>) can be identified by the permutation (), [], <>, {} and the bracket sequence (()(())) . To determine the permutation, we simply walk from left to right; each time we encounter a new bracket type, append it to the permutation. To determine the standardized sequence, just convert everything into the same bracket kind. To obtain the original varied sequence, walk the standardized sequence from left to right; every time we find an opening bracket, take the next element in the permutation and replace this opening bracket with its matching closing bracket with this type.

Every permutation and standardized sequence gives a unique varied sequence, and every varied sequence can be represented in such a way. Thus it's enough to count the number of pairs of permutations and standardized sequences. But the number of permutations is simply n ! n! ; there are n n kinds of brackets, and we arrange them in a row, so there are n ! n! such ways. And the number of standardized sequences is C n C_n , the n n -th Catalan number. (This is well-known; one possible way to find this is to use the identity C n + 1 = i = 0 n C i C n i C_{n+1} = \sum_{i=0}^n C_i C_{n-i} , and noticing that a standardized sequence of n + 1 n+1 brackets must begin with an opening bracket, followed by a standardized sequence of i i brackets, followed by a closing bracket (this matches the first opening bracket), followed by the remaining n i n-i brackets.)

Thus the number of varied sequences of n n brackets is simply n ! C n = n ! n + 1 ( 2 n n ) = ( 2 n ) ! ( n + 1 ) ! n! \cdot C_n = \frac{n!}{n+1} \binom{2n}{n} = \frac{(2n)!}{(n+1)!} . For n = 8 n = 8 , this gives 16 ! 9 ! = 57657600 \frac{16!}{9!} = \boxed{57657600} .

for 2 brackets we have 4 patterns . from the general solution for 3 brackets we have 30 patterns. what are they ?

Abdullah Ahmed - 4 years, 10 months ago

Log in to reply

1
2
3
4
5
([<>])
([]<>)
([])<>
()[<>]
()[]<>

Permute the three kinds of brackets. Each possibility above gives 3 ! = 6 3! = 6 patterns, for a total of 30.

Ivan Koswara - 4 years, 10 months ago

Log in to reply

thank u so much to clear my confusion .

Abdullah Ahmed - 4 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...