AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Making and breaking codes

Week 23 · Unit 9: Sending secret messages · 3 lessons
2

Numbers for letters

Computing 3: Unit 9, pp. 135–146
GoalTurn letters into two-digit numbers and numbers back into letters.
New words
number code · a code that swaps each letter for its place in the alphabetdigit · one of the signs 0 to 9alphabet · all the letters in their order, from A to Z
Explanation

In a number code, each letter is swapped for its place in the alphabet. A is 1, B is 2, and Z is 26. We write every number with two digits, so A is 01 and B is 02. We leave a space between letters and put a slash between words. The two digits are important. If we wrote 1 1 2 without spaces, 112 could be AAB, AL or KB. With two digits, every pair of digits is one letter, so there is only one way to read the message.

ABCDEFGHIJKLM
01020304050607080910111213
NOPQRSTUVWXYZ
14151617181920212223242526
Worked examples
LetterPlace in the alphabetTwo digits
H808
E505
N1414
Encode HEN. H is the 8th letter, E is the 5th and N is the 14th. Numbers below 10 get a zero in front, so the code is 08 05 14.
Plain textNumber code
BIKE RIDE02 09 11 05 / 18 09 04 05
Encode two words, BIKE RIDE. We put a slash between the words.
Reading of 112Letters
1, 1, 2A A B
1, 12A L
11, 2K B
Why two digits? Look at 112. It could be read in three ways, and only one is meant. Two digits for every letter would write A, A, B as 01 01 02, and K, B as 11 02. Now there is no mix-up.
Class activity

Number strips (in pairs): write the alphabet on a long strip of paper, with the numbers 01 to 26 under the letters. Write a short two-word message in number code on a card and swap it with your partner. Use the strip to decode it. Then agree a new rule: count backwards, so that Z is 01 and A is 26. Try one message with the new rule and check that your partner gets the same message back.

Practice
1
Write LAMP in the number code.
LAMP
2
Decode this number code:
Code
20 18 05 05
3
Yuki writes the message 1112 without any gaps. Can you be sure which letters it is? Name at least two ways to read it.
4
Decode this number code: 02 15 15 11