Coding and decoding
A code changes letters, numbers or words by a fixed rule. Compare the word with its code letter by letter to find the shift, reversal or substitution.
Types of coding
| Type | Example | Rule |
|---|---|---|
| Letter shift forward | CAT → DBU | each letter +1 |
| Letter shift back | DOG → CNF | each letter −1 |
| Reverse order | SALT → TLAS | letters written backwards |
| Opposite letters | ABC → ZYX | A↔Z, B↔Y (places add to 27) |
| Letter to number | BAD → 2 1 4 | alphabet positions |
| Sum of positions | CAB → 6 | 3 + 1 + 2 |
| Substitution | 'milk' is called 'oil' | answer with the new name |
| Sentence (word) coding | 'eat good food' = 'ta ko mi'; 'food is good' = 'mi lo ko' | common words share codes, so 'eat' = ta |
Worked example 1: letter shift
In a certain code, MANGO is written as NBOHP. How is GUAVA written in that code?
- Step 1: compare letter by letter: M → N, A → B, N → O, G → H, O → P. Each letter moves 1 place forward.
- Step 2: apply +1 to GUAVA: G → H, U → V, A → B, V → W, A → B.
- Check: moving each letter of HVBWB one place back gives GUAVA.
HVBWB.
Worked example 2: reverse, then shift
If PLATE is coded as FUBMQ, how is SPOON coded?
- Step 1: compare letter by letter: P → F does not fit a simple shift, so try reversing first. PLATE reversed is ETALP.
- Step 2: compare ETALP with FUBMQ: E → F, T → U, A → B, L → M, P → Q. Each letter moves +1.
- Step 3: apply to SPOON: reversed it is NOOPS; +1 gives OPPQT.
- Check: OPPQT moved back one place is NOOPS, and reversed it is SPOON.
OPPQT.
Worked example 3: number coding
If CAT = 24 and DOG = 26, then COW = ?
- Step 1: test letter positions: C + A + T = 3 + 1 + 20 = 24. D + O + G = 4 + 15 + 7 = 26. The rule is the sum of positions.
- Step 2: C + O + W = 3 + 15 + 23 = 41.
- Check: the rule gives both given codes exactly.
41.
Worked example 4: sentence coding
In a code language, 'rice is good' is written 'ka la pa', 'good for health' is 'pa ni ta' and 'rice for all' is 'ka ni so'. What is the code for 'health'?
- Step 1: 'good' is in the first and second sentences; the code common to both is 'pa', so good = pa.
- Step 2: 'rice' is in the first and third sentences; the common code is 'ka', so rice = ka. 'For' is in the second and third; the common code is 'ni', so for = ni.
- Step 3: the second sentence 'good for health' = 'pa ni ta', so health = ta.
- Check: the leftover codes also fit: is = la and all = so. Every word has its own code.
ta.
Bank papers now set sentence (word) coding sets of 4-5 questions; SSC and railway papers ask letter-shift, reverse and number coding. Placement tests mix two steps, such as reverse then shift, so test more than one rule.
2 marks: “If DOG is coded as EPH, how is CAT coded?” DBU. Each letter moves one place forward.
5 marks: “Explain any four types of coding-decoding with examples.” Letter shift (MANGO → NBOHP), reverse (SALT → TLAS), opposite letters (GOOD → TLLW), number coding (CAT = 24), with the rule for each.
10 marks: “What is coding-decoding? Explain its types with examples and the steps to decode a word.” Define; draw the decoding steps; explain shift, reverse, opposite, number, substitution and sentence coding with one example each.
Line up word and code, write positions, find the shift. If nothing fits, reverse the word first. In sentence codes, the common word gets the common code.