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

  • Thread starter mcintyw2
  • Start date
In summary, the conversation discusses the need to enumerate possibilities in a string of symbols by placing square brackets around them. The rules state that at least one symbol must be enclosed by the brackets. The formula for calculating the number of possibilities is not simple, but a short computer program can be written to count them. The second part of the conversation mentions a similar problem with nested brackets, and suggests looking at Bell numbers and Catalan numbers for potential solutions.
  • #1
mcintyw2
2
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:
Mathematics news on Phys.org
  • #2
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?
 
  • #3
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.
 
  • #4
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.
 
  • #5
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
 

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

1. What is the binomial coefficient equation and how is it used in combinatorial possibilities?

The binomial coefficient equation, also known as the "choose" formula, is used to calculate the number of ways to choose a group of k objects from a set of n objects. It is represented as n choose k and can be written as nCk or    nCk =    nPk / k! = n! / (k!(n-k)!). This equation is commonly used in probability and statistics to determine the likelihood of certain outcomes.

2. How do permutations and combinations differ?

Permutations and combinations are both methods for counting the number of possible outcomes in a situation, but they differ in their approach. Permutations take into account the order of the elements, while combinations do not. In other words, permutations consider arrangements while combinations do not. For example, the combination of choosing 3 letters from the alphabet would include "ABC" and "CBA" as one possibility, while permutations would count these as separate outcomes.

3. How can the factorial function be applied to combinatorial possibilities?

The factorial function is used to calculate the number of ways to arrange a set of objects in a specific order. In combinatorial possibilities, the factorial function is used in conjunction with the binomial coefficient equation to calculate the number of ways to select and arrange objects from a larger set. For example, if you have 5 objects and want to select 3 of them, the binomial coefficient equation would be 5 choose 3, or 5C3, which would then be multiplied by 3! (the number of ways to arrange the 3 selected objects) to get the total number of possibilities.

4. How do you account for repetition in combinatorial possibilities?

When dealing with repeated elements in a set, the formula for calculating combinatorial possibilities changes. In this case, the number of ways to choose k objects from a set of n objects is represented as n choose k with repetition, or nk. This means that each object can be chosen multiple times. For example, if you have 3 different colored marbles and want to choose 2 of them, the formula would be 3 choose 2 with repetition, or 32 = 9 possible outcomes.

5. How can Pascal's Triangle be used to solve combinatorial problems?

Pascal's Triangle is a triangular arrangement of numbers that can be used to easily calculate the coefficients in the binomial expansion. Each row in the triangle represents the coefficients of the binomial expansion for (a + b)n. This can be applied to combinatorial problems when calculating the number of ways to choose objects from a larger set, as each number in the triangle represents the number of ways to choose a certain number of objects from the set. For example, the 4th number in the 5th row of Pascal's Triangle represents the number of ways to choose 4 objects from a set of 5.

Similar threads

Replies
9
Views
2K
Replies
6
Views
2K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
10
Views
2K
Replies
3
Views
2K
Back
Top