Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Competitions › SOF IMO › unit 17 of 17

Coding, decoding and analogies

SOF IMO · Logical Reasoning · about 6 minutes

Coding questions change letters by a fixed rule: shift each letter, reverse the alphabet, or swap positions. Analogy questions keep a relationship: as A is to B, so C is to ?

Find the rule from the example, test it on every letter, then apply it.

In this lesson

  1. Letter shifts
  2. Reverse alphabet
  3. Worked examples
  4. Where marks are lost
  5. Check yourself

1Letter shifts

Write the positions of the code and the word under each other and subtract. A constant gap is a Caesar shift; a growing gap is a pattern like +1, +2, +3.

2Reverse alphabet

A ↔ Z, B ↔ Y: the two positions always add to 27, so M ↔ N in the middle.

Worked examples

  1. Example 1If PEN is coded RGP, how is INK coded?

    1. P → R, E → G, N → P: each letter moves forward 2.
    2. I → K, N → P, K → M.

    Answer: KPM

  2. Example 2In a code, 2 = 5, 3 = 10, 4 = 17. What is 6?

    1. n² + 1.

    Answer: 37

See it move

Where marks are lost

  • Testing a rule on only one letter.
  • Miscounting alphabet positions.

Exam tips

  • Number the alphabet: A = 1 … Z = 26; opposite letters add to 27.
  • Check shifts letter by letter; they may increase (+1, +2, +3).
  • For number analogies, test squares, cubes and ×/+ rules.

Practice questions

  1. If CAT = DBU, then DOG = ?

  2. If A = Z, B = Y, then CAB = ?

  3. 4 : 16 :: 7 : ?

More worked examples

Try each one first, then open the working.

  1. Figures 1, 2 and 3 of a matchstick pattern are shown. How many matchsticks are in figure 39?

    Figure 1Figure 2Figure 3
    Show the working

    Start: How many sticks are added each time?

    The figures use 4, 7, 10, …: add 3 each time. Figure n uses 3n + 1, so figure 39 uses 118.

    Answer: 118

  2. Asha saves ₹50 in the first month and ₹100 more each month than the month before. After how many months will her total savings be ₹26450?

    Show the working

    Start: Use Sₙ = n/2 (2a + (n − 1)d) and solve for n.

    Sₙ = n/2 [2 × 50 + (n − 1)100] = 26450 gives n = 23.

    Answer: 23 months

  3. With this wheel (shift 13), the message PBQR was received. What was sent?

    ANBOCPDQERFSGTHUIVJWKXLYMZNAOBPCQDRESFTGUHVIWJXKYLZMplain: outercode: inner
    1. ABNCD
    2. BDPEF
    3. CCODE
    Show the working

    Start: Decrypt by shifting backwards.

    Move each letter 13 places back: PBQR → CODE.

    Answer: CODE

  4. Which figure in this pattern uses exactly 109 matchsticks?

    Figure 1Figure 2Figure 3
    Show the working

    Start: Write the rule for figure n, then solve.

    Figure n uses 3n + 1. 3n + 1 = 109 gives n = 36.

    Answer: 36

Practise more

New questions every time, at exam level

Which figure in this pattern uses exactly 45 matchsticks?

Figure 1Figure 2Figure 3

Sit a timed SOF IMO mock test

Data handling and probabilityAll competitions