 # Problem of the Week Problem D and Solution Scavenger Hunt

## Problem

Kavi is creating a scavenger hunt for his younger siblings where the clues are all names of places in Canada. To make it more challenging, he encrypts each clue using a homemade cipher machine. He starts with two strips of paper, each with a length equal to the circumference of a paper tube. One paper contains a column of letters and the other contains a column of symbols with an arrow pointing to each symbol, as shown.  He wraps each strip of paper around his tube and tapes them so that the paper with the letters can rotate around the tube but the paper with the symbols is fixed in place. The paper with the letters is called the left rotor and the paper with the arrows and symbols is called the right rotor.

Kavi follows the steps below to encrypt his clues using his cipher machine.

1. Rotate the left rotor so that the letter T points to the symbol $$\diamond$$. This is the "start position".

2. Encrypt the first letter in the message by following the arrow from the letter to the symbol. For example, the letter W would be encrypted as $$\bigtriangledown$$.

3. Rotate the left rotor up one position and encrypt the second letter in the message. For example, the letter A would be encrypted as $$\bullet$$.

4. Rotate the left rotor up two positions and encrypt the third letter in the message. For example, the letter W would be encrypted as $$\bowtie$$.

5. Rotate the left rotor up three positions and encrypt the fourth letter in the message. For example, the letter A would be encrypted as $$\diamond$$.

6. Continue the procedure of rotating the left rotor up $$n$$ positions and encrypting the $$(n+1)^\textrm{th}$$ letter in the message until all letters in the message have been encrypted.

Kavi’s clue "WAWA" would therefore be encrypted as $$\bigtriangledown \bullet \bowtie \diamond$$.

Follow the steps to encrypt Kavi’s clue "BATCHAWANABAY".

## Solution

Let the start position of the left rotor be Position $$0$$. If the left rotor is in Position $$1$$, the letters have moved $$1$$ position up from the start position. If the left rotor is in Position $$2$$, the letters have moved $$2$$ positions up from the start position. Since there are $$9$$ letters on the rotor, it follows that there are only $$9$$ positions that the left rotor can be in. After moving $$9$$ positions up, the letters will be back in the start position, or Position $$0$$. Thus, after moving $$9$$ positions or more, we can determine the position number of the left rotor by subtracting multiples of $$9$$ from the total number of positions moved until we obtain a position number between $$0$$ and $$8$$. We do this in the following table.

Letter to Encrypt Number of Positions Moved Before Encryption Position Number
B $$0$$ $$0$$
A $$0+1=1$$ $$1$$
T $$1+2=3$$ $$3$$
C $$3+3=6$$ $$6$$
H $$6+4=10$$ $$10-9=1$$
A $$10+5=15$$ $$15-9=6$$
W $$15+6=21$$ $$21-18=3$$
A $$21+7=28$$ $$28-27=1$$
N $$28+8=36$$ $$36-36=0$$
A $$36+9=45$$ $$45-45=0$$
B $$45+10=55$$ $$55-54=1$$
A $$55+11=66$$ $$66-63=3$$
Y $$66+12=78$$ $$78-72=6$$

It turns out that we need only four positions of the left rotor, namely Positions $$0,~1,~3,$$ and $$6$$. These are shown below.

Position $$0$$ Position $$1$$ Position $$3$$ Position $$6$$ To encrypt the first letter of the clue "BATCHAWANABAY", the left rotor is in Position $$0$$ and the B is encrypted as $$\star$$. To encrypt the second letter, the left rotor is in Position $$1$$ and the A is encrypted as $$\bullet$$. In this way, we can encrypt the clue "BATCHAWANABAY" as $$\star \bullet \wedge \bowtie \bigtriangledown \diamond \bowtie \bullet \bullet \wedge \pi \star \pi$$.

Extension:

In our example, there were $$9$$ letters on the left rotor and $$9$$ symbols on the right rotor. The cycle of positions used on the left rotor caused only Positions $$0,~1,~3,$$ and $$6$$ of the left rotor to be used. Is there a size of rotor that would require all positions of the rotor to be used in the encryption process? Experiment with a few different sizes.