4

Here's the problem statement

In how many ways can we arrange $5$ $A$s, $7$ $B$s and $4$ $C$s into a $16$-letter word such that there are atleast three $CA$ pairs occurring in a word

The solution mentioned proceeds to calculate the number of words containing exactly four $CA$ pairs and then the number of words containing exactly three $CA$ pairs (which it does by calculating number of ways of inserting $2$ $A$s in $11$ out of $12$ gaps (blank group allowed) of a string containing $3$ $CA$ pairs, $7$ $B$s and one $C$. I agree with this solution, however I cannot figure out why my method fails.

I think calculating number of words that contain $3$ $CA$s pairs and their permutations should suffice, because their permutations do include the cases where another $CA$ pair is formed (so that accounts for $4$ $CA$ pairs formed) and when $C$ does not precedes any of the $A$s, it accounts for the words containing $3$ $CA$ pairs. So, number of words should be $$\frac{13!}{7! \times 3! \times 2!} =102960$$ whereas, according to solution 1 $$\frac{12!}{7! \times 4!} + \frac{11!}{7! \times 3!} \times {12\choose10} = 3960 + 87120 = 91080$$ can someone point out my mistake

  • 1
    Beware overcounting. For example, consider the sequence that starts CACACACA.... If you are counting any string with at least $3$ CA pairs, then you will count the above prefix $(4)$ times, instead of just once. Your approach, with some gymnastics, can be made to work. However, it is not advisable. The standard approach is to consider exactly $3$ pairs, and exactly $4$ pairs, separately. This avoids the whole overcounting issue. – user2661923 Feb 08 '22 at 07:48
  • Actually, I did not read your posting that closely. Therefore, I may have misinterpreted your work. However, when I got wind of your approach, and then glanced at your math, I asked myself: How is he preventing overcounting? – user2661923 Feb 08 '22 at 07:49
  • hmm, I understand, so subtracting $3$ times the number of words containing $4$ $CA$ pairs should fix this. Thanks! – AlastorMoody Feb 08 '22 at 07:58
  • That would be my guess. Also, it would certainly be worth exploring, to see if you then get the purported right answer. However, going forward for problems like this, the choice of the best strategy can be very tricky. The Direct Approach (which you and the standard answer apparently used different varieties of), recursion, and Inclusion-Exclusion. It would be very educational for you to embrace the methodology of the standard answer, achieve that answer with your approach, and then rinse and repeat with Inclusion-Exclusion. Then, rinse and repeat with recursion. – user2661923 Feb 08 '22 at 08:01
  • so, subtracting $3$ times works as $102960 - 3\times 3960$ $=$ $91080$. My guess for the inclusion-exclusion method would be subtracting number of words containing $0,1$ and $2$ $CA$ pairs from total number of words (is this the method you're stating above?): https://bit.ly/3owOY7k (calculations). Still, how do you solve this using recursions? – AlastorMoody Feb 08 '22 at 08:46
  • No, first see this answer. In the linked answer, concentrate only on the Inclusion-Exclusion theory, and ignore the Stars and Bars theory. Using the syntax from the linked answer, one approach is to let $A_k$ denote the set of all $16$ character words, that contain $3$ or more CA pairs, where the first pair starts on position $k$. ...see next comment – user2661923 Feb 08 '22 at 09:42
  • Then, you would want $$\left[\sum_{1 \leq i_1 \leq 11} |A_{i_1}|\right] ~-~ \left[\sum_{1 \leq i_1 < i_2 \leq 11} |A_{i_1} \cap A_{i_2}|\right].$$ Note that this approach takes advantage of your being limited to $4$ C's. – user2661923 Feb 08 '22 at 09:42
  • As far as recursion goes, that is a very complicated answer. Rather than my going to the trouble of crafting a (somewhat artificial) recursion approach, for this particular problem, I suggest that you examine mathSE problems where recursion was used. You might also, look for a Combinatorics book that includes a discussion of recursion. For some problems, recursion is by far the easiest approach. – user2661923 Feb 08 '22 at 09:46
  • I have a question. Wouldn't $A_{i_1} \cap A_{i_2}$ be a null set, as this set, by definition, includes all those $16$ letter words that have their first $CA$ pair on position $i_1$ as well as on position $i_2$ which is a contradiction (if any such string of letters existed)? – AlastorMoody Feb 08 '22 at 11:28
  • Yes, that is part of the point. Many of the $A_{i_1} \cap A_{i_2}$ sets would be the empty set. For additional example, consider $A_1 \cap A_{i_2}$, where $i_2$ is any element in ${2,4,5,6,7,8,9,10,11}.$ – user2661923 Feb 08 '22 at 18:03

1 Answers1

2

Your approach overcounts four-pair cases, as noted in comments, and fixing it leads to the inclusion/exclusion approach. Forming four CA pairs leaves one As and seven Bs for an initial total of $$\binom{12}{4,1,7}=3960$$ We counted the four-pair cases four times, for there are four CA pairs and we must pick one to split to get a three-pair case, and we only want to count them once, so we subtract three times this number from $102960$ to get the correct answer of $91080$.

This problem is simple enough to be solved additively and subtractively (through inclusion/exclusion) that recursion is totally unsuitable.

Parcly Taxel
  • 103,344
  • Agreed that recursion is the wrong approach for this problem. However, this is a good problem to learn recursion on, to see how different methods reach the same answer. This potentially puts an additional Combinatorics weapon in the OP's (i.e. original poster's) arsenal. – user2661923 Feb 08 '22 at 10:46