Build and Debug a Classroom Algorithm
Students create, follow, and improve a sequence of precise steps for guiding a classmate through a simple classroom task.

Illustrations are auto-generated and may be placeholders. They can be refreshed to match the narration.
What Is an Algorithm?
An algorithm is a list of steps for completing a task. The steps tell what to do and in what order. We use algorithms every day, even when we do not call them algorithms. For example, an algorithm for putting away a book could say: pick up the book, walk to the bookshelf, find the matching shelf, place the book on the shelf, and return to your seat. Each step should be clear and exact. If a step only says “put it there,” a classmate may not know where “there” is. Good algorithms name the action and the place. Talk with your group about the task. Listen when others speak, ask helpful questions, and agree on the goal before writing the steps.

Put the Steps in Order
An algorithm works only when its steps are in a useful order. Imagine that your task is to sharpen a pencil with a classroom pencil sharpener. First, collect the mixed-up step cards. The cards might say: take out the pencil, place the pencil in the sharpener, turn the handle, remove the pencil, and check the point. Ask, “What must happen first?” You cannot turn the handle before the pencil is in the sharpener. Work with classmates to arrange the cards from first to last. Take turns explaining your choices. Use order words such as first, next, then, and last. If two classmates disagree, listen to both ideas and test the order together. Choose the sequence that completes the task safely and correctly.

Follow the Classroom Algorithm
Now one student can be the algorithm reader, and another can be the follower. Try an algorithm for moving a paper to the class inbox. The reader might say: stand behind your chair, pick up one paper, face the inbox, walk forward four steps, stop beside the inbox, place the paper inside, and return to your chair. The follower should do only what each step says. This helps the group notice whether the directions are precise. For example, “go over there” is not precise, but “walk forward four steps” gives useful information. Move safely and keep the path clear. Everyone else should watch closely and record what happens. After the test, take turns sharing observations. Speak one at a time, listen attentively, and describe the actions without blaming the person who followed the steps.

Find the Bug
A bug is a problem in an algorithm. A bug can be a missing step, a step in the wrong order, or a direction that is not clear. Finding and fixing the problem is called debugging. Suppose an algorithm says: pick up the paper, walk four steps, place the paper in the inbox. During the test, the student walks away from the inbox because the algorithm never says which way to face. Ask questions: “Where did the result change?” and “What information is missing?” The missing direction is the bug. Add “face the inbox” before “walk four steps.” Then test the algorithm again. Do not blame the follower. The test gives the group helpful information. Observe carefully, discuss one idea at a time, and agree on the change that best solves the problem.

Improve and Share the Steps
After debugging, improve the algorithm so another classmate can use it easily. Read every step aloud and ask, “Is the action exact? Is the place named? Is the order correct?” For the inbox task, a final algorithm might say: stand behind your chair, pick up one paper, face the blue inbox, walk forward four small steps, stop beside the table, place the paper inside the inbox, and walk back to your chair. Invite a new classmate to test the steps. Watch and gather information about what works. If the classmate hesitates, ask which direction needs more detail. Then make one helpful change and test again. Finally, share the algorithm with the class. Take turns speaking, respond kindly, and make a group decision about the clearest final version.

