Reasoning ยท Lesson 3

Coding & Decoding

Spies, soldiers and computers all hide messages in codes. In this lesson you become a code-breaker: find the secret rule from one example, then use it to write or read any word.

~40 min read7 quick checksTest: 20 questions
Aโ†’B Zโ†’A

1What is coding? The 4-step method

Coding means changing a word into a secret form using a fixed rule. Decoding means turning the secret form back into the real word. In every question you get one example (the key), like CAT โ†’ DBU, and must use its rule on a new word.

The 4-step method

  1. Line up the word and its code, letter under letter. Check if they have the same number of letters.
  2. Write the move for each letter: +1, โˆ’2, opposite, or โ€œjumped to another placeโ€. Use positions (EJOTY!).
  3. Name the rule: same move for all? moves growing? letters reversed? Check it on every letter.
  4. Apply the rule to the new word โ€” and for decoding, do the moves backwards.
C+1DA+1BT+1UD+1EO+1PG+1H
CAT โ†’ DBU: every letter moves one place forward (+1). So DOG โ†’ EPH.
๐Ÿ’ก Speed trick: repeated letters

A letter that repeats in the word usually repeats in the code too. BOOK has โ€œOOโ€ in the middle, so its code should have a double letter in the same places. Use this to cross out options in seconds.

2Letter-shift codes (+n and โˆ’n)

The most common code moves every letter forward or backward by the same number of places. Julius Caesar is said to have used a +3 shift for his secret army messages, so this is often called the Caesar cipher.

Aโ†“BBโ†“CCโ†“DDโ†“EEโ†“FFโ†“GGโ†“HHโ†“IIโ†“JJโ†“KKโ†“LLโ†“MMโ†“NNโ†“OOโ†“PPโ†“QQโ†“RRโ†“SSโ†“TTโ†“UUโ†“VVโ†“WWโ†“XXโ†“YYโ†“ZZโ†“A
A +1 code table. Find the real letter on top and read its code below. After Z comes A again.
โœ๏ธ Worked example (+2)

If COW is coded as EQY, how is GOAT coded?

  1. C โ†’ E (+2), O โ†’ Q (+2), W โ†’ Y (+2). Rule: +2.
  2. G + 2 = I, O + 2 = Q, A + 2 = C, T + 2 = V.
  3. Answer: IQCV.
โœ๏ธ Worked example (โˆ’1)

If MILK is coded as LHKJ, how is TEA coded?

  1. M โ†’ L, I โ†’ H, L โ†’ K, K โ†’ J: each letter goes one back (โˆ’1).
  2. T โˆ’ 1 = S, E โˆ’ 1 = D, A โˆ’ 1 = Z (before A comes Z).
  3. Answer: SDZ.
ABCDEFGHIJKLMNOPQRSTUVWXYZ+3+3After Zcomes A again
Wrap-around: with a +3 code, X โ†’ A, Y โ†’ B and Z โ†’ C. So XYZ is coded ABC, and ZOO with +1 becomes APP.

Decoding: run the rule backwards

โœ๏ธ Worked example

In a code, every letter is written as the letter 3 places after it. What real word does the code FDW stand for?

  1. Coding added 3, so decoding must subtract 3.
  2. F โˆ’ 3 = C, D โˆ’ 3 = A, W โˆ’ 3 = T.
  3. The real word is CAT. Check: C + 3 = F, A + 3 = D, T + 3 = W โœ”.
โš ๏ธ Olympiad trap: wrong direction

When the question gives the code and asks for the real word, you must move the opposite way. Setters always put the โ€œwrong-directionโ€ answer in the options (for FDW that would be IGZ). Tip: a real word must be a real word โ€” IGZ isn't one!

If COW is coded as DPX, how is HEN coded?

  1. IFO
  2. GDM
  3. IGO
  4. JFO
C โ†’ D, O โ†’ P, W โ†’ X: every letter +1. H + 1 = I, E + 1 = F, N + 1 = O โ†’ IFO. GDM moves the wrong way.

In a code, each letter is replaced by the letter 2 places before it. Which real word is written as ZYJJ?

  1. XWHH
  2. BALL
  3. DCNN
  4. CBMM
