Coding-Decoding
Reasoning · Verbal Reasoning
Imagine you pass a secret note to a friend in class so that nobody in between can read it. You change the letters by a fixed rule, and your friend runs the same rule backwards to read it. That is coding (writing in code) and decoding (reading the code).
In the exam the rule is never announced. You get one or two examples and must find out by what rule the letters or numbers were changed; then you apply that rule to a new word. So this chapter is about recognising patterns, not memorising.
If reasoning is new to you, do not worry — we start from zero. First we build an alphabet toolkit that gives the place of any letter at a glance; then we take one type of code at a time; and finally we mix all types for practice.
How to use this chapter
- Read — each part first explains the idea, then shows how to spot the rule.
- Study the solved example — in the boxes marked “Example” the full solution is open, step by step. At every step ask: why was this step taken?
- Try it yourself — in the “Try it yourself first” questions the solution is hidden. Solve on paper first, then choose an option. A wrong pick is fine; pick again. If stuck, take the hint, and open the solution only at the very end.
- Know the level — every question is marked Basic, Standard or Advanced. Make the basic ones solid first, then move on.
Foundation — codes and the alphabet toolkit
The vocabulary of codes, four steps to find a rule, the order of the alphabet and the pairs of opposite letters.
What a code is and how to find its rule
The vocabulary of codes and the four-step method to find a rule.
A code means changing a word into another form by a fixed rule. Four things appear in this whole game:
| Term | Meaning | Example |
|---|---|---|
| Original word | The word that gets changed | CAT |
| Code | The changed form | DBU |
| Rule | The fixed way of changing | every letter one place forward |
| Decoding | Getting the original word back from the code | DBU → CAT |
In every question the rule is not given — you have to find it. Make a habit of these four steps:
- 1Write each letter of CAT against its code letter: C→D, A→B, T→U.
- 2Counting the places between each pair gives the rule: every letter is moved 1 place forward (+1).
- 3Now the same rule on DOG: D→E, O→P, G→H.
- 4So the code of DOG is EPH.
The order of the English alphabet
The places of the 26 letters, landmarks at every fifth letter and a quick way to count either way.
Code questions run on the places of letters — A is first, B second … Z is twenty-sixth. The full table is below. Under every letter there are two numbers: the upper one is the place counted from A, the lower one the place counted from Z.
| A | B | C | D | E | F | G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| From A | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| From Z | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 |
| N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| From A | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| From Z | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
Finding places without memorising the whole table
You do not need to memorise the whole table. Just remember five landmark letters, five places apart: E = 5, J = 10, O = 15, T = 20, Y = 25. Every other letter sits right next to a landmark.
- Place of R? The nearest landmark is T = 20; R is two steps before it, so 20 − 2 = 18.
- Place of M? Two steps before the landmark O = 15: 15 − 2 = 13.
- Place of W? Two steps before the landmark Y = 25: 25 − 2 = 23.
Going round the corner
While changing letters you often have to go past Z or before A. Think of the alphabet as a wheel: after Z comes A again, and one step back from A is Z. If the place goes above 26, subtract 26; if it goes below 1, add 26.
- 1Y is at place 25. 25 + 4 = 29.
- 229 is above 26, so subtract 26: 29 − 26 = 3.
- 3The letter at place 3 is C. (Y → Z → A → B → C, four steps.)
Opposite letters (A ↔ Z)
A letter and its “mirror”: the 13 pairs, a way to remember them and the “from the back” counting.
Fold the alphabet exactly in the middle so that A sits over Z, B over Y and so on. The two letters that meet are opposite letters. Their places always add up to 27, so the opposite of a letter = 27 − its place.
| A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Z | Y | X | W | V | U | T | S | R | Q | P | O | N |
| Pair | Places | Sum |
|---|---|---|
| A ↔ Z | 1 + 26 | 27 |
| B ↔ Y | 2 + 25 | 27 |
| C ↔ X | 3 + 24 | 27 |
| D ↔ W | 4 + 23 | 27 |
| E ↔ V | 5 + 22 | 27 |
| F ↔ U | 6 + 21 | 27 |
| G ↔ T | 7 + 20 | 27 |
| H ↔ S | 8 + 19 | 27 |
| I ↔ R | 9 + 18 | 27 |
| J ↔ Q | 10 + 17 | 27 |
| K ↔ P | 11 + 16 | 27 |
| L ↔ O | 12 + 15 | 27 |
| M ↔ N | 13 + 14 | 27 |
One important point: M and N are opposites of each other (13 + 14 = 27). So if M turns into N or N into M in a code, it is usually the opposite-letter code.
- 1H is at place 8.
- 2The opposite is at 27 − 8 = 19.
- 3The letter at place 19 is S. (Check: H + S = 8 + 19 = 27 ✔)
Letter codes
Changing each letter into another by a rule: shifting, opposite letters, changing shifts, rearranging letters, mixed rules and plain letter-to-letter matching.
When you meet a letter-code question, first recognise which type of code it is. Put the example word and its code face to face and match them with this table:
| What you notice | Type of code | Next part |
|---|---|---|
| The gap is the same in every pair | Fixed shift (+k or −k) | Shifting |
| Every pair adds up to 27 | Opposite letters | Opposite letters |
| The gap changes but in turn (+1, −1, +1 …) | Changing shift | Changing shift |
| The same letters in a new order | Arrangement of letters | Arrangement |
| Reversed order and changed letters | Mixed | Mixed rules |
| Letters changed with no counting rule | Direct matching | Direct matching |
Fixed shift — every letter moves equally
Moving every letter the same number of places forward (+) or back (−).
Here every letter moves the same number of places forward or back in the alphabet. +2 means A → C, B → D, C → E. To find the rule, take the first pair, work out the gap (go round from Z to A if needed) and then check that the other pairs show the same gap.
- 1Write each letter of YARD against its code letter: Y→B, A→D, R→U, D→G.
- 2Counting the places between each pair gives the rule: every letter is moved 3 places forward (+3).
- 3Now the same rule on ZONE: Z→C, O→R, N→Q, E→H.
- 4So the code of ZONE is CRQH.
- 1Write each letter of LAMP against its code letter: L→J, A→Y, M→K, P→N.
- 2Counting the places between each pair gives the rule: every letter is moved 2 places back (−2).
- 3Now the same rule on PARK: P→N, A→Y, R→P, K→I.
- 4So the code of PARK is NYPI.
- 1Comparing WIND with YKPF gives the rule: every letter is moved 2 places forward (+2).
- 2We must go from the code ICVG back to the word, so we run the rule in reverse.
- 3Running it backwards turns ICVG into GATE (I→G, C→A, V→T, G→E), so the word is GATE.
The opposite-letter code
Writing the opposite of every letter and spotting this code quickly.
In this code every letter is replaced by its opposite letter — the pair whose places add up to 27. It is easy to spot: if you see pairs like A↔Z and B↔Y, or the very first pair adds up to 27, that is the rule. This code is its own reverse — apply the same rule to the code and you get the original word back.
- 1Write each letter of SUN against its code letter: S→H, U→F, N→M.
- 2Counting the places between each pair gives the rule: every letter is replaced by its “opposite” letter (A↔Z, B↔Y, C↔X …; the two places add up to 27).
- 3Now the same rule on MAP: M→N, A→Z, P→K.
- 4So the code of MAP is NZK.
Changing shifts — different steps in turn
Codes with alternating, growing, half-and-half or vowel-versus-consonant shifts.
When the gap is not equal in every pair, do not panic — write down the list of gaps under the word, e.g. +1, −1, +1, −1. Whatever pattern you see is the rule.
| What the list looks like | Name of the rule | Example list |
|---|---|---|
| Two or three steps repeat in turn | Alternating shift | +1, −1, +1, −1 |
| Each step is one more than the last | Growing shift | +1, +2, +3, +4 |
| First half one step, second half another | Half and half | +2, +2, −1, −1 |
| Vowels and consonants take different steps | Vowel–consonant rule | vowels +1, consonants −1 |
- 1Write each letter of DOOR against its code letter: D→E, O→N, O→P, R→Q.
- 2Counting the places between each pair gives the rule: the letters are moved +1, −1 places in turn (the same pattern repeats).
- 3Now the same rule on SAND: S→T, A→Z, N→O, D→C.
- 4So the code of SAND is TZOC.
- 1Write each letter of LAMP against its code letter: L→M, A→C, M→P, P→T.
- 2Counting the places between each pair gives the rule: the first letter moves +1, and the shift grows by 1 with every next letter.
- 3Now the same rule on WIND: W→X, I→K, N→Q, D→H.
- 4So the code of WIND is XKQH.
- 1Write each letter of MILK against its code letter: M→L, I→J, L→K, K→J.
- 2Counting the places between each pair gives the rule: vowels move +1 and consonants move −1.
- 3Now the same rule on ROPE: R→Q, O→P, P→O, E→F.
- 4So the code of ROPE is QPOF.
Codes that rearrange the letters
Reversing the word, swapping the first and the last letters, and rotating the letters.
Some codes do not change the letters at all — they only change their places. How to spot it: count the letters of the code and of the word. If both have exactly the same letters, it is an arrangement code. Then see which letter went where.
| Method | Word | Code |
|---|---|---|
| Reverse the whole word | PLANT | TNALP |
| Move the last 2 letters to the front | PLANT | NTPLA |
| Swap the first and the last letters | PLANT | TLANP |
- 1Compare LEAF with FAEL. The letters are the same; only their places have changed — so this is an arrangement code.
- 2Rule: the letters of the word are written in reverse order.
- 3Applying the same rule to STAR gives RATS.
- 1Compare MOON with ONMO. The letters are the same; only their places have changed — so this is an arrangement code.
- 2Rule: the last 2 letters are taken and put in front of the word.
- 3Applying the same rule to RIVER gives ERRIV.
- 1Compare NEST with TESN. The letters are the same; only their places have changed — so this is an arrangement code.
- 2Rule: the first and the last letters have traded places.
- 3Applying the same rule to WOOL gives LOOW.
Mixed rules — two-step codes
When a code is built from two rules: what happened first, what next — and how to undo them.
Sometimes one code carries two rules — say the word is reversed first and then every letter moves one place forward. To spot it, look at the order first (does the code run backwards?), then at the gaps between letters. Checking the two separately opens the rule.
One more thing: when does order matter? When every letter moves equally (say all +1), “shift then reverse” and “reverse then shift” always give the same result. But when the shift changes with position (like +1, −1, +1 …), the two orders give different codes — so keep the order the example shows. While decoding, always undo the last step first.
- 1Write each letter of PLAN against its code letter: P→O, L→B, A→M, N→Q.
- 2Counting the places between each pair gives the rule: the word is reversed first, then every letter moves 1 place forward (+1).
- 3Now the same rule on WIND: W→E, I→O, N→J, D→X.
- 4So the code of WIND is EOJX.
- 1Write each letter of ROAD against its code letter: R→C, O→C, A→N, D→T.
- 2Counting the places between each pair gives the rule: the letters move +2, −1 places in turn and the whole result is then written backwards.
- 3Now the same rule on TOWN: T→M, O→Y, W→N, N→V.
- 4So the code of TOWN is MYNV.
Direct letter-to-letter matching
Making a list of letter pairs from two examples and writing the code of a third word.
In this type every letter has a fixed partner letter but there is no counting rule. Your job is a search: two examples are given and the code of every letter in the new word is found somewhere in those examples.
- Write the letter pairs of the first example one under another.
- Add more pairs from the second example.
- Treat letters whose code shows in both examples as certain — they check your list.
- Now change the new word one letter at a time using your list.
Number and symbol codes
Numbers built from letter places, table-and-condition codes and the row–column square table.
Numbers built from the places of letters
Finding how the code number relates to the place values of the letters, and ruling out the other rules.
Here the code of a word is a number. Write the place value of each letter (A = 1 … Z = 26) and see how the example’s number was made from those values. Question-setters usually pick one of these ways:
| Rule | How it is made | Example: DOG |
|---|---|---|
| Sum of place values | D + O + G | 4 + 15 + 7 = 26 |
| Sum of reverse place values | 23 + 12 + 20 | 55 |
| Place values written together | 4, 15, 7 | 4157 |
| Twice the sum | 2 × 26 | 52 |
| Sum + number of letters | 26 + 3 | 29 |
| First + last | 4 + 7 | 11 |
- 1Place values in NEST: N=14, E=5, S=19, T=20. Find the way these make 58.
- 2Rule: the sum of the place values of the letters (A=1, B=2 …). (No other rule gives 58 on this example — check it.)
- 3HOTEL: H=8, O=15, T=20, E=5, L=12 → 60.
- 1Place values in VAN: V=22, A=1, N=14. Find the way these make 22114.
- 2Rule: the place values of the letters written one after another. (No other rule gives 22114 on this example — check it.)
- 3FOX: F=6, O=15, X=24 → 61524.
Table-and-condition codes
Reading codes from the table and then applying a condition based on the first and the last letters.
In this type you are given a table with a digit against each letter, together with a few conditions. The method is plain — just keep the order firm:
Remember there are only five vowels: A, E, I, O, U. The other 21 letters are consonants. Here is the first table and its conditions:
| Letter | L | V | C | N | D | S | M | I | A | E |
|---|---|---|---|---|---|---|---|---|---|---|
| Code | 2 | 1 | 7 | 0 | 5 | 3 | 8 | 9 | 6 | 4 |
- if the first and the last letters are both vowels, both are coded as $
- if the first and the last letters are both consonants, both are coded as #
- if the first letter is a vowel and the last is a consonant, interchange their codes
- if the first letter is a consonant and the last is a vowel, the last letter is coded as @
- 1First read each letter’s code from the table: L=2, M=8, N=0, V=1, S=3, D=5. Without any condition the code is 280135.
- 2Now check the conditions. The first letter L is a consonant and the last letter D is a consonant, so the condition that applies is: if the first and the last letters are both consonants, both are coded as #.
- 3After applying it the code is #8013#.
Now a second table with the same four conditions (the conditions are the same, the digits are new):
| Letter | B | O | C | F | K | I | S | P | T | E |
|---|---|---|---|---|---|---|---|---|---|---|
| Code | 0 | 1 | 7 | 8 | 3 | 9 | 5 | 6 | 4 | 2 |
The square table (row–column) code
Finding the two-digit address of a letter in a 5 × 5 table and finding the letter from its address.
Below is a 5 × 5 table of letters (J is left out, so no question uses a word with J). The code of a letter is its address: the row number first, then the column number. A letter in the third row and second column has the code 32.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | W | R | F | M | B |
| 2 | D | X | Y | C | I |
| 3 | A | N | L | H | Z |
| 4 | P | V | S | Q | G |
| 5 | E | U | K | O | T |
- 1Find each letter: write its row number first and then its column number.
- 2H → row 3, column 4 → 34; O → row 5, column 4 → 54; L → row 3, column 3 → 33; E → row 5, column 1 → 51.
- 3The code of HOLE is 34 54 33 51.
Message codes — codes for sentences
Finding the code of each word from two or three sentences and their codes.
Catching the common word
Message codes with two and three statements, and finding the rest by elimination.
Here the codes belong not to a single word but to a whole sentence. The codes of a sentence’s words are usually written in a different order, so go by what is common, not by position. The method is simple:
- Pick two sentences that share exactly one word.
- In the same two codes find the common digit / letter group — that is the code of that word.
- Repeat with the other pairs of sentences.
- Find the leftover words by elimination: strike off the word–code pairs already found.
- 1The word “flower” is common to both statements and the code 7 is common to both codes — so “flower” = 7.
- 2Each remaining word takes the leftover code of its own statement: “beautiful” = 2, “river” = 9.
- 3So the answer is beautiful.
- 1Statements 1, 2 share the word “fast” and the code ga — so “fast” = ga.
- 2Statements 1, 3 share the word “morning” and the code sa — so “morning” = sa.
- 3Statements 2, 3 share the word “tall” and the code ti — so “tall” = ti.
- 4The rest follow by elimination: “blue” = lo, “deep” = wo, “water” = mu.
- 5So the answer is tall.
Substitution codes — swapped names
When the names of things are exchanged and you are asked for the “new name” of the real answer.
The name changed, the thing did not
Questions made by renaming colours, objects and directions.
In this type some things are deliberately given other names — for instance “blue is called red”. Then you are asked “what will the colour of the sky be called?” The mind gets tangled here, but the method is just two small steps:
- 1First think of the real answer, forgetting the new names: the colour of the clear sky is “blue”.
- 2Now see what “blue” has been renamed: “blue” is called “red”.
- 3So the answer is red — we must write the new name, not the real one.
Strategy guide
The order of checks in any code question, the common traps and time-savers.
The order of checks
A straight order for spotting the rule in letter codes and number codes.
| First look at | If you see | then the rule is |
|---|---|---|
| Are the letters of word and code the same? | Yes, only places changed | Arrangement (reverse / rotate / swap) |
| The gap in the first pair | Equal in all pairs | Fixed shift (+k or −k) |
| The sum of places in a pair | 27 in every pair | Opposite letters |
| The list of gaps | Repeating / growing in turn | Changing shift |
| Both reversed order and gaps | Two rules | Mixed (undo the last step first) |
| The code is a number | Small number / long number | Sum / values written together |
| Symbols like $ # @ in the code | Conditions are given | Choose the condition from the first and the last letters |
| Codes belong to sentences | A common word | Common code = common word |
| Names swapped | “… is called …” | Real answer → its new name |
Common traps and time-savers
The commonest reasons for losing marks in code questions and how to avoid them.
- Forgetting the wheel — not adding / subtracting 26 when you go past Y, Z or before A, B.
- Wrong direction — +k from word to code, but −k from code back to word.
- Trusting only the first letter — check the rule on every letter; a changing shift can look fixed on the first one.
- Mixing the two counts — the place from A and the place from Z are different; they add up to 27.
- Skipping the condition — writing the code straight from the table without looking at the first and the last letters.
- Reversing row and column — in a square table the address is always “row, then column”.
- Writing the real name — stopping at the real answer in a swapped-name question and not writing its new name.
Mixed practice
Questions of different types together, in three levels.
Basic practice
Plain shifts, opposite letters, the alphabet and simple number codes.
Before each question ask yourself: “What type of code is this?” Then find the rule and solve.
Standard practice
Alternating shifts, rotation, direct matching, table codes and three-sentence messages.
Advanced practice
A mix of mixed rules, decoding, a table with conditions and a square table.
The table and conditions below are for the table questions in this part:
| Letter | A | U | I | V | H | B | K | G | D | M |
|---|---|---|---|---|---|---|---|---|---|---|
| Code | 6 | 9 | 2 | 1 | 3 | 5 | 7 | 8 | 0 | 4 |
- if the first and the last letters are both vowels, both are coded as $
- if the first and the last letters are both consonants, both are coded as #
- if the first letter is a vowel and the last is a consonant, interchange their codes
- if the first letter is a consonant and the last is a vowel, the last letter is coded as @
Now the questions on the square (row–column) table:
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | T | L | B | M | W |
| 2 | O | R | F | U | H |
| 3 | V | S | C | N | K |
| 4 | Y | Q | A | G | E |
| 5 | Z | D | X | P | I |
Revision — cards
Think of the answer yourself first, then flip.