Coding-Decoding
Letter shifts, reverse position, symbol coding.
Coding-Decoding — Core
In coding-decoding problems, a word/number is replaced with a code using a rule. You either decode the given code or encode a new word.
Letter-shift coding — each letter is shifted by a fixed number of positions in the alphabet.
- "CAT" coded as "DBU" means each letter is shifted by +1. So "DOG" → EPH.
- Negative shifts wrap around: B → A (−1), A → Z (−1).
Reverse-position coding — replace each letter with its "opposite" (A↔Z, B↔Y, … M↔N). The position from start (A=1) plus position from end equals 27. Useful: opposite of L (12) is O (15).
Number-position coding — replace each letter with its alphabet position. CAB → 3 1 2.
Number-coding — apply arithmetic to position values: e.g. add 2, multiply, etc.
Word coding from another word:
If "BAT" is coded "265" and "CAT" is coded "365", we observe B=2, A=6 (?), C=3, T=5. So the code is the position of each letter (B=2 ✓, A=1 ✗ — but code has 6). The rule then may be: position from end. A from end is 26. But coded as 6, hmm — maybe just digits. Try: codes 265 → 2,6,5 vs BAT positions 2,1,20. Code = position²? 4,1,400. No match. Try: code 2 = B's position, 6 = A's reverse position digit? Often the coding follows a unique rule that you discover by careful inspection.
Symbol/letter substitution — given table where each digit or letter maps to a symbol. Apply table to decode.
Approach:
- Compare the coded word to the original letter by letter.
- Identify the relation: shift? reverse? add? letter-to-position?
- Test it on another sample.
- Apply to the target word.
Example 1 — Letter shift:
If "DELHI" is coded as "EFMIJ", how is "MUMBAI" coded?
Method: D→E (+1), E→F (+1), L→M (+1), H→I (+1), I→J (+1). Shift = +1. So MUMBAI → NVNCBJ.
Example 2 — Reverse position:
If "TEACHER" is coded as "GVZXSVI", how is "STUDENT" coded?
Method: Each letter → its opposite (A↔Z). T(20)↔G(7), E(5)↔V(22), A↔Z, C↔X, H↔S, E↔V, R↔I. Pattern confirmed. STUDENT: S↔H, T↔G, U↔F, D↔W, E↔V, N↔M, T↔G → HGFWVMG.
Example 3 — Number coding:
In a code, MOTHER is written as 41. How is FATHER written?
Method: M+O+T+H+E+R = 13+15+20+8+5+18 = 79. Hmm, that's 79 not 41. Try positions/2 or other rule. Could be the digit-sum: 7+9 = 16. No. Could be: positions modulo 10? Need another sample to confirm.
In practice, RRB usually gives an explicit pattern. A common variant: "MOTHER" = "654312" — six unique letters with code positions reversed.
Example 4 — Sentence-level coding:
If "good morning" is "ag bm" and "morning sunshine" is "bm cs", what is "good"?
Method: "good morning" → ag, bm; "morning sunshine" → bm, cs. The common word "morning" must be bm. So "good" = ag.
Example 5 — Number-to-letter:
If 'A' is coded 1, 'B' is 4, 'C' is 9, 'D' is 16, how is 'F' coded?
Method: Position squared. A=1²=1, B=2²=4, C=3²=9, D=4²=16, E=5²=25, F=6²=36.
Speed tip: align the original and coded word vertically, write the shift/difference for each letter — the pattern often pops out instantly.