ExamSaathi learning library · Government exams · SSC CGL general intelligence and reasoning; published syllabus labelled 2024 · General intelligence and reasoning

Coding and decoding: letter positions, shifts and reversals

Use letter positions from A = 1 to Z = 26 to crack codes that shift every letter, change the shift along a word, write a word backwards, swap letters for their opposites or turn a word into a number.

Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.

You will learn to

Before you start

A coding question shows a word and its code, and you must find the rule that links them. You then apply the rule to a new word, which is coding, or run it backwards to recover a word, which is decoding. Almost every rule works through letter positions, so learn them well: A = 1, B = 2 and so on up to Z = 26. The word EJOTY marks every fifth letter, E = 5, J = 10, O = 15, T = 20 and Y = 25, so you can count on or back from the nearest of these. The reverse position, counted from Z, is 27 minus the ordinary position. So Z is 1st from the end and A is 26th.

Letter shifts and wrapping round

In a shift code every letter moves the same number of places along the alphabet. To find the shift, write the position of each letter and of its code letter, then subtract. If RAIN is coded as UDLQ, R (18) becomes U (21), A (1) becomes D (4), I (9) becomes L (12) and N (14) becomes Q (17), so each letter moves 3 places forward. The alphabet runs in a circle, like the hours on a clock, and after Z comes A again. When a forward shift passes 26, subtract 26: Y (25) moved 3 places forward reaches 28, and 28 - 26 = 2, which is B. To decode, move the same number of places back, and add 26 whenever the position drops below 1.

Changing shifts and number codes

Some codes do not use one shift for the whole word. The shift may grow along the word, as when LAMP becomes MCPT: L to M is +1, A to C is +2, M to P is +3 and P to T is +4. It may alternate, such as +2, -2, +2, -2, or depend on the letter's place in some other way. So write the change under every letter, not only the first. Other codes turn a word into a number. The word may become the list of its letter positions, so BAG is 2-1-7, or the sum of those positions, so BAG is 2 + 1 + 7 = 10. Test the sum first. If it fails, try the reverse positions or a product.

Reversals and opposite letters

In a reversal code the letters are written in the opposite order, and a shift is often added afterwards. STAR written backwards is RATS, and a further shift of +1 turns it into SBUT. In an opposite-letter code, each letter is swapped for the one in the same place counted from the other end of the alphabet. The positions of a letter and its partner always add up to 27, so the pairs are A and Z, B and Y, and so on up to M and N. Using this code twice brings back the original word. A quick test: if the first letter and its code letter add up to 27, check the other letters for the same total.

Common mistakes

Counting the starting letter as the first step: 3 places after D is G, but counting D, E, F as one, two, three lands wrongly on F. Forgetting to wrap round, which leaves a position such as 28 instead of B. Decoding in the same direction as the code instead of the opposite one. Checking only the first letter and assuming the same shift for the rest. Confusing a backward shift with the opposite-letter rule: Z moved back 1 place is Y, but the opposite of Z is A. When a code both reverses and shifts, and the shift changes from letter to letter, the order of the two steps matters, so follow the order the example shows.

A decoding routine

First, write the positions under the given word and under its code. Second, find the change for each letter. Equal changes mean one shift for all letters; changes such as +1, +2, +3 or +2, -2 mean a pattern to continue. Third, if the changes look random, compare the code with the word written backwards, and test whether matching positions add up to 27. Fourth, for a number code, try the sum of the positions before anything else. Fifth, apply the rule to the new word, wrapping round past Z or before A. Last, check one letter of your answer by running the rule backwards.

Worked examples

  1. In a certain code, MANGO is written as OCPIQ. How is LEMON written in that code?

    1. Compare positions: M (13) to O (15), A (1) to C (3), N (14) to P (16), G (7) to I (9) and O (15) to Q (17). Every letter moves 2 places forward.
    2. Apply +2 to LEMON: L (12) to N (14), E (5) to G (7), M (13) to O (15), O (15) to Q (17) and N (14) to P (16).

    Answer: LEMON is written as NGOQP.

  2. In a code, every letter is moved 4 places forward, and a word comes out as CEVH. What is the word?

    1. To decode, move each letter 4 places back.
    2. C (3) - 4 = -1, which is below 1, so add 26: -1 + 26 = 25, which is Y.
    3. E (5) - 4 = 1, which is A. V (22) - 4 = 18, which is R. H (8) - 4 = 4, which is D.
    4. Check by coding YARD forward: Y (25) + 4 = 29, and 29 - 26 = 3, which is C. A, R and D become E, V and H.

    Answer: The word is YARD.

  3. In a code, TIGER is written as SFHJU. How is HORSE written in the same code?

    1. Letter by letter, the changes are -1, -3, +1, +5 and +3. They show no pattern, so try a reversal.
    2. TIGER backwards is REGIT. Against SFHJU, R to S, E to F, G to H, I to J and T to U are all +1.
    3. So the rule is: write the word backwards, then move each letter 1 place forward.
    4. HORSE backwards is ESROH. Moving each letter 1 place forward gives FTSPI.

    Answer: HORSE is written as FTSPI.

Practice checks

  1. Which letter is 8th from the right end of the English alphabet?
  2. In a code, PAINT is written as NYGLR. How is BAKE written in the same code?
  3. In a code, FARM is written as GCUQ. How is SEED written in the same code?
  4. In a code, each letter is replaced by the letter in the same place counted from the other end of the alphabet, so A becomes Z and B becomes Y. How is SONG written in this code?
  5. In a code, ANU is written as 36 and RAVI as 50. Using the same rule, what is the code for ASHA?

Sources checked