Skip to content

Coding and Decoding

Lesson 6 of 811 minPDF notesFree

What you will learn

You will apply and reverse a coding rule, keep a consistent substitution table, and decide whether the clues determine the particular code being asked for. You need the English-alphabet positions and explicit-cycle convention from the letter lesson, plus the earlier habit of preserving a relation's direction. Number-series mastery is not a prerequisite.

Encoding changes an original message into its code. Decoding reverses that transformation. A code question must tell you the permitted kind of transformation or provide enough consistent evidence within a stated kind. An attractive pattern in one example cannot overrule a contradiction in another.

A token is one code unit. In a word code, ka is one token if the question separates it from other tokens with spaces; it is not automatically two independent letter codes. A one-to-one mapping means different input letters or words get different codes, and the same input keeps its code. That condition must be stated, not silently assumed.

1 One shift for all letters

For a fixed-shift code, align each example letter with its code letter. Compare their A=1,…,Z=26 positions and verify the same shift throughout every example. A repeated letter provides another consistency check. If the question does not allow a cycle, every shift must stay inside A–Z.

Worked example

The same fixed forward shift is applied to every English letter; no wraparound is needed.

DESK → FGUM

HILL → JKNN

Encode: LAMP

Answer: NCOR

Every supplied letter pair shifts +2; L→N, A→C, M→O, P→R.

Watch the mistake: Check all eight example letter positions, including the repeated L.

The first example checks D→F, E→G, S→U and K→M. The second checks H→J, I→K and both L→N positions. Every pair is +2. Knowing the permitted family is what lets us apply that shift to LAMP; a general arbitrary letter-substitution table would not justify codes for unseen letters merely from this kind of guess.

2 Decode in the reverse direction

If encoding adds a fixed position shift, decoding subtracts it. With a permitted cycle, going backward before A returns to Z. After decoding, encode your candidate again; getting back the exact supplied code is a useful check.

Worked example

Encoding moves each letter four places forward with Z→A wraparound. Decode by reversing that shift.

MAP → QET

WAX → AEB

Decode: XVEGO

Answer: TRACK

X→T, V→R, E→A, G→C, O→K by −4. Re-encoding TRACK returns XVEGO.

Watch the mistake: Encoding direction is not decoding direction.

The examples confirm the forward rule: MAP→QET and WAX→AEB, including the boundary crossings W→A and X→B. Do not reverse the order of letters unless the rule says to do so. Moving backward through the alphabet and reversing a word are different actions.

3 A position-dependent rule: keep the stages visible

A rule may act differently on different positions. When it says “reverse, then shift positions”, the position labels belong to the reversed word. Write the intermediate word rather than attempting all stages at once.

Worked example

For a four-letter word: reverse its order, then shift positions 1 and 3 forward by one and positions 2 and 4 backward by one. No wraparound is needed.

BOLT → UKPA

FARM → NQBE

Encode: CODE

Pause and complete the middle stage

CODE → □ → apply shifts +1, −1, +1, −1 → ?

Write the reversed word under new position labels 1,2,3,4. Only then apply the four shown shifts. The answer below reveals the completed row.

Answer: FCPB

CODE→EDOC→FCPB. Apply shifts to positions after reversal.

Watch the mistake: Shifting before reversing instead gives DEND, which is a different rule.

Check both examples stage by stage: BOLT→TLOB→UKPA and FARM→MRAF→NQBE. For CODE, the reversed word EDOC has E,D,O,C at new positions 1,2,3,4, giving F,C,P,B. If we shifted the original positions first, CODE would become DNED, then reverse to DEND. Here the position-dependent shifts make the order matter. We are not claiming that changing the order of any two transformations always changes the result.

4 A direct substitution table

A direct letter-to-digit question need not use alphabet arithmetic at all. If letter order is preserved, align corresponding positions and record the observed map. Check repeated letters and all additional examples. The distinct-digit condition applies only to the letters used in that puzzle; it cannot assign different single digits to all 26 English letters.

Worked example

Among the letters used in this question, each distinct letter has its own distinct single-digit code, used consistently; letter order is preserved.