Coding went 2 back, so decoding goes 2 forward: Z โ†’ A โ†’ B, Y โ†’ Z โ†’ A, J โ†’ L, J โ†’ L. The word is BALL. (XWHH moves the wrong way.)

3Codes where the shift changes

If the moves are not all the same, write them in a row. They usually make a simple pattern.

C+1DA+2CT+3WS+1TEโˆ’1DA+1BTโˆ’1Sgrowingtaking turns
Two common patterns: growing shifts (+1, +2, +3) and alternating shifts (+1, โˆ’1, +1, โˆ’1).
โœ๏ธ Worked example (growing shifts)

If CAT is coded as DCW, how is PIG coded?

  1. C โ†’ D is +1, A โ†’ C is +2, T โ†’ W is +3.
  2. P + 1 = Q, I + 2 = K, G + 3 = J.
  3. Answer: QKJ.
โœ๏ธ Worked example (alternating shifts)

If SEAT is coded as TDBS, how is LAMP coded?

  1. S โ†’ T (+1), E โ†’ D (โˆ’1), A โ†’ B (+1), T โ†’ S (โˆ’1). The moves take turns: +1, โˆ’1.
  2. L + 1 = M, A โˆ’ 1 = Z, M + 1 = N, P โˆ’ 1 = O.
  3. Answer: MZNO.
โœ๏ธ Worked example (olympiad level: reverse + shift)

If RAIN is coded as OJBS, how is SNOW coded?

  1. Line up: R โ†’ O, A โ†’ J, I โ†’ B, N โ†’ S. These moves (โˆ’3, +9, โˆ’7, +5) make no pattern. When that happens, try reversing the word.
  2. RAIN reversed is NIAR. Now N โ†’ O, I โ†’ J, A โ†’ B, R โ†’ S: every letter +1. โœ” Rule: reverse, then +1.
  3. SNOW reversed is WONS. +1 โ†’ XPOT.
๐Ÿ’ก Tip

If the moves look random, check two things: is the code the reverse of the word (with or without a shift)? Or has each letter become its opposite? One of these almost always explains it.

If RAIN is coded as OJBS, how is SNOW coded?

  1. WONS
  2. TOPX
  3. VMNR
  4. XPOT
Reverse the word, then move every letter +1: SNOW โ†’ WONS โ†’ XPOT. TOPX forgot to reverse; WONS forgot the +1.

4Reverse, opposite and jumbled-position codes

Reverse codes

The word is written backwards: PLAY โ†’ YALP, STOP โ†’ POTS.

Opposite-letter codes

Each letter becomes its opposite (A โ†” Z, B โ†” Y โ€ฆ M โ†” N). Use 27 โˆ’ position.

โœ๏ธ Worked example

In a code, A is written as Z, B as Y, C as X, and so on. How is HELP written?

  1. H = 8 โ†’ 27 โˆ’ 8 = 19 โ†’ S.
  2. E = 5 โ†’ 22 โ†’ V; L = 12 โ†’ 15 โ†’ O; P = 16 โ†’ 11 โ†’ K.
  3. Answer: SVOK.
๐ŸŒŸ Did you know?

The opposite-letter code is very old. It is called Atbash and was first used with the Hebrew alphabet. A neat property: coding twice gives back the original word, because the opposite of the opposite is the letter itself!

Jumbled-position codes

Sometimes no letter changes โ€” the letters just move to new places. Number the positions and watch where each one goes.

T1AA2TB3LL4BE5E
TABLE โ†’ ATLBE: letters are swapped in pairs (1st โ†” 2nd, 3rd โ†” 4th); the last letter stays.
RuleExampleApply to
Swap each pairTABLE โ†’ ATLBEPLANT โ†’ LPNAT
First letter moves to the endCHAIR โ†’ HAIRCWATER โ†’ ATERW
Reverse each halfPENCIL โ†’ NEPLICGARDEN โ†’ RAGNED
First two letters move to the endTIGER โ†’ GERTISPOON โ†’ OONSP
โœ๏ธ Worked example (picking letters)

