The concept
Start with something familiar
As kids, many of us passed secret notes in class: "IFMMP" for "HELLO", each letter moved one step along the alphabet. Anyone who knew the rule could read it. Anyone who didn't saw nonsense.Coding-decoding questions give you one word and its code, and ask you to find the rule and apply it to another word. The rule is almost always one of a handful of patterns. Your job is to test the right patterns quickly, and to check the rule on every letter before you trust it.Idea 1: turn letters into numbers, A = 1 to Z = 26
Every pattern is easier to see with numbers. Learn the positions, using the anchor word EJOTY: E, J, O, T and Y sit at 5, 10, 15, 20 and 25. Any other letter is a step or two from one of them.| Anchor | Position | Opposite | Position |
|---|---|---|---|
| E | 5 | V | 22 |
| J | 10 | Q | 17 |
| O | 15 | L | 12 |
| T | 20 | G | 7 |
| Y | 25 | B | 2 |
Key idea
A = 1 to Z = 26, anchored by EJOTY (5, 10, 15, 20, 25). A letter and its opposite add to 27.
Example
What are the position and the opposite of R?
R is 3 after O (15), so R is 18. Its opposite is , which is I.
R is 3 after O (15), so R is 18. Its opposite is , which is I.
Idea 2: a constant shift moves every letter by the same number
The simplest code adds the same number to every letter's position. When you pass Z, wrap round to A, just like a clock passes 12.Remember to wrap after Z.Example
If CAT is coded as ECV, how is DOG coded?
C to E is , A to C is , T to V is . The shift is for every letter. DOG becomes FQI.
C to E is , A to C is , T to V is . The shift is for every letter. DOG becomes FQI.
Example
Code ZEBRA with a shift of +3.
Z wraps round: Z, A, B, C, so Z becomes C. Then E to H, B to E, R to U, A to D. ZEBRA is CHEUD.
Z wraps round: Z, A, B, C, so Z becomes C. Then E to H, B to E, R to U, A to D. ZEBRA is CHEUD.
Idea 3: the shift can change from letter to letter
If the first letter moves by and the second doesn't, the shift isn't constant. Write the shift for each position and look for a pattern in those shifts:| Pattern | Shifts | Example |
|---|---|---|
| Growing | GATE to HCWI | |
| Alternating | TIGER to UHHDS | |
| Constant | MANGO to PDQJR |
Example
If GATE is coded HCWI, how is EXAM coded?
G to H is , A to C is , T to W is , E to I is . Apply to EXAM: E to F, X to Z, A to D, M to Q. EXAM is FZDQ.
G to H is , A to C is , T to W is , E to I is . Apply to EXAM: E to F, X to Z, A to D, M to Q. EXAM is FZDQ.
Idea 4: opposite letters and reversed words are two more standard codes
Two codes don't shift at all:- Opposite letters: each letter becomes its partner from the other end (Idea 1). GATE becomes TZGV, because G and T, A and Z, T and G, E and V are opposite pairs.
- Reversed order: the word is written backwards, often combined with a shift.
Example
In a code, FRIEND is written EOFJSG. What's the rule?
The shifts F to E (), R to O () look random. Try reversing FRIEND: DNEIRF. Now D to E, N to O, E to F, I to J, R to S, F to G: all . The rule is reverse, then shift by +1.
The shifts F to E (), R to O () look random. Try reversing FRIEND: DNEIRF. Now D to E, N to O, E to F, I to J, R to S, F to G: all . The rule is reverse, then shift by +1.
Idea 5: in number codes, a word's number usually comes from its letter positions
When a word is coded as a single number, try the sum of positions first, then the sum of opposite positions:Here is the number of letters.Example
If CAT = 24, what is DOG?
, so the code is the sum of positions. DOG 26.
, so the code is the sum of positions. DOG 26.
How to spot which idea you need
| The question says... | Use |
|---|---|
| any letter code | Idea 1: write positions |
| every letter moves the same | Idea 2: constant shift, wrap after Z |
| shifts differ by position | Idea 3: pattern in the shifts |
| shifts look random | Idea 4: opposite pairs or reversed word |
| a word equals a number | Idea 5: sum or opposite sum |
Worked example 1warm-up
In a code, PAPER is written as QBQFS. How is PENCIL written in that code?Solution
Step 1. Positions and shiftsIdeas 1 and 2
P to Q, A to B, P to Q, E to F, R to S: every shift is .
Step 2. Apply to PENCILIdea 2
P to Q, E to F, N to O, C to D, I to J, L to M.
Step 3. Answer
QFODJM.
Step 4. Check
Every letter of PENCIL moved exactly one step, the same as every letter of PAPER.
Worked example 2GATE level
In a code, FRIEND is written as EOFJSG. How is CANDLE written in that code?Solution
Step 1. Try a direct shiftIdeas 2 and 3
F to E is , R to O is , I to F is . Not constant and no clear pattern.
Step 2. Try reversingIdea 4
FRIEND backwards is DNEIRF. Compare with EOFJSG: every letter moves .
Step 3. Apply to CANDLEIdeas 4 and 2
Reverse: ELDNAC. Shift each by : E to F, L to M, D to E, N to O, A to B, C to D.
Step 4. Answer and check
FMEOBD. Check with FRIEND: reversing and shifting gives E, O, F, J, S, G, exactly the given code. (Shifting CANDLE without reversing gives DBOEMF, a likely trap option.)
All the rules at a glance
| Idea | Rule |
|---|---|
| Positions | EJOTY = 5, 10, 15, 20, 25 |
| Opposites | position opposite |
| Constant shift | same for all, wrap after Z |
| Changing shift | read the shifts as a series |
| Reverse | write backwards, then test shifts |
| Number codes | sum, or sum |