[Math] How Many Combinations Are Possible (using 5 letters, groups of 12)

combinations

I'm hoping you can help me with how many combinations are possible, given the following…

I have 5 letters (A, B, C, D, E). I need to create groups of 12 letters, obviously I can use the letters multiple times. However, there are limitations on the usage of letters:

-In each group of 12, I must use A 5-6 times, B 1-3 times, C, 1-3 times, D 1-3 times, and E 1-3 times.

-If A is used 6 times, then the maximum usage of B, C, D, and E is 2 times each.

-If B is used 3 times, then C can only be used 1 time, D and E could only be used 1-2 times each, and A would be used exactly 5 times.

-If C is used 3 times, then B can only be used 1 time, D and E could only be used 1-2 times each, and A would be used exactly 5 times.

-If D is used 3 times, then E can only be used 1 time, B and C could only be used 1-2 times each, and A would be used exactly 5 times.

-If E is used 3 times, then D can only be used 1 time, B and C could only be used 1-2 times each, and A would be used exactly 5 times.

-If B is used 1 time, then C must be used 2-3 times.

-If C is used 1 time, then B must be used 2-3 times.

-If D is used 1 time, then E must be used 2-3 times.

-If E is used 1 time, then D must be used 2-3 times.

And the total number of letters in each group must be 12.

How many combinations would this produce?

And the order matters as I want to know all the different orders they could be in. For example, A A A A A A B C C D D E would be one and B C C D D E A A A A A A would be another… same number of specific letters in each group but counts as 2 groups because they are in a different order.

Thank you in advance for your help!

Edited: groups of 12 needed, not 14. sorry!

Best Answer

Let $a,b,c,d,e$ be the number of occurences of $A,B,C,D,E$, respectively.

Consider that among $B,C,D,E$ there cannot be $2$ (or more) letters with $3$ occurences.

Knowing that, let's split cases!

Case $1$: $b=3\implies (c=1)\land (d,e\leq2)$

Let's split cases again of $d$ and $e$:

  • Sub-case 1: $d=2,e=2\implies a=4$ (invalid)
  • Sub-case 2: $d=2,e=1\implies a=5$
  • Sub-case 3: $d=1,e=2\implies a=5$

In sub-case 2, $(a,b,c,d,e)=(5,3,1,2,1)$, so there are $\frac{12!}{5!3!1!2!1!}=332640$ possibilities.

In sub-case 3, $(a,b,c,d,e)=(5,3,1,1,2)$, so there are $\frac{12!}{5!3!1!1!2!}=332640$ possibilities.

Therefore, in this case, there are $2\times332640=665280$ possibilities.

Case $2$: $c=3\implies (b=1)\land (d,e\leq2)$

Case $3$: $d=3\implies (e=1)\land (b,c\leq2)$

Case $4$: $e=3\implies (d=1)\land (b,c\leq2)$

Consider that in each of the three cases, the number of possibilities is the same as in the first case (simply change the variables to see that).

So, across the four cases, there are $$4\times665280=2661120$$ possibilities.

Case $5$: $b,c,d,e\leq 2$

Consider that in each of $\{b,c\}$ and $\{d,e\}$, the members cannot both be $1$. So the possibilities are $(2,2),(2,1),(1,2)$. Consider that the number of $1$s in that set is either $0$ ($1$ possibility) or $1$ ($2$ possibilities).

Therefore, the number of $1$s in $\{b,c,d,e\}$ is one of

  • $0$ ($1\times1=1$ possibility),
  • $1$ ($2\times1+1\times2=4$ possibilities), or
  • $2$ ($2\times2=4$ possibilities).

Let that number of $1$s be $n$. Let's split cases again based on $n$:

  • Sub-case 1: $n=0$ ($1$ possibility) $\implies a=4$ (invalid)

  • Sub-case 2: $n=1$ ($4$ possibilities) $\implies a=5$

In this sub-case, there are $4\times\frac{12!}{5!2!2!2!1!}=1995840$ possibilities.

  • Sub-case 3: $n=2$ ($4$ possibilities) $\implies a=6$

In this sub-case, there are $4\times\frac{12!}{6!2!2!1!1!}=665280$ possibilities.

Therefore, in this case, there are $$1995840+665280=2661120$$ possibilities in this case.


Therefore, the number of possibilities across the five cases is $$2661120+2661120=\fbox{5322240}\text.$$