Concepts · Coding and decoding
One letter and its code can tell you the whole code. Check every letter, then go.
Kabir has a coding question in a mock test:
BOOK is coded as DQQM. How is DESK coded?
He goes looking for something clever. Opposite letters? B and D are not opposites. The word backwards? No. A different rule for each letter? By the time he gives up, two minutes have gone, and he guesses.
Every Monday the class teacher rotates the rows, so that everyone gets a turn at the front: every row number goes up by the same amount (row 1 is at the front, by the board), and the back rows come round to the front. This Monday she only says, “Kabir, row 5,” and goes back to her register.
Kabir was in row 3, so his row number went up by two. And if every row moves the same, he does not need to watch anyone else: row 4 goes to row 6, and row 6 has nowhere to go but round to the front, to row 2.
One move, his own, told him where every row goes. All he needed to know was that every row moves the same.
In a shift code every letter moves the same number of places. Find the step from one letter to its code, then check it on every other letter: a word has only a few. If they all agree, move every letter of the new word by that step.
Forward is towards Z and backward is towards A. Past either end, the alphabet goes round, like the rows: one step past Z is A, and one step before A is Z.
The step without counting on your fingers: Letter positions. Going round the end: Wrapping past Z.
Sometimes the question gives the code and asks for the word. Then move the other way. If a code moves every letter two forward and reads HQQF, each letter of the word is two back from its code letter: F, O, O, D. FOOD.
And if the letters do not all agree, it is not a shift code. Stop counting and try another kind, such as opposite letters.
A word has only a few letters, so checking all of them is short work. If they agree, the code is solved. If they do not, you know at once to try another kind of code.
1. If MILK is coded as NJML, how is CAKE coded?
M to N is how many steps? Check it on I and L.
DBLF
M → N, I → J, L → M: one step forward each time.
So CAKE moves one forward: C → D, A → B, K → L, E → F. DBLF.
2. If FISH is coded as CFPE, how is BOAT coded?
Check the direction: is F to C forward or backward? And what comes three before B?
YLXQ
F → C, I → F, S → P: three steps back each time.
B three back is A, Z, Y: the alphabet goes round. O → L, A → X, T → Q. YLXQ. (ERDW moves forward instead of back.)
3. In a code, every letter of a word is moved two places forward. The code is JQOG. What is the word?
The code moved forward, so the word is two places back.
HOME
Decoding goes the other way: two places back.
J → H, Q → O, O → M, G → E. HOME. (LSQI moves forward a second time.)
A week later, Riya tries him with one:
PEN is coded as RGP. How is INK coded?
Kabir counts P → R, E → G, N → P: two, two, two. INK, two forward: K, P, M. He writes KPM.
Coding and decoding is one of the app’s topics. Every question there is answered before its solution shows.
Get started