0

Let $S_1, S_2$ and $S_3$ be three ordered sets, each having $3$ elements. Let all three sets be pairwise disjoint. For example say $S_1 = \{ a, b, c \}, S_2 = \{ 1, 2, 3 \}$ and $S_3 = \{ I, II, III \}$.

Let $T$ be a target container with room for $6$ elements. $T$ is supposed to be filled with items from the three sets $S_1, S_2$ and $S_3$ but their original order has to be respected. This means that (i) the $k$-th element from any set must be present if any element after the $k$-th element is also present and (ii), that the $k$-th element must always come before the $k+1$-th element, and the $k+2$-th element and so on.

For example $T = \{1, 2, 3, a, b, I\}$ is a valid configuration for $T$ but $T = \{ 1, 2, 3, b, c, a \}$ is not since $a$ must appear before $b$ and $c$ due to the order of $S_2$. Also $T = \{ 1, 2, b, c, I, II \}$ is invalid because items $b$ and $c$ appear but $a$ is missing.

Note that each valid configuration of $T$ must have $6$ elements but it is totally fine to choose elements from only two sets for that. In other words, $T$ can completely disregard one of the sets and only choose elements from the remaining two.

Goal: Find the number of all possible configurations of $T$ obeying these rules.


My approach: I have come up with this formula $$ \sum_{l_1, l_2, l_3 \in \{ 0, 1, 2, 3 \}: l_1 + l_2 + l_3 = 6} \binom{6}{l_1} \binom{6 - l_1}{l_2} = 510 $$ due to the following reasons:

  • Let $l_1, l_2, l_3$ be the number of elements which we are taking from $S_1, S_2$ and $S_3$ respectively. Since each set contains $3$ elements, $l_1, l_2, l_3 \in \{0, 1, 2, 3\}$ and since $T$ must contain $6$ elements in total, $l_1 + l_2 + l_3 = 6$.
  • $T$ has $6$ slots in total of which $l_1$ are taken by elements from $S_1$. The number of ways to choose $l_1$ slots those items from $S_1$ is specified by $\binom{6}{l_1}$.
  • Once the slots for the elements from $S_1$ are chosen, $6 - l_1$ slots remain. Using the same argument as previously, there are $\binom{6 - l_1}{l_2}$ ways to choose slots for the items of $S_2$.
  • The remaining slots are left for the items from $S_3$.
  • Now, if there are $l_1$ elements to be taken from $S_1$, then there is only one option to choose these elements. You simply take the first $l_1$ elements in $S_1$. Therefore, nothing has to be added here. This argument also applies for the elements of $S_2$ and $S_3$.

Could you please give me your thoughts on this and tell me whether I did something wrong here?

  • 1
    Your analysis and approach looks to be correct, however it is hardly the cleanest approach available. The most generic version of the problem will not have a clean result in the end, but for these particular sizes and numbers I would have probably called this $3^6 - 3\cdot \left(\binom{6}{4}2^2 + \binom{6}{5}2+1\right)$ to avoid quite so much arithmetic. The idea of this being, we count how many ways to assign the positions to the "parent sets" initially ignoring upper bounds and then remove those arrangements who have too many of a particular set present than is allowed. – JMoravitz Oct 10 '23 at 12:08
  • I get $\frac{3!}{2!0!0!1!}\frac{6!}{3!^22!^0 1!^0 0!^1} + \frac{3!}{1!1!1!0!}\frac{6!}{3!^12!^1 1!^1 0!^0} +\frac{3!}{0!3!0!0!}\frac{6!}{3!^02!^3 1!^0 0!^0}$ $=510$, the same as @JMoravitz – Henry Oct 10 '23 at 12:15
  • @JMoravitz Thank you for your feedback. I understand where the $3^6$ in your answer comes from but could you please elaborate on the second part? – Bob Aiden Scott Oct 10 '23 at 12:16
  • 1
    $3^6$ because for each position we choose it to either come from $S_1,S_2,$ or $S_3$. If it was the first time choosing $S_1$ it would be $a$, the second time would be $b$ and so on, but we also allow ourselves to go on to $d,e,f$ etc... We now choose which set was overrepresented with the $3\cdot$. Now, choose the positions of the overrepresented set. If there were four positions used by the overrepresented set, choose those four positions in $\binom{6}{4}$ ways and choose what sets the other positions are used for from the remaining two sets. Similar for others. Remove from total. – JMoravitz Oct 10 '23 at 12:20
  • I will emphasize again, that there can be many correct approaches to problems. When it comes to something like this, the differences between the approaches will largely be aesthetics and not correctness. – JMoravitz Oct 10 '23 at 12:23
  • 1
    An alternative approach using an exponential generating function: The number you want is $6!$ times the coefficient of $x^6$ when $$\left( 1 + x + \frac{1}{2!} x^2 + \frac{1}{3!} x^3 \right)^3 $$ is expanded. – awkward Oct 10 '23 at 12:32
  • @awkward This sound really interesting and seems to be correct, but I have no clue where your result comes from. Could you please point out a resource which could help me to understand your approach? – Bob Aiden Scott Oct 10 '23 at 13:49
  • 1
    I'm happy you asked! You can find many resources about generating functions in the answers to this question: https://math.stackexchange.com/questions/3142386/how-can-i-learn-about-generating-functions/3142387 – awkward Oct 11 '23 at 12:35

0 Answers0