Algorithms: Step-by-Step Thinking
A precise recipe of ordered steps that solves a problem
- say what an algorithm is in simple words,
- write clear, ordered steps for an everyday task,
- explain why the order and the precision of the steps matter.
1. What is an algorithm?
An algorithm is a set of steps you follow, in order, to get something done. It is like a recipe. A recipe tells you exactly what to do first, next, and last, so that anyone who follows it gets the same result.
You already use algorithms every day, even if you never called them that. When you brush your teeth, tie your shoes, or make a sandwich, you follow steps in a certain order. An algorithm is simply that list of steps written down clearly.
Computers need algorithms because they cannot guess. A computer does exactly what the steps say. So the steps must be clear, in the right order, and have a beginning and an end.
2. Algorithms are all around you
Whenever you do a task the same way each time, you are following an algorithm. Look at these everyday examples:
| Everyday task | The algorithm (steps in order) |
|---|---|
| Brushing teeth | Wet the brush, add toothpaste, brush, rinse |
| Making tea | Boil water, add tea bag, pour water, wait, drink |
| Tying shoes | Cross the laces, make a loop, wrap, pull tight |
| Following a map | Go straight, turn left, walk to the corner, stop |
| Baking a cake | Mix, pour, bake, wait, decorate |
Notice that every task has a clear order. You would never rinse before you brush, or eat the cake before you bake it!