# Lesson 7: Storage

## Overview

In this lesson students develop an algorithm to process a small deck of cards, looking for the smallest, largest, second largest, and middle card. The lesson begins with a reflection on the kinds of storage students may already be familiar with a computer doing. The teacher then introduces today's focus on the importance of short term storage within the processing of information. Students spend the majority of the lesson developing and sharing algorithms to process information. The lesson concludes with a discussion of the importance of storage while processing information.

## Purpose

This lesson serves multiple roles. Firstly it serves to reinforce what students learned in the previous class about algorithms. Students will see another instance where an algorithm is used to process an input and generate an output. Secondly this lesson demonstrates the importance of storage, as represented by the "safe spots" in the activity, during the processing of information. In the next lesson students will investigate ways that longer term and large storage of information (e.g. databases of user information) are important in the functioning of apps they use. Finally this lesson just presents another opportunity to create, reason about, and critique algorithms.

## Agenda

### Warm Up

### Activity

### Wrap Up (15 mins)

## Objectives

### Students will be able to:

- Compare the storage requirements of different algorithms for processing information
- Explain the need for storage as part of processing information in a computer
- Develop an algorithm to complete a task

## Preparation

- Print copies of Storage and Processing - Activity Guide
- Several decks of cards to share among the class
- Packs of sticky notes or squares of paper

## Links

### For the Students

- Storage and Processing - Activity Guide (PDF | DOCX)

## Support

### Report a Bug

# Teaching Guide

## Warm Up

### What is Storage?

**Prompt:** So far we have looked closely at input, output, and processing. We haven't looked much at "storage" in the context of a computer. What things might a computer need to store in order to work? Can you think of any examples of something a computer stores?

Discussion Goal

**Goal:** The prompt alone highlights the fact that today's lesson will be focused on storage. The discussion is intended to highlight common ways people think about storage in a computer. It's okay to slightly "mislead" students towards long term storage or files here as you lead the discussion, e.g. with prompts like "what other kinds of things do you think a computer has to store"? The following transitional comment acknoweldges those ideas and highlights that today's lesson examines a different kind of short term storage computers.

Potential answers to the prompt include: photos, documents, videos, video games, text messages, emails, programs

**Discuss:** Have students brainstorm a list of examples at their tables. When ready have students share their answers with the class and record their answers on the board. Create a running list.

Remarks

When we think of storage we often think of files. Music, photos, documents, movies, and plenty of other things need to be stored on a computer to use them. What we don't often realize, however, is the importance of storage even inside the processing of information. Today we're going to explore algorithms again with a new challenge, this time that shows us a little bit about how computer scientists think about storage.

## Activity

### Finding Cards

**Group:** Place students in groups of 2 to 3. Larger groups likely will not be productive

**Distribute:** Storage and Processing - Activity Guide to each group as well as a deck of a cards and a small stack of post its

#### Storage and Processing Activity Guide

Content Corner

**The Role of Storage in Processing:** Computers don't just "remember" information, they need to store it to come back later. The "safe spots" in this activity are a visual representation of how a computer might store results during an algorithm (processing) in order to keep track of its progress. Many people might be more aware of how computers store files with documents, spreadsheets, movies, and photos. This activity shows that storage is just as necessary during the actual processing of information as well.

**Storage and Processing:** As a class or out loud read through this section introducing the point of the activity.

Teaching Tip

**Demo the Rules:** This rules video provides a quick explanation of the rules of the activity. Rather than having kids read the rules just demo the rules yourself. This teacher-facing video provides some insights into the point of the activity.

**Setup and Rules:** Read through the rules together and answer questions students have about them. You may wish to demonstrate how the activity will work as well.

Teaching Tip

**Input and Output:** To reinforce the role of "input" and "output" the activity asks students to record the inputs and outputs of their algorithm. In each case the input will be the small pile of cards they begin with and the output will be the card they are looking for.

**Challenge 1 - Smallest Card:** Ask students to first work in small groups to develop their algorithm by hand. They should run them a few times with new small stacks of cards to make sure it works and follows the rules.

Once they have a working algorithm have students write the steps of their algorithms as well as how many safe spaces they need on their activity guide so that another group would be able to follow the steps.

**Trade Rules:** Each group should then trade their rules with another group and ensure the algorithms work.

**Discuss:** Have groups share whether their algorithms were the same and how many safe spaces they needed to use.

**Challenge 2 - Largest Card:** This challenge is almost identical to the last. Once again have students develop an algorithm to find the largest card.

Teaching Tip

**Increase the Challenge:** When groups share you can make it harder by having them start run the algorithm themselves and then stop partway through before trading.

**Trade Rules:** Once again each group should then trade their rules with another group and ensure the algorithms work.

**Discuss:** Have groups share similarities and difference they noticed between their algorithms and the one they tried. Again compare how many safe spaces students needed to use.

**Challenge 3 - Second Largest Card:** Repeat the same steps for this challenge.

**Challenge 4 - Middle Card:** This challenge is quite difficult and may need to be scaffolded by asking students to find the "third largest" card and see what they come up with. Their eventual realization should be that they need at half the number of cards worth of safe spots to complete this challenge successfully. Give students time to come to this realization or help them understand why it is the case.

## Wrap Up (15 mins)

Discussion Goal

**Goal:** The first prompt makes sure that students can accurately identify the inputs, outputs, storage, and processing in this activity. If students have used the activity guide they should understand that the input is the stack of cards, the output is the card they were looking for, the storage was being done on the safe spots, and the processing was the algorithms they wrote.

The second prompt seeks to highlight the role of storage in the processing of information. Students may note that they "lose" information if it's not stored on a safe spot. The same is true for a computer which cannot "remember" things, it needs to store them. As a result storage and processing go hand in hand.

The third prompt should be used to discuss real-world situations where a "largest" or "smallest" thing is found. This is a chance to make some connections. Possible examples include

- Finding the cheapest product online, Input: info on all products Output: cheapest
- Finding the most liked photo today, Input: info on all photos Output: most liked
- Finding the most watched video Input: info on all videos Output: most watched

See how many others students can think of and use this as a chance to reinforce an understanding of the inputs and outputs in everyday computing tasks. Students will see this in more detail in the following lesson.

### Reviewing Storage and Processing

**Prompt:** Ask students to consider each of the following questions as part of a debrief conversation from the activity. This can also be completed as a journal. It may make sense to run a conversation after each prompt rather than have students write responses to all three.

- What were the inputs, outputs, storage, and processing in this activity?
- Why did you need to store information as a part of your algorithms in this activity?
- When have you ever used a computer to find the "largest" or the "smallest" of something? What are the inputs and outputs in that example?

**Discuss:** Students should share their responses in small groups before discussing as a whole class.

Remarks

We now have a pretty firm understanding of what is meant by the input-output-store-process model of a computer. Next time we're going to explore in more detail how the apps we use everyday use this model to help us solve problems.

- Lesson Overview
- Student Overview

# Overview

In this lesson you'll learn about the kinds of information computers store and how storage is a critical part of processing information.

## Resources

- Storage and Processing - Activity Guide (PDF | DOCX)