0

It seems I can express a permutation using set notation. For example, I can talk about the permutation {a,b,a,b}. But presumably I cannot talk about a combination using set notation. For example, I cannot talk about the combination {a,b,a,b}, as this might suggest that the order of the elements is significant. And I cannot talk about the combination {a,b,a,b} / {a,b,b,a} / etc. etc. as this is far too long-winded. So how should I express a combination? Should it be written as a proportion, e.g. "combination aa:bb" or combination "2a's:2b's"?

  • ${a,b,a,b}$ may be ambiguous: I would unclear as to whether you intend it to be a set or a multiset (what you call a combination) or an ordered set (what you call a permutation) unless you tell me – Henry Oct 26 '23 at 22:16
  • 1
    Ordinarily, a combination is a selection of members from a set of distinct elements. So you can't have tow $a$'s or two $b$'s. – Robert Israel Oct 26 '23 at 22:18
  • @RobertIsrael Is it not the case that you can have combinations with repeated elements? Why can't a particular combination have two distinct a's and two distinct b's? But my basic problem is really this: I don't know how to refer to a particular combination or (in light of Henry's comment) a permutation either. – FreeThought Oct 26 '23 at 22:25
  • It's not that combinations can't have repeats, but sets cannot - the sets ${a, a}$ and ${a}$ are considered to be the same, and both have one element. If you want to allow repeats then you need to use multisets, which are a slightly different object. – ConMan Oct 26 '23 at 22:43
  • @ConMan not true, if you explictly specify that the collection of elements is a multiset where each individual element can have a multiplicity. – user2661923 Oct 26 '23 at 22:46
  • What I'm after is this. Say I have a three elements, a, b,c. One permutation of this will be "abc", another will be "cab", another will be "bac", and so on. But how do I express the combination of which all these permutations are instances? – FreeThought Oct 26 '23 at 22:52
  • I feel like "combination" just isn't a word used past middle school. You can talk about subsets of sets, or sub-multisets of multisets, instead. – Misha Lavrov Oct 27 '23 at 18:28

1 Answers1

0

Say I have a three elements, a, b,c. One permutation of this will be "abc", another will be "cab", another will be "bac", and so on. But how do I express the combination of which all these permutations are instances?

I would approach it as follows:

First, I would explicitly specify that:

  • The set $~S~$ is a multiset.
    This signifies that each distinct element in $~S~$ may or may not have a multiplicity greater than one.
    Here, the multiplicity of a specific element in $~S~$ refers to the number of occurrences of the element in the multiset $~S.~$

  • The distinct elements in $~S~$ are given by (for example) $\{a,b,c\}.$

  • The multiplicities of each of $~a, ~b, ~$ and $~c,~$ are given by
    $N_a, ~N_b, ~N_c ~$ respectively, where $~N_a,N_b,N_c \in \Bbb{Z^+}.$

Then, I would explicitly specify that I want to enumerate the number of possible permutations of length $~N~$ of the elements in $~S,~$ where $~N \in \Bbb{Z^+},~$ and $~N_a + N_b + N_c \geq N.$


To illustrate the Math involved, I am going to assume that:

  • The distinct elements in the multiset $~S~$ are given by $~\{a,b,c\}.~$

  • $~3 = N_a = N_b = N_c.~$
    That is, each distinct element has multiplicity equal to $~3.$
    This signifies that an alternative representation of the multiset $~S~$ would be
    $\{a,a,a,b,b,b,c,c,c\}.$

  • Arbitrarily, I am interested in computing the number of permutations of length $~N = 7,~$ that can be formed from the elements in the multiset $~S.~$
    Note that (as required) $~7 \leq N_a + N_b + N_c.~$


The computation is a complicated multistage process, that I would approach as follows:

First, I would want to know how many distinct combinations of length equal to $~7~$ are possible, (as opposed to how many distinct permutations are possible). Here, I use the term combination to refer to the fact that the order that the elements in $~S~$ occur is not regarded as relevant. I then use the term permutation to refer to the fact that the order that the elements in $~S~$ occur is regarded as relevant.

Then, I would partition the combinations into categories, where each combination in a specific category generates the same number of distinct permutations. I would then compute the total number of possible permutations.


So, the first step is to identify the total number of combinations possible. This question, by itself, is generally very complicated. I know of only two generic approaches:

  • Generating Functions, which I am totally ignorant of.

  • Combining Stars and Bars Theory with Inclusion-Exclusion Theory.
    See this answer for a blueprint of how to combine Inclusion-Exclusion with Stars-And-Bars to attack this generic type of problem.

Using the second method above, you can let $~x_1, ~x_2, ~x_3~$ denote the number of elements $~a,b,c~$ respectively that will be used to form the combination of length $~7.~$ Then, the total number of combinations will exactly equal the number of solutions to:

  • $x_1 + x_2 + x_3 = 7.~$

  • $x_1, ~x_2, ~x_3 \in \Bbb{Z_{\geq 0}}.$

  • $x_1 \leq N_a, ~x_2 \leq N_b, ~x_3 \leq N_c.$
    That is, $~x_1, ~x_2, ~x_3~$ are each $~\leq 3.~$


The linked [Stars and Bars + Inclusion-Exclusion] article gives very explicit instructions on how to solve the above problem. Note however, that computing the number of combinations is merely Step 1. You then have to categorize each of the combinations, where each combination in a specific category generates the same number of permutations.

In order to do this, you need the formula for Multinomial Distributions:

If (for example) you use $~R_a, ~R_b, ~$ and $~R_c~$ instances of elements $~a,b,c~$ respectively, to form a permutation of length $~N = R_a + R_b + R_c,~$ then the number of permutations possible is given by

$$\frac{N!}{\left(R_a\right)! \times \left(R_b\right)! \times \left(R_c\right)!}.$$

So, in order to categorize the combinations, you will need to identify the various possible values of $~\left(x_a\right)! \times \left(x_b\right)! \times \left(x_c\right)!$


Fortunately, as illustrated in this section, this particular problem permits a shortcut.

Since you have $~x_a + x_b + x_c = 7 = [(N_a + N_b + N_c) - 2],~$ the only possible solutions are $~x_a, ~x_b, ~x_c~$ are equal to $~3, ~3, ~1,~$ in some order (3 different solutions) or $~x_a, ~x_b, ~x_c~$ are equal to $~3, ~2, ~2,~$ in some order (3 different solutions).

So, you have two different categories : [3,3,1] and [3,2,2], with each category having exactly 3 combinations.

Each of the three combinations in the first category, [3,3,1] will generate
$\displaystyle \frac{7!}{(3!) \times (3!) \times (1!)}~$ different permutations.

Each of the three combinations in the second category, [3,2,2] will generate
$\displaystyle \frac{7!}{(3!) \times (2!) \times (2!)}~$ different permutations.

Therefore, the total number of permutations of length $~7~$ possible from the multiset
$~S = \{a,a,a,b,b,b,c,c,c\}~$
is given by

$$\left[ ~3 \times \frac{7!}{(3!) \times (3!) \times (1!)} ~\right] + \left[ ~3 \times \frac{7!}{(3!) \times (2!) \times (2!)} ~\right].$$




$\underline{\text{Addendum}}$

A case can be made that my response is not on point, to the excerpted question, which is repeated below:

Say I have a three elements, a, b,c. One permutation of this will be "abc", another will be "cab", another will be "bac", and so on. But how do I express the combination of which all these permutations are instances?

However, my answer, before the Addendum, can be used as a starting point for attacking the question above. First, you must specify:

  • The distinct elements in the multiset $~S.$

  • The multiplicity of each element.

  • The desired (fixed) length $~N~$ of each of the permutations.

By way of illustration, assume that :

  • The distinct elements in $~S~$ are given by $~\{a,b,c\}.$

  • $5 = N_a = N_b = N_c.$
    That is, each distinct element has multiplicity $~5.$

  • $N = 11.$
    That is, you require each permutation to be of length $~11.$

  • You are only interested in those permutations where each of the following string of consecutive characters occurs:
    "abc", "cab", "bac".

The last bullet point above creates a problem that generically represents a nightmare. For example, note that the string "abcab" satisfies two of the three strings. Therefore, you can not assume that the three strings are non-intersecting. This implies that you can not assume that each string constitutes a separate fused unit of three characters, so that you then have $~5~$ total units to permute. Such an approach would be in error.

So, in order to analyze the problem, you first have to meticulously examine the interplay between each of the three strings.

Setting the interplay issue aside, I know of three generic approaches to this nightmare of a problem. The original poster can use the ideas below as a guide to various approaches.

  • The direct approach:
    You somehow enumerate all permutations where (for example), the string "abc" occurs. Within these, you exclude those permutations where "cab" does not occur. You also exclude those permutations where "bac" does not occur.

  • Recursion:
    You identify the minimum value $~N~$ such that a permutation of length $~N~$ is possible that contains all three strings. You let $~f(X)~$ denote the number of satisfying strings of length $~X,~$ where $~X \in \Bbb{Z_{\geq N}}$.

    You let $~f(X,a)~$ denote the number of satisfying strings of length $~X,~$ where the last character in the string is an "a".
    You similarly define $~f(X,b)~$ and $~f(X,c).~$
    This implies that $~f(X) = f(X,a) + f(X,b) + f(X,c).~$

    You then, somehow, seek to establish relationships between the three variables: $~f(X,a), f(X,b), f(X,c),~$ and [for example] $~f(X+1,a), f(X+1,b), f(X+1,c).~$

    This can be a nightmare, because you can have a permutation of length $~X~$ that is unsatisfactory (e.g. missing one of the 3 character strings) that becomes satisfactory when one of the elements $~a,b,c~$ is added to the end of the string.

  • Inclusion-Exclusion
    You let (for example) $~P~$ denote the collection of all permutations of length $~11~$ that are possible, without any regard to whether the strings "abc", "cab", "bac" are present.

    You let $~P_1~$ denote the subset of $~P~$ for which the permutation "abc" is missing. You similarly define $~P_2~$ to be the subset of $~P~$ for which the permutation "cab" is missing. You similarly define $~P_3~$ to be the subset of $~P~$ for which the permutation "bac" is missing.

    You then use Inclusion-Exclusion theory to compute
    $\displaystyle |P| - |P_1 \cup P_2 \cup P_3|.$

user2661923
  • 35,619
  • 3
  • 17
  • 39