If BOMBAY is written as MYMYMY, how is TAMILNADU written?

  1. Number BOMBAY: B1 O2 M3 B4 A5 Y6. The code uses the 3rd and 6th letters (every 3rd letter), โ€œMYโ€, repeated 3 times.
  2. Number TAMILNADU: T1 A2 M3 I4 L5 N6 A7 D8 U9. Every 3rd letter: M, N, U.
  3. Repeat โ€œMNUโ€ 3 times: MNUMNUMNU.

In a code, A is written as Z, B as Y, C as X, and so on. How is FISH written?

  1. GJTI
  2. UHRS
  3. URHS
  4. HSIF
F (6) โ†’ 21 = U, I (9) โ†’ 18 = R, S (19) โ†’ 8 = H, H (8) โ†’ 19 = S. FISH โ†’ URHS. (UHRS has the middle letters swapped.)

5Number and symbol codes

Letters as numbers

TypeRuleExample
Position codeA = 1, B = 2 โ€ฆ Z = 26FACE โ†’ 6-1-3-5 ยท 8-1-20 โ†’ HAT
Reverse position codeZ = 1, Y = 2 โ€ฆ A = 26 (use 27 โˆ’ n)CAT โ†’ 24-26-7
Sum codeAdd all the letter positionsBED โ†’ 2 + 5 + 4 = 11
Given tableEach letter gets the digit you are toldT = 4, R = 7, A = 1, P = 9 โ†’ PART = 9174
โœ๏ธ Worked example (sum code)

In a code, BED is written as 11 and BAG as 10. How is FACE written?

  1. Test the sum idea: BED = 2 + 5 + 4 = 11 โœ”; BAG = 2 + 1 + 7 = 10 โœ”.
  2. FACE = F (6) + A (1) + C (3) + E (5).
  3. Answer: 15.
โœ๏ธ Worked example (given table)

If T = 4, R = 7, A = 1 and P = 9, how is TRAP written?

  1. Replace one letter at a time, keeping the order: T โ†’ 4, R โ†’ 7, A โ†’ 1, P โ†’ 9.
  2. Answer: 4719.
โš ๏ธ Olympiad trap

In a sum code, words with the same letters in a different order get the same number: DOG = 4 + 15 + 7 = 26 and GOD = 26 too. Don't expect the number to change just because the order did.

Symbol codes

Digits or letters can be swapped for symbols. Replace carefully, one by one, and keep the order.

Digit1258
Symbolโ– โ—โ˜…โ–ฒ
โœ๏ธ Worked example

Using the table, how is 2851 written? And what number is โ˜…โ– โ—?

  1. 2 โ†’ โ—, 8 โ†’ โ–ฒ, 5 โ†’ โ˜…, 1 โ†’ โ– . So 2851 = โ—โ–ฒโ˜…โ– .
  2. Decode: โ˜… โ†’ 5, โ–  โ†’ 1, โ— โ†’ 2. So โ˜…โ– โ— = 512.

Using A = 1, B = 2, โ€ฆ, Z = 26, a word's code is the sum of its letters. If DOG = 26, what is GOD?

  1. 62
  2. 26
  3. 25
  4. 27
GOD has exactly the same letters as DOG: 7 + 15 + 4 = 26. The order doesn't change a sum.

6Word-substitution codes (โ€œis calledโ€)

In these puzzles, real things get new names. The question asks about the real world, but you must answer with the new name.

real nameis calledwaterfoodfoodtreetreeskyskywallWe drink water โ†’ answer: food
Draw arrows from the real name to its code name. We drink water, and water is called โ€œfoodโ€, so the answer is food.
โœ๏ธ Worked example

If water is called food, food is called tree, tree is called sky and sky is called wall, then (a) what do we drink? (b) where do birds fly?

  1. (a) In real life we drink water. Find water on the left of an arrow: water โ†’ food. Answer: food.
  2. (b) In real life birds fly in the sky. Sky โ†’ wall. Answer: wall.
โš ๏ธ Olympiad trap

