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
- A)
- B)
- C)
- D)
- E)
Answer
D
Key insight
The final s is the 12th s in the message, so it shifts by 1 + 2 + ... + 12 = 78, a multiple of 26, and stays s.
Solution
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 .
Why this works
A cyclic alphabet means shifts only matter modulo , so the question reduces to a triangular number mod . The real risk is clerical: count the occurrences carefully, and reduce the shift before trying to step through the alphabet.
The trap
Miscounting the number of s's (the two in 'Mississippi' pairs and the double s in 'Chriss' are easy to drop) and shifting by the wrong triangular number.
Common mistakes
- Miscounting the number of s's (the two in 'Mississippi' pairs and the double s in 'Chriss' are easy to drop) and shifting by the wrong triangular number.
- Shifting by rather than by , which lands on and is not even a choice.
Techniques
Set up the equation/formula and compute; no special trick needed