Maths Olympiad Prep

Library / /88 of 740

, 2018

Combinatorics Difficulty 4.6 AIME Find the answer United States

Problem:

Abbot writes the letter AA on the board. Every minute, he replaces every occurrence of AA with ABA B and every occurrence of BB with BAB A, hence creating a string that is twice as long. After 10 minutes, there are 210=10242^{10}=1024 letters on the board. How many adjacent pairs are the same letter?

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Solution:

Answer: 341
Let ana_{n} denote the number of adjacent pairs of letters that are the same after nn minutes, and bnb_{n} the number of adjacent pairs that are different.

Lemma 1. an=bn1a_{n}=b_{n-1} for all n0n \geq 0.

Proof. Any adjacent pair of identical letters XXX X at stage nn either came from the same letter of stage n1n-1 (WXXW \rightarrow X X), or two adjacent letters of stage n1n-1 (VWMXXNV W \rightarrow M X X N). Because AABA \rightarrow A B and BBAB \rightarrow B A, they cannot have come from the same letter.

If they came from a pair of adjacent letters, then observing what each adjacent pair of letters results in in the next minute,
AAABABABABBABABAABBBBABA \begin{aligned} & A A \rightarrow A B A B \\ & A B \rightarrow A B B A \\ & B A \rightarrow B A A B \\ & B B \rightarrow B A B A \end{aligned}
we see that our adjacent pair VWV W must have been ABA B or BAB A. The number of such pairs is precisely bn1b_{n-1}.

From the relation an+bn=2n1a_{n}+b_{n}=2^{n}-1 for all n0n \geq 0, we obtain the recurrence relation
an=2n11an1 a_{n}=2^{n-1}-1-a_{n-1}
from which we obtain values a0=0,a1=0,a2=1,a3=2,a4=5,a5=10,a6=21,a7=42a_{0}=0, a_{1}=0, a_{2}=1, a_{3}=2, a_{4}=5, a_{5}=10, a_{6}=21, a_{7}=42, a8=85,a9=170a_{8}=85, a_{9}=170, and a10=341a_{10}=341.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.