Example 5 In coin tossing, if Z represents heads and F represents tails, then the sequence of coin tosses is represented by a string composed of Z and F. We can count the number of occurrences of heads followed by tails (ZF), heads followed by heads (ZZ)...... For example, the sequence ZZFFZZZZFZZFFFF is the result of 15 coin tosses, which includes 5 ZZ, 3 ZF, 2 FZ, and 4 FF. How many sequences of 15 coin tosses have exactly 2 ZZ, 3 ZF, 4 FZ, and 5 FF?
(4th American Invitational Mathematics Examination (AIME))
Solution
Solution: The sequences that meet the requirements have the following two possible forms:
(1) Starting with F: ;
(2) Starting with Z: .
Since the sequence is required to have exactly 3 , if the sequence belongs to (2), it should have the form
which contains only 2 , failing to meet the requirement of 4 . Therefore, the sequence that meets the requirements can only be of form (1).
Since the sequence has exactly 4 , when considering the sequence with exactly two ZZ, it can be divided into the following two categories: ZZZ
Z, ZZ ZZ Z Z
and the different positions of , with the spaces filled with .
Let the number of in each space be , , , , then has positive integer solutions.
On the other hand, for (1), the position of ZZZ has 4 possibilities, and for (2), the arrangement of has 6 possibilities, so the arrangement of has 10 possibilities.
Therefore, the number of sequences that meet the requirements is