Lesson 3.1: Encoding and Decoding Data, Part 1

Learning Objectives:

Humans and computers use and understand very different versions of data. We encode and decode data in order to switch between these different versions. We also encode data in order to prevent other people from learning information we want to keep private.
  • Students will learn how to count in binary.
  • Students will learn how to convert between binary and base ten numbers.
  • Students will practice decoding using binary.

Do Now: 
Watch: What is Data?

YouTube Video

Watch: Meet Agent Zhivago

YouTube Video

  • In the video above Agent Zhivago received a secret message from his comrade.
  • In what other circumstances might it be necessary to send or receive a secret, encoded message?
  • Why does a computer scientist need to understand how encoding and decoding work?

Activity Part 1
Encoding and Decoding

First, we will introduce encoding by showing a simple method of encoding in which every letter corresponds to a number: A=1, B=2, C=3, D=4 ...

Using this encoding, the word AND would be encoded to 1-14-4 .

Encoding information means only people who know the pattern can decode and understand the information. This can be helpful when you have information that you want to share with a specific person and keep secret from everyone else.

Your Turn

Before moving on to the activity, try out this example problem to make sure you understand how encoding and decoding works.

  1. Using the code above, encode the phrase "message"
  2. Using the code above, decode 8-9-7-8 6-9-22-5 25-15-21-18 14-5-9-7-8-2-15-18
  3. Now figure out the new set of rules and decode the phrase 7-19-18-8 18-8 9-22-5-22-9-8-22-23

Once you have tried all the example problems look at the answer key to check your answers.

Activity Part 2
Open the Encoding and Decoding Messages worksheet and begin decoding the messages. Click on the link or the image below to get started.Encoding and Decoding Messages Worksheet

Decoding messages can be a difficult task. Which aspects of encoding and decoding were the most difficult for you? Which aspects were the easiest?  When might the process of encoding and decoding fail or become very difficult? The following video featuring Carly Rae Jepsen may help you answer this last question. Hint: Think about language translation as a form of decoding.

Activity 3: Imperfections in Coding

YouTube Video

As you saw in the "Imperfections in Encoding" video, computers do not always translate phrases correctly. Now, you will get to see this first hand!

Type the phrase "How long does it take for a computer to translate ten pages?" into Google Translate. Translate the English phrase into German, translate the German into Arabic, translate the Arabic into Japanese and then translate the Japenese into Finnish. Finally, translate the Finnish back into English. What did you get?

Can you figure out where the translation went wrong? 

What are some of the problems Google Translate has to deal with when encoding and decoding languages? 

Do you think some languages are harder to encode and decode than others?

Lesson 3.1 Wrap Up:
  • Today we have learned different methods of encoding and decoding and built up our intuition for finding these patterns. In fact, encoded messages are all around us.
  • Can you think of more  examples of encoded information in your everyday life that have not already been mentioned?
Michelle Cernuto,
22/04/2016, 15:20