-1

I thought of subtraicing the cases when there are 2A followed from the cases with no restriction at all. So the case with no restriction is (37 choose 7)(30 choose 12). For the 2A case I thought of gathering the 2A's in a box. So I'd have 36 places to the box. Then I would just have to distribute the remaining objects. So the answer would be (37 choose 7)(30 choose 12) - 36(35 choose 12)(23 choose 18)

Afonso
  • 5

2 Answers2

2
  • Firstly arrange the B's and C's among themselves in $\binom{30}{12}$ ways
  • Now there are $31$ interstices (including ends) where the $7$ A's can be inserted without being adjacent
  • Thus desired ans $= \binom{31}7\binom{30}{12}$
0

Over-counting blues.

Consider any sequence that begins AAA---....

You count it once as AA----... and then count the same sequence again as -AA---....

One remedy is Inclusion-Exclusion. See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.

Because there are only 7 A's, the Inclusion-Exclusion approach is do-able. However, diagnosing/enumerating the various types of intersections referred to in the 2nd link above is no walk in the park.


A trickier, but more elegant approach is Stars and Bars. For Stars and Bars theory, see this article and this article.

Consider the following tableau:

--A----A---A----A---A----A-----A---...

In effect the 7 A's create $~(7+1) = 8~$ islands, one before the first A, and one after each of the 7 A's.

Let $~x_1, ~x_2, \cdots, ~x_8 ~$ denote the size of each of the respective islands, and consider the number of solutions to the following problem:

  • $~x_1 + x_2 + \cdots + x_8 = (37 - 7) = 30.~$

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

Per Stars and Bars Theory, the number of solutions equals

$$\binom{30 + [8-1]}{8-1} = \binom{37}{7}. \tag1 $$

The computation in (1) requires two refinements, in order to arrive at the desired computation.


$\underline{\text{Refinement} ~1}$

You must prevent any two A's from being right next to each other. The way to do this is to require that $~x_2, ~x_3, ~\cdots, ~x_7 ~$ are each $~\geq 1.~$ Note that having $~x_1 = 0,~$ (harmlessly) represents that the first element on the left hand side is an A, and having $~x_8 = 0~$ represents that the last element on the right hand side is an A.

The refinement is done via a change of variables:
for $~i \in \{2,3,\cdots,7\},~$ let $~y_i = x_i - 1.~$

Then, consider the number of solutions to:

  • $x_1 + {\color{red}{y_2 + y_3 + \cdots + y_7}} + x_8 = (30 - 6) = 24.$

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

  • $y_2, ~y_3, \cdots, y_7 \in \Bbb{Z_{\geq 0}}.$

Per Stars and Bars theory, the number of solutions is

$$\binom{24 + [8-1]}{8-1} = \binom{31}{7}. \tag2 $$


$\underline{\text{Refinement} ~2}$

The expression in (2) above merely represents the number of satisfying ways that the A's can be placed. For each such satisfying distribution of the A's, you will then have $~\displaystyle \binom{30}{12}~$ ways of placing the remaining letters.

Therefore, the final answer is

$$\binom{31}{7} \times \binom{30}{12}.$$

user2661923
  • 35,619
  • 3
  • 17
  • 39