What equation or pattern applies to this kind of combinatorial possiblity?

  • Context: Graduate 
  • Thread starter Thread starter mcintyw2
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on the combinatorial possibilities of placing square brackets around a string of symbols, specifically the string "XYZ". The user seeks a general formula for calculating the number of valid bracket placements, which must include at least one bracket and can involve nested structures. The conversation highlights the relevance of Catalan numbers in counting valid parenthesizations and suggests that a computer program may be necessary for more complex cases. The user also references Bell numbers for partitioning sets when order does not matter.

PREREQUISITES
  • Understanding of combinatorial mathematics
  • Familiarity with Catalan numbers and their applications
  • Basic programming skills for algorithm implementation
  • Knowledge of set theory and partitions
NEXT STEPS
  • Research the properties and applications of Catalan numbers in combinatorial problems
  • Explore Bell numbers and their significance in counting partitions
  • Learn how to implement a recursive algorithm to count bracket placements
  • Investigate the implications of nesting levels in combinatorial structures
USEFUL FOR

Mathematics students, computer scientists, and anyone interested in combinatorial enumeration and algorithm design.

mcintyw2
Messages
2
Reaction score
0
Hello, I am a philosophy student. I have no extensive training at math so please don't deluge me with formalism or terms of art off the bat. I also know that I run the risk of asking a really basic question here, but forgive me if so.

In my studies, I am often confronted with the need to enumerate the possibilities given the following circumstances.

Take, say, the ordered string of symbols XYZ.

Now take the square bracket, [..] which can go around any of the symbols or any ordered string of the symbols.

The rules are the square bracket must go around at least one of the symbols.

I get the following possibilities:

[X]YZ
X[Y]Z
XY[Z]
[XY]Z
X[YZ]
[XYZ]
[X][Y]Z
X[Y][Z]
[X]Y[Z]
[XY][Z]
[X][YZ}
[X][Y][Z]

Can someone please explain the general pattern or formula that allows one to calculate the number of these possibilities from an n-ly long string of symbols? So a triply long string of symbols nets you 12 possibilities.Update***

I would also like to know about the pattern that would get one the following set of possibilities:

[X]YZ
X[Y]Z
XY[Z]
[XY]Z
[[X]Y]Z
[X[Y]]Z
X[YZ]
X[[Y]Z]
X[Y[Z]]
[XYZ]
[[X]YZ]
[X[Y]Z]
[XY[Z]]
[[XY]Z]
[[[X]Y]Z]
[[X[Y]]Z]
[X[YZ]]
[X[[Y]Z]]
[X[Y[Z]]]
[X][Y]Z
X[Y][Z]
[X]Y[Z]
[XY][Z]
[[X]Y][Z]
[X[Y]][Z]
[X][YZ]
[X][[Y]Z]
[X][Y[Z]]
[X][Y][Z]

and:

[X]YZ
X[Y]Z
XY[Z]
[XY]Z
[[X]Y]Z
[X[Y]]Z
X[YZ]
X[[Y]Z]
X[Y[Z]]
[XYZ]
[[X]YZ]
[X[Y]Z]
[XY[Z]]
[[XY]Z]
[[XY][Z]]
[[[X]Y]Z]
[[[X]Y][Z]]
[[X[Y]]Z]
[[X[Y]][Z]]
[X[YZ]]
[[X][YZ]]
[X[[Y]Z]]
[[X][[Y]Z]]
[X[Y[Z]]]
[[X][Y[Z]]]
[[X][Y]Z]
[[X]Y[Z]]
[X[Y][Z]]
[[X][Y][Z]]
[X][Y]Z
X[Y][Z]
[X]Y[Z]
[XY][Z]
[[X]Y][Z]
[X[Y]][Z]
[X][YZ]
[X][[Y]Z]
[X][Y[Z]]
[X][Y][Z]

I might have missed some of these but hopefully the pattern is reasonably clear.
 
Last edited:
Physics news on Phys.org
I don't recognize your problem as one that has a simple formula. I think it would be possible to write a short computer program to count the possibilities.

We need to define precisely what it would mean to extend the problem to a string of n symbols. My guess at what you mean by the first type of problem is:

In how many ways can pairs of non-nested pairs brackets be placed around the subsequences of a string of n distinct symbols such that at most n pairs of brackets are used?

How to generalize your second type of problem to a string of n symbols is less clear. Do we say that the maximum level of nesting that is allowed is n? Are there still at most n pairs of brackets allowed?
 
If order didn't matter, I'd look up Bell numbers, they arise as a way to count the amount of partitions there are to any given set.

Since order does matter, you know that your number you will want to count should be less than this.

I hope that helps.
 
Thank you for the helpful replies. My initial presentation was vague, as the first commenter pointed out. I also posted this over at http://forums.xkcd.com/viewtopic.php?f=17&t=79427 and have presented my clarifications of the parameters of the problem over there, if any are interested.
 
Although not an exact match to your problem, you might find the Catalan numbers interesting. The nth Catalan number counts the number of ways of completely parenthesizing a string of n symbols (and a huge list of equivalent problems).

http://en.wikipedia.org/wiki/Catalan_number
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 56 ·
2
Replies
56
Views
11K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 93 ·
4
Replies
93
Views
15K
  • · Replies 3 ·
Replies
3
Views
2K