Designing an algorithm
Time Needed: 30 minutes
Supplies Needed:
- Whiteboard and markers
- filled grid sheet for each learner to have one.
- Enough copies of the 4×4 blank grid sheet for each learner to have one.
- Crayons or other colouring medium.
- Pencils and paper for writing out their algorithm.
Learning Goal: Learners will demonstrate understanding of what an algorithm is by creating and testing their own simple algorithm in pairs.
Activate (3 minutes):
- Explain that an algorithm is a set of instructions that will give a result, such as a recipe or even Lego kit instructions.
- Revisit the main topic of the video: an algorithm online often gathers information based on your actions to decide what to show you next.
Acquire (9 minutes):
- As a class, write out an algorithm for an everyday classroom task, such as putting away supplies, sharpening a pencil or putting on a jacket.
- Write the instructions or use simple drawings on the board to illustrate the steps needed to complete the task.
- Test out the algorithm by having students follow their own steps exactly. Adjust the algorithm until it is easiest to complete.
- Rearrange the steps of the task and ask: does it still make sense? Explain that sometimes the order of tasks doesn’t matter, and sometimes it does.
- Challenge the learners to change their algorithm for unexpected circumstances. For example, what if the jacket zipper gets stuck or the supplies spill on the floor? What if there’s a fire drill?
- Explain that this is how computers create algorithms: they are constantly adjusting their choices based on the unexpected actions YOU take.
Apply (18 minutes):
- Hand out the filled grid sheet and ask learners to colour in particular squares in each grid.
- On the space beside the grid, have them write the instructions for someone else to be able to colour in the correct squares, using only text or symbols, but no actual grids.
- Have the learners fold the paper in half lengthwise, hiding the grid-side of the paper underneath.
- Hand out the blank grid sheet and have students test their classmate’s algorithm.
- Debrief the activity. Were there many errors? What were some common ones? How much would order matter in the ways people chose to represent their algorithms?
- Explain the purpose of the exercise is to understand that computers do not “think”, they merely follow instructions, even though the instructions are more complicated than in this activity. They have instructions to follow for millions of possible actions, but only the learner themselves can actually think independently.