
Related Articles
- We attempt to **count valid sequences by placing high-frequency letters first with separation**, then fill with others.
- Let’s suppose we place the **C’s** with no two adjacent.
- To place 3 C’s with no two adjacent in 8 positions: we first place 3 C’s such that there is at least one space between them.
- To place 3 non-consecutive positions: let the positions be $ x_1 < x_2 < x_3 $, with $ x_{i+1} \ge x_i + 2 $. Let $ y_i = x_i - (i-1) $, then $ y_1 < y_2 < y_3 $ in $ \{1,\dots,6\} $. So number is $ \binom{6}{3} = 20 $.
- For each such choice of 3 non-adjacent positions, we place 3 non-adjacent C’s.
- Now, from the remaining 5 positions, we must place 2 A’s and 3 G’s (since 3 C’s are placed), **with no two A’s adjacent and no two G’s adjacent** — but wait: the condition is **no two identical letters adjacent**, so A’s cannot be adjacent to A, G’s to G.