MINT → 7359

TIN → 935

Encode: TINT

Answer: 9359

M=7, I=3, N=5, T=9; repeat the same 9 for both occurrences of T.

Watch the mistake: These clues do not determine a code for any new letter.

The map contains M=7, I=3, N=5 and T=9, which is enough for TINT because every target letter is present. These particular clues do not determine a new letter's code. Do not turn this caution into a universal rule that an unseen value can never be inferred: a different problem could supply a finite complete code inventory and enough elimination clues. Read the actual domain and evidence.

5 Word codes: common words, common tokens

When token order may be changed, the first printed word does not necessarily match the first printed token. Compare sets instead. A word shared by two clues must keep the same code, but if two words and two tokens are shared, you may still be unable to tell which token belongs to which word.

Worked example

Each distinct word has one distinct code token used consistently. Tokens within each line may be reordered. The quoted English clue strings stay unchanged in both language versions.

red trains move → ka li po

trains move safely → po ka su

red flags shine → li ne tu

Find what is determined for: red, trains

Answer: red=li; trains cannot be uniquely determined: ka or po.

Only red is common to lines 1 and 3, and only li is common to their code sets. Lines 1 and 2 leave trains/move exchangeable between ka and po.

Watch the mistake: A unique code for one word does not make all word codes unique.

For the fixed target, line 1 and line 3 share only red, and their token sets share only li. For trains, two full consistent mappings show what remains unresolved:

  • red=li, trains=ka, move=po, safely=su, flags=ne, shine=tu
  • red=li, trains=po, move=ka, safely=su, flags=ne, shine=tu

Both produce every supplied token set. Thus the target red is fixed while trains is not. A whole mapping need not be unique for one target to be identifiable.

Distinguish two conclusions:

  • Insufficient information: at least two allowed consistent mappings give different target codes
  • Inconsistent information: no allowed mapping fits all the clues

Selecting “insufficient information” should be supported by actual alternatives, not merely by difficulty finding the answer.

6 Coached contrast: one fixed target, one unresolved target

Try this fresh clue set. Each distinct word has its own distinct token used consistently, and token order may differ from word order. Keep the quoted English strings as the code-bearing data.

blue birds sing → re ma to

birds sing softly → to vi re

blue lamps glow → ma ku na

Pause, with two parts

  1. Fill blue → □
  2. Complete two mappings: birds → □, sing → □; then birds → □, sing → □ with a different code for birds. Keep every clue true

Check: blue=ma, because only blue and ma are shared between lines 1 and 3. Two possible full mappings are:

  • blue=ma, birds=re, sing=to, softly=vi, lamps=ku, glow=na
  • blue=ma, birds=to, sing=re, softly=vi, lamps=ku, glow=na

Both mappings reproduce all three token sets, but birds has a different code. Therefore blue is identifiable and birds is not. lamps and glow could also exchange their two tokens; resolving that pair is unnecessary to prove the point about birds. The task was to justify a target, not to pretend the whole dictionary was known.

7 A reliable checking routine

  1. Identify encoding or decoding and the code's unit: letter, digit or separated word token
  2. Read the allowed transformation, domain, order and cycle conditions
  3. Record a mapping or intermediate stages
  4. Test every supplied example, including repeated symbols
  5. Check whether the target is determined; if not, show two consistent target-changing possibilities
  6. For an invertible rule, re-encode a decoded candidate

In both language versions, the raw English words, letters and code tokens stay unchanged. Their grammatical meaning does not supply hidden coding clues. Only the surrounding explanation is translated.

Independent practice

Try all five before the explained key. This original free learning practice is untimed, with one mark for correct and zero for incorrect or unattempted, no negative marking and no pass cutoff. These settings do not state the RRB exam's marking rules.

  1. One fixed forward English-alphabet shift is used for every letter, without wraparound: BAND→EDQG and FISH→ILVK. How is CAMP encoded?

A. FDPS B. ECOR C. SPDF D. FDPR

  1. Encoding moves every English letter five positions forward, returning to A after Z. Thus LION→QNTS and ZEBRA→EJGWF. Decode RFSLT.

