2007 AMC 10B Problem 9
A cryptographic code is designed as follows. The first time a letter appears in a given message it is replaced by the letter that is place to its right in the alphabet (asumming that the letter is one place to the right of the letter ). The second time this same letter appears in the given message, it is replaced by the letter that is places to the right, the third time it is replaced by the letter that is places to the right, and so on. For example, with this code the word "banana" becomes "cbodqg". What letter will replace the last letter in the message
Show solution without answering
Key insight
The last s is the 12th s, so it moves 1 + 2 + ... + 12 = 78 places, exactly three trips around the alphabet.
Solution
Two jobs: find which appearance of the last one is, then work out how far it moves.
- Count the 's word by word:
| word | Lee's | sis | is | a | Mississippi | miss | Chriss |
|---|---|---|---|---|---|---|---|
| number of | 1 | 2 | 1 | 0 | 4 | 2 | 2 |
| running total | 1 | 3 | 4 | 4 | 8 | 10 | 12 |
The last is the th one.
2. The th appearance moves places. Pair the numbers from the outside in: , , and so on, six pairs of . So the shift is
3. The alphabet has letters, and moving places brings a letter back to itself. Since , the letter goes around three full times and stops where it started.
4. So the last becomes .
The answer is .
Why this works
With a wrap-around alphabet, only the leftover after taking out full trips of matters. Figure out the total shift first and remove the full trips, rather than stepping letter by letter. Most of the danger in this problem is simply counting the 's correctly, so a table is worth the few seconds.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
First count how many times the letter appears, word by word:
| word | Lee's | sis | is | a | Mississippi | miss | Chriss |
|---|---|---|---|---|---|---|---|
| number of | 1 | 2 | 1 | 0 | 4 | 2 | 2 |
Running total: . The final is the th occurrence.
The th occurrence of a letter moves places to the right. For this is .
Since the alphabet has letters, a shift of brings the letter all the way around three full times and back to where it started. The last is replaced by itself.
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Introduction to Algebra, Chapter 21: Sequences & Series (§21.1, §21.2, §21.3, §21.4)
- Introduction to Number Theory, Chapter 10: Units Digits
- Intermediate Algebra, Chapter 17: More Sequences and Series (§17.1, §17.2)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.