Digital Information - Lesson 6: Representing Text
Overview
In this lesson, students create a system for representing text using only numbers while communicating with each other. They are only allowed to send numbers back-and-forth, so they must create a system to translate between number and character. At the end of the main activity they briefly review the ASCII system for representing text. The wrap up discussion emphasizes how all of the concepts thus far have "built" on each other and introduces the concept of abstraction to describe this progression.
Goals
Students will be able to:
- Develop a system for using numbers to represent text.
- Explain how bits are grouped to represent abstractions like numbers and text.
- Describe the challenges in representing text when using a fixed number of bits for each character.
Purpose
After this lesson students will understand the ways the most common types of information, text and numbers, are stored using binary. More importantly they should understand the challenges or principles that led to the creation of these systems and that these systems are somewhat arbitrarily created to solve a shared problem. They work not because there was "one right answer" but because many people agreed to use them. The wrap up discussion begins to explore the concept of abstraction. This is a challenging concept to understand and one that students will return to many times throughout the course. In this context, we emphasize how common it is to send text messages to each other yet these messages rely on many smaller layers (like binary numbers and electrical signals) to truly function correctly.
Resources
Getting Started (5 minutes)
Remarks
Prompt: Brainstorm with your neighbor what you think this list represents. When you think you have an idea, come up with another item to add to this list and be ready to explain why it belongs.
- 1 1
- 2 14
- 7 4
- 10 31
Discussion Goal: Each item in the list represents a non-denominational holiday - New Years Day, Valentine's Day, Independence Day, and Halloween. Students should be initially puzzled by what this list represents - it may be helpful to point out the format of the list (two numbers) and that this list happens throughout the year.
Alternate Discussion: This example could be adapted to fit your classroom or school environment in order to better help your students predict what the list represents. For example: a list of room numbers in your school that students can relate to, or a list of street addresses that have meaning to students. If you decide to adapt this example, make sure it still addresses the larger concept that this warm-up introduces: that numbers can be used to represent different types of information.
Activity (35 mins)
- In our warm-up, we used numbers to represent certain type of information. In today's activity, we will also use numbers to represent something that computers use pretty frequently: text messages.
Group: Place students in pairs. Assign students to "Partner A" or "Partner B".
Distribute: Give each pair a few sticky notes, or some other way to record short sequences of numbers.
Do This: Consider the following samples:
- hey
- ttyl
- morning
Using only numbers, you will need to communicate these samples to a partner. No letters or other characters (including spaces) allowed! Come up with a system that allows you to do this.
Teaching Tip
Most likely students will arrive at a system where they assign each character to a corresponding number.
For example: a = 1, b = 2
If students are struggling, remind them to consider each character individually rather than the whole word at once.
The four challenges are designed to test the limits of the students' systems. For each challenge, after one partner has put their head down, click through to reveal the challenge to the the other partner.
After the partner has translated the message to numbers, they hand the sticky note to the other partner and put their head down. The other partner translates back to English.
After the challenge is done, give students a few minutes to update their systems as needed.
Be on the lookout for cheats in a system - students cannot use spaces (aside from between two numbers to differentiate that where one number stops and the other starts) or symbols - only numbers one after the other.
Challenge #1 - Spaces
Do This:
- Partner A: Heads down!
- Partner B: On a sticky note, use your system to write the message: oh no
- Partner A: Heads Up! Translate the message on the sticky note using your system.
- Partner B: Heads down!
Do This: Heads up! Check your answers. After students have checked, allow them time to update their system as needed.
Challenge #2 - Punctuation
Do This:
- Partner A: Heads down!
- Partner B: On a sticky note, use your system to write the message: Great!
- Partner A: Heads Up! Translate the message on the sticky note using your system.
- Partner B: Heads down!
Do This: Heads up! Check your answers. After students have checked, allow them time to update their system as needed.
Challenge #3 - Capitals and Numbers
Do This:
- Partner A: Heads down!
- Partner B: On a sticky note, use your system to write the message: Free at 5?
- Partner A: Heads Up! Translate the message on the sticky note using your system.
- Partner B: Heads down!
Do This: Heads up! Check your answers. After students have checked, allow them time to update their system as needed.
Challenge #4 - Review all symbols
Do This:
- Partner A:Heads down!
- Partner B: On a sticky note, use your system to write the message: Cya 2nite!
- Partner A: Heads Up! Translate the message on the sticky note using your system.
- Partner B: Heads down!
Do This: Heads up! Check your answers. After students have checked, allow them time to update their system as needed.
Prompt: Find another group. Discuss with them the following prompts:
- Compare your systems. How are they the same? How are they different?
- What's the minimum number of bits each of your system would need per character? How do you know?
- Hint: Convert your largest number in your system into binary. How many bits does this number require?
Discuss: Have groups compare with each other, then move to a full group discussion. Ask groups to share out what they discussed about their systems.
Discussion Goal
- There's many possible systems and there's usually not a "right" one so long as everyone agrees.
- Adding more possibilities increases the risk of having too many characters to represent and not enough bits to do it. This is a practical example of the overflow and rounding issues from the previous lesson.
Introduce ASCII
- You just invented your own scheme for representing text with numbers. Given we use text on our phones and computers all the time, we should assume there is a standard representation for most of the symbols you can type on an American keyboard. Today we're going to be looking at one called or ASCII (pronounced: "Ask-ee") or the American Standard Code for Information Interchange
Hand out copies of the ASCII Reference Sheet or project it. Quickly read the overview text at the beginning of the sheet.
Teaching Tip: Students should be aware that ASCII exists and see how its development mirrors their own experiences in the previous activity, but they are not required to memorize the ASCII table. If your students are able to quickly recognize the point of the ASCII table feel free to move on to the wrap up.
Prompt: Compare ASCII to the system you developed.
- What's the same as the systems you created?
- What's different?
- What is most interesting or surprising about this system?
Discuss: Briefly discuss these prompts as a class. At this point the main features of the system should be familiar but use this discussion to reinforce previous points.
Wrap up (5 Minutes)
- Representing text is an example of abstraction, which is when we create simplified representations of something more complex. This lets us hide the details and instead focus on problems at a higher level.
Prompt
- What problem were we trying to solve today?
- What detail from the last few lessons was hidden or out of focus?
Discussion Goal
- Students should identify they were trying to send text messages.
- Students were using decimal numbers instead of binary numbers or AB patterns
Remarks
- Sending text messages is an example of abstraction. For a computer, each character is really just a number, which itself is really a binary number. It all comes back to zeroes and ones!
Prompt: What is another example of an abstraction in your everyday life? Something where you don't completely understand how it works but you can still use it with confidence?
Discussion Goal: Student answers will vary. Examples: driving a car, turning on the lights in your room, riding in an elevator, etc.
Assessment: Check for Understanding
For Students
Open a word doc or google doc and copy/paste the 3 following question.
Question
"The binary pattern 01000001 represents the number 65." Write a brief response explaining whether or not you believe this statement is always true. Explain your reasoning.
Standards Alignment
- CSTA K-12 Computer Science Standards (2017): AP - Algorithms & Programming: 3A-AP-21 - Evaluate and refine computational artifacts to make them more usable and accessible.
- CSTA K-12 Computer Science Standards (2017): DA - Data & Analysis: 3A-DA-09 - Translate between different bit representations of real-world phenomena, such as characters, numbers, and images.
- CSP2021: DAT-1.A.5, DAT-1.A.6, DAT-1.A.7
Next Tutorial
In the next tutorial, we will discuss CSP Digital Information Lesson 7, which describes how to encode black and white images.