Coding-Decoding — Study Notes
Overview
Coding-Decoding is a pattern-recognition topic in logical reasoning where words, letters or numbers are transformed using a specific rule. Your task is to identify the rule from examples and then apply it to encode a new word or decode a given code. This topic appears in nearly every SOF IMO paper and is a quick-scoring section if you master the common patterns.
In the exam, you'll see 2–4 coding-decoding questions, typically in the first half of the Logical Reasoning section. The good news: once you spot the rule, the answer is straightforward. The challenge is speed—you must decode the pattern in under 60 seconds per question. Most errors come from misreading the rule or skipping a step in multi-layer codes.
Students must master letter-position values (A=1, B=2, ... Z=26), reverse alphabets, arithmetic operations on positions and symbol-substitution patterns. Practice 20–30 varied questions to internalize the common types.
Key Concepts
- **Letter Position Value**: Each letter has a position in the alphabet—A=1, B=2, C=3, ... Z=26. Many codes involve adding or subtracting from these positions.
- **Reverse Alphabet**: The reverse alphabet maps A↔Z, B↔Y, C↔X, etc. A common trick is to replace each letter with its opposite-end partner.
- **Shift/Caesar Cipher**: Move every letter forward or backward by a fixed number of steps (e.g. shift +3 means A→D, B→E, C→F).
- **Arithmetic Operations on Positions**: Add, subtract, multiply or divide the position values and convert the result back to a letter (e.g. if position value exceeds 26, apply modulo 26 or wrap around).
- **Symbol or Number Substitution**: Letters are replaced by symbols or numbers according to a given key, or each letter is assigned a fixed digit.
- **Mixed Rules**: Some problems combine two operations—first reverse, then shift; or first shift, then swap vowels and consonants.
- **Word-Level Coding**: The entire word is treated as a unit—count letters, sum position values or rearrange by a rule (e.g. reverse the word, then shift each letter).
- **Number Coding**: Digits in a number are rearranged, incremented or replaced by their complements (e.g. 9−digit for each digit).
Formulas / Key Facts
- **Letter position**: A=1, B=2, C=3, ..., Z=26.
- **Reverse alphabet position of letter at position n**: 27 − n. Example: E is 5, reverse is 27−5=22 (V).
- **Forward shift by k**: New position = (Old position + k). If result >26, subtract 26 or wrap around.
- **Backward shift by k**: New position = (Old position − k). If result <1, add 26.
- **Position sum**: Sum all letter positions in a word, then use the sum directly or mod 26 to get a single letter.
- **Opposite letter pairs**: A↔Z, B↔Y, C↔X, D↔W, E↔V, F↔U, G↔T, H↔S, I↔R, J↔Q, K↔P, L↔O, M↔N.
- **Common single-digit substitution**: Each letter maps to a digit 0–9 by some rule (first letter=1, second=2, etc., or position mod 10).
- **Word reversal**: Write the word backwards letter-by-letter, then apply a letter rule if specified.
Worked Examples
**Example 1: Simple Letter Shift** In a code, CAT is written as FDW. What is DOG written as?
*Solution*: Compare each letter:
- C → F: shift +3 (C=3, F=6)
- A → D: shift +3 (A=1, D=4)
- T → W: shift +3 (T=20, W=23)
Rule: shift every letter forward by 3 positions. Apply to DOG:
- D → G (4+3=7)
- O → R (15+3=18)
- G → J (7+3=10)
**Answer: GRJ**
---
**Example 2: Reverse Alphabet** If MANGO is coded as NZMTL, find the code for APPLE.
*Solution*: Check first letter: M → N? No direct shift. Try reverse alphabet:
- M (13) ↔ N (14)? Not exact opposite.
Check if pattern is reverse alphabet:
- M (13) reverse = 27−13=14 (N) ✓
- A (1) reverse = 27−1=26 (Z) ✓
- N (14) reverse = 27−14=13 (M) ✓
- G (7) reverse = 27−7=20 (T) ✓
- O (15) reverse = 27−15=12 (L) ✓
Rule: Replace each letter with its reverse alphabet counterpart. Apply to APPLE:
- A → Z (27−1=26)
- P → K (27−16=11)
- P → K
- L → O (27−12=15)
- E → V (27−5=22)
**Answer: ZKKFV**
---
**Example 3: Number Substitution** If A=2, B=4, C=6, ..., what is the code for CAB?
*Solution*: Pattern: Each letter is assigned twice its position value.
- C (3) → 3×2=6
- A (1) → 1×2=2
- B (2) → 2×2=4
**Answer: 624**
---
**Example 4: Mixed Rule (Reverse then Shift)** In a code, BAT becomes YZQ. Find the code for RAT.
*Solution*: First check reverse alphabet:
- B (2) reverse = 27−2=25 (Y) ✓
- A (1) reverse = 27−1=26 (Z) ✓
- T (20) reverse = 27−20=7 (G), but given is Q (17). Not pure reverse.
Try reverse then shift:
- B → Y (reverse correct)
- A → Z (reverse correct)
- T → G (reverse) but we get Q. Shift from G: Q is 17, G is 7, so shift +10? Check others: Y+10 would overflow.
Alternate: reverse alphabet then backward shift by some amount. After testing, pattern is reverse alphabet alone for first two, special rule for last. On exam, test the given answer choices directly to save time.
For **RAT**:
- R (18) reverse = 27−18=9 (I)
- A (1) reverse = 26 (Z)
- T (20) reverse = 7 (G) or adjusted by context.
In real exam, try each answer choice with the rule you deduce. This example shows why systematic checking is vital.
Common Mistakes
- **Confusing forward and backward shifts**: If the code shifts letters backward, students often shift forward by mistake. Always test your rule on all letters in the example before applying it. Fix: Write down position values explicitly.
- **Forgetting to wrap around past Z**: When shifting forward beyond Z (e.g. Y+3), students forget to wrap to C (Y=25, +3=28, 28−26=2=B). Fix: Use modulo 26 arithmetic or subtract 26 when result >26.
- **Mixing up reverse alphabet**: Students remember A↔Z but miscalculate middle letters (e.g. M↔N is wrong; M↔N is 13↔14, correct reverse of M is N by 27−13=14, which is N, but true opposite of M is N only if you mean reverse order; actually M=13 reverse is 27−13=14=N, so M↔N is correct reverse pair).
- **Ignoring vowel-consonant rules**: Some codes treat vowels and consonants differently (vowels shift +2, consonants shift −1). Students apply one rule uniformly. Fix: Separate the word into vowels and consonants, apply rules independently.
- **Not testing the rule on all given letters**: After guessing a rule from the first letter, students skip verifying the second and third letters. Often the rule is composite or has exceptions. Fix: Check every single letter in the example word before proceeding.
Quick Reference
- **A=1, Z=26** — memorize letter positions for the first 10 and last 5 letters.
- **Reverse alphabet formula**: position of reverse = 27 − original position.
- **Common shift**: +3 (Caesar cipher) or +1 (next letter).
- **Check vowels vs consonants** — many problems treat them differently.
- **Answer choice testing** — if stuck, plug answer choices backward into the rule.
- **Pattern verification** — always test your decoded rule on all example letters before applying to the question word.