Coding‑Decoding – Study Notes for Haryana PSC (Reasoning Ability)
Why this topic?
Coding‑decoding problems test pattern recognition, logical inference, and the ability to work out hidden rules. They are a staple of competitive exams (IIT‑JEE, UPSC, state PSCs, etc.) and require a systematic approach to avoid common pitfalls.
1. What is Coding‑Decoding?
- Coding: A given letter/word is transformed into a new letter/word according to an unknown rule.
- Decoding: The reverse operation – recover the original from the coded form.
- Goal: Determine the rule from a set of given pairs and then apply it to solve the problem.
2. Types of Coding‑Decoding Problems
| Type | Example | Typical Rule |
|---|---|---|
| Alphabetic (Single‑Letter) | A → D, B → G, … | Simple shift or mirror |
| Alphanumeric (Letter ↔ Number) | A → 1, B → 2, … | Positional mapping |
| Word‑Level | CAT → 341, DOG → 415 | Convert each letter to its position |
| Sequence‑Based | 3 5 7 9 11 → 2 3 4 5 6 | Arithmetic progression |
| Diagrammatic | Circle → Triangle | Shape transformation |
| Two‑Step Coding | A → D → G | First rule + second rule |
Tip: PSC questions usually use simple rules (shifts, mirror, arithmetic) rather than cryptographic ciphers.
3. General Approach
- Collect all given pairs (coding or decoding).
- Choose the simplest possible rule that satisfies all pairs.
- Start with the letter‑to‑letter mapping (shift, mirror, multiple, etc.).
- If letters map to numbers, use alphabet‑position (
A=1,B=2, …Z=26).
- Derive a formula (if possible) and test it on all known pairs.
- Apply the rule to the unknown pair or sequence.
- Cross‑check the result with any additional clues or constraints.
4. Key Techniques & Formulae
| Technique | Formula / Pattern | Example |
|---|---|---|
| Cyclic Shift (Caesar Cipher) | Code = (Pos + k) mod 26 |
A→D (k=3) |
| Mirror Mapping | Code = 27 – Pos |
A→Z, B→Y |
| Alternating Shift | Odd positions shift +k1, Even positions shift +k2 |
A→D, B→G, C→H |
| Multiplicative Mapping | Code = (Pos × k) mod 26 |
A→C (k=3) |
| Additive + Mirror | First do mirror, then shift | A→Z→C |
| Number Coding | Code = Pos or Code = 27 – Pos |
CAT → 3 1 20 |
| Sequence Coding | Code = Previous + d | 3,5,7,9 → 2,3,4,5 (subtract 1) |
| Two‑Step Coding | C = f(g(A)) |
First shift, then mirror |
Derivation Example
SupposeA → D (3) B → G (3) C → J (5)Step 1: Compute difference of positions:
D(4) – A(1) = 3
G(7) – B(2) = 5
J(10) – C(3) = 7
→ The shift increases by 2 each step →k = 3,5,7 ….
Step 2: Check next pair to confirm.
5. Tricky Points & Common Mistakes
| Mistake | Why it Happens | How to Avoid |
|---|---|---|
| Assuming a linear rule when a non‑linear one exists | Only first |