Two traps hide here. (1) Answering with the real word (โ€œwaterโ€) โ€” the question wants the code name. (2) Following the chain too far (water โ†’ food โ†’ tree). Take only one step: the word that the real thing โ€œis calledโ€.

If pen is called pencil, pencil is called eraser, eraser is called sharpener and sharpener is called box, what do we use to rub out a pencil mistake?

  1. eraser
  2. pencil
  3. box
  4. sharpener
In real life we rub out mistakes with an eraser. Eraser is called โ€œsharpenerโ€, so the answer is sharpener.

7Code languages: sentences in code

Here each word of a sentence has a code word, but the code words may be jumbled. Use the common-word method: if two sentences share one word, they share one code, and that code belongs to that word.

1redbigball=lapata2ballisround=tasimro3bigroundtree=paroneball = ta ยท big = pa ยท round = ro โ†’ red = la
โ€œballโ€ is in sentences 1 and 2, and so is โ€œtaโ€ โ€” so ball = ta. โ€œbigโ€ is in 1 and 3 with โ€œpaโ€; โ€œroundโ€ is in 2 and 3 with โ€œroโ€.
โœ๏ธ Worked example

'la pa ta' means 'red big ball'; 'ta sim ro' means 'ball is round'; 'pa ro ne' means 'big round tree'. What is the code for red?

  1. Sentences 1 and 2 share โ€œballโ€ and share โ€œtaโ€ โ†’ ball = ta.
  2. Sentences 1 and 3 share โ€œbigโ€ and share โ€œpaโ€ โ†’ big = pa.
  3. Sentence 1 is 'red big ball' = 'la pa ta'. Take away pa and ta โ†’ red = la.
  4. Bonus: round = ro (2 and 3), so is = sim and tree = ne.
๐Ÿ“Œ Remember

The position of a code word does not tell you its meaning โ€” in 'la pa ta' the code for 'ball' is last, but in 'ta sim ro' it is first. Always compare sentences.

'jo ne ra' means 'come here now' and 'ra pi lo' means 'now go away'. What is the code for now?

  1. jo
  2. ne
  3. ra
  4. pi
โ€œnowโ€ is the only word in both sentences, and โ€œraโ€ is the only code in both. So now = ra.

8Code-breaker's checklist and traps

  1. Count letters. Same length? Letters changed or moved. Different length? Letters were picked or repeated (BOMBAY type).
  2. Try the easy moves first: +1, โˆ’1, +2, โˆ’2, then opposite (27 โˆ’ n), then reverse.
  3. Write every move. Growing (+1, +2, +3)? Alternating (+1, โˆ’1)? Nothing? Reverse the word and try again.
  4. Apply to the new word letter by letter. Remember wrap-around: after Z comes A.
  5. Decoding? Do the moves backwards, then check your answer by coding it forward again.
  6. Check all letters of your chosen option โ€” the wrong options usually get only the first one or two letters right.
Remember: โ€œCount โ€“ Compare โ€“ Crack โ€“ Check.โ€ Count the letters, compare word and code letter by letter, crack the rule, and check your answer by running the rule again.
โš ๏ธ Olympiad trap: the first-letter trick

For โ€œDOG โ†’ ?โ€ with a +1 code, options might be EPH, EPG, EOH and FPH. All start with E except one, so looking only at the first letter doesn't help. Check every letter: D + 1 = E, O + 1 = P, G + 1 = H โ†’ EPH.

Explore more

9Quick recap

Flip cards

Question+1 code for ZOO?
AnswerAPP (Z wraps to A)
QuestionOpposite-letter code for BOY?
AnswerYLB (Bโ†”Y, Oโ†”L, Yโ†”B)
QuestionIn a โˆ’1 code, which real word is SNX?
AnswerTOY (decode by going 1 forward)
QuestionA = 1 code: 3-1-18
AnswerCAR
QuestionSum code of ACE?
Answer9 (1 + 3 + 5)
QuestionSTOP is coded POTS. How is SPIN coded?
AnswerNIPS (reverse)
QuestionCat is called dog, dog is called cow. Which animal barks?
Answercow (a dog barks; dog is called cow)
QuestionWith a +2 code, what real word is JQV?
AnswerHOT (go 2 back)