Learning objective: Explain that an algorithm is a set of step-by-step instructions, and give a simple example of an everyday algorithm.
An algorithm is a set of step-by-step instructions for doing something. You use algorithms every single day, even without realizing it!
Look at the diagram above: brushing your teeth follows an algorithm — wet the toothbrush, add toothpaste, then brush your teeth. Each step happens in a specific order.
Notice that the steps happen in a specific order — you wouldn't brush your teeth before adding toothpaste! If you did the steps in the wrong order, the algorithm wouldn't work correctly.
Even though computers (from the last lesson) follow instructions to do tasks, algorithms aren't only for computers — people follow algorithms too, like the teeth-brushing example, or a recipe for making a sandwich.
Think about your morning routine — waking up, getting dressed, eating breakfast. That's an algorithm too! Can you list the steps in order?
An algorithm is a set of steps, in order. This one has 3 steps for brushing your teeth.
What is an algorithm?
Does the order of steps in an algorithm matter?
Are algorithms only used by computers?
Describe your morning routine as a step-by-step algorithm, listing at least 3 steps in the correct order.