A. RFSLT B. WKXQY C. MANGO D. OGNAM

  1. For each four-letter word, reverse its order, then move letters at the new positions 1 and 3 one place forward and positions 2 and 4 one place backward. No wraparound is needed. MINT→UMJL and RUSH→IRVQ. Encode FROG.

A. GORF B. HNSE C. FPQG D. GQPF

  1. Among the letters used in this question, each distinct letter has its own distinct single-digit code, used consistently; letter order is preserved. CART→6814 and TAR→481. Encode TRACT.

A. 48164 B. 41846 C. 41865 D. 41864

  1. Each distinct word has one distinct code token used consistently, but tokens in each line may be reordered. Given “small boats sail”→“zo mi la”, “boats sail slowly”→“la nu zo”, and “small bells ring”→“mi ke pa”, which token must mean small?

A. zo B. la C. mi D. nu

Explained key

  1. A — FDPS

Every example letter moves +3: B→E, A→D, N→Q, D→G; F→I, I→L, S→V, H→K. Therefore C→F, A→D, M→P, P→S gives FDPS. B uses +2 instead. C reverses the correctly shifted output. D shifts the last P by only +2, breaking the uniform +3 rule.

  1. C — MANGO

Undo the shift by moving −5: R→M, F→A, S→N, L→G, T→O, giving MANGO. Re-encoding gives M→R, A→F, N→S, G→L, O→T, so RFSLT is restored. The examples also obey +5, including Z→E. A leaves the code unchanged. B applies +5 again. D reverses MANGO, although no reversal was specified.

  1. B — HNSE

FROG reverses to GORF. Apply +1,−1,+1,−1 to these new positions: G→H, O→N, R→S, F→E. The answer is HNSE. The checks are MINT→TNIM→UMJL and RUSH→HSUR→IRVQ. A performs only reversal. C applies the shifts to FROG first, obtaining GQPF, and then reverses it to FPQG. D performs only that first shift stage without reversal.

  1. D — 41864

CART gives C=6, A=8, R=1, T=4. TAR checks T=4, A=8, R=1. TRACT is T,R,A,C,T, so its code is 4,1,8,6,4. A exchanges the codes at positions 2 and 3. B exchanges the last two positions. C changes the repeated T to 5 even though its code is 4. All target letters are supported by the clues.

  1. C — mi

Lines 1 and 3 have only small in common, and their token sets have only mi in common. Thus small=mi. The first two lines leave boats and sail exchangeable between zo and la, so A and B cannot mean small. The remaining token nu in line 2 means slowly, so D is also wrong. Word order cannot be used to align the tokens because reordering is explicitly allowed.

Source and scope

RRB CEN 09/2025, §14.1, printed p.28, names alphabetical and number series, coding and decoding, and mathematical operations. The topic list is illustrative, not exhaustive. University of Cambridge NRICH supports the fixed-shift and explicit-cycle coding idea. We consistently use A=1 through Z=26. All explanations, examples and questions here are original teaching material. The selected subtypes and question counts are learning choices, not official topic weightage. These are not previous-year questions or a full reasoning course.

Analogy

Think of a label-changing machine with a written instruction card. To encode, feed in the original label; to decode, undo the instructed transformation. A fixed-shift machine follows an alphabet rule, while a lookup-table machine needs known entries. For unordered word codes, the labels leave as a shuffled set, so their printed positions cannot identify their partners. If two instruction tables fit all observations but change the requested label, that label is unresolved.

Quick reference

  • Encode: original → code; decode: undo that transformation
  • Check every example and every repeated input
  • A fixed forward shift decodes by the matching backward shift
  • Cycle permission must be explicit; English A–Z data stay unchanged in Hindi
  • Position-dependent stages: write the intermediate word and reassign indices
  • Letter-to-digit maps: state puzzle domain, injectivity and letter-order preservation
  • Unordered word codes: compare shared sets, not printed positions
  • One fixed target does not make the whole mapping unique
  • Insufficient data: exhibit two valid maps with different target codes
  • Inconsistent data: no allowed map fits all clues

Notes for this lesson

Sign in to keep your progress. Sign in