What Is An Algorithm?
An algorithm is a list of steps, written in the right order, that finishes a job. Recipes, hand-washing routines and the instructions for tying shoelaces are all algorithms β and so is every set of instructions a computer follows, from sorting a class list by name to working out the fastest MRT route.
Algorithms matter because computers have no common sense. A person told to "cook the rice properly" will fill in the gaps; a computer cannot. Instructions must be exact ("add 2 cups of water"), complete, and in a sequence that actually works β soap goes on after the tap is turned on, socks before shoes. Change the order and the same steps produce a mess.
The core ideas a young learner picks up are: sequence (order changes the result), precision (vague steps fail), repetition (a step like "find the smallest, put it first, repeat" is how Selection Sort works), and debugging β finding the one wrong or missing step when a program misbehaves. These are the foundations of computational thinking that Primary-school coding, robotics and Scratch work all build on.
βΆ Play the lesson β free, no signup
Want to create your own Spark? Sign up free β type any skill and LearnBuddy builds you a playable lesson.
Sign up free to create your own SparkWhat this Spark covers
-
A recipe for anythingπ€ β π What Is An Algorithm? An algorithm is just a list of steps, in the right order, that gets a job done. You already use algorithms every day! π₯ͺ Making a sandwich π¦· Brushing teeth π Taking bus 88 home β Long division A computer can't guess what you mean. So we must tell it every step β clearly, and in order. π In this lesson you will give steps to a robot, spot a bug, and even sort numbers like a computer does. Tap Next to begin!
-
Steps in orderEvery algorithm has steps πͺ Here is the algorithm for washing your hands. Tap each step to see why the order matters. 1 Turn on the tap π°Water first β soap needs wet hands to make bubbles. 2 Put soap on your hands π§ΌSoap grabs the germs so water can carry them away. 3 Rub for 20 seconds β±οΈRepeating a step is allowed β computers love repeating! 4 Rinse and dry π€²The last step tells us the job is finished.
-
Program the robotGive the robot exact steps π€ Robo must reach the star β. Add step-cards to build your program, then press Run. Robo does exactly what you say β nothing more! β β‘οΈ Right β¬οΈ Down β©οΈ Undo βΆοΈ Run
-
Clear, not vagueSteps must be clear π A computer has no common sense. "Make it nice" means nothing to it. Compare these two: β Too vague 1. Get some rice.2. Cook it properly.3. Serve nicely. How much rice? How long? The robot freezes. π₯Ά β Clear enough for a computer 1. Put 1 cup of rice in the pot.2. Add 2 cups of water.3. Cook for 15 minutes.4. Turn off the heat. Good algorithm steps answer: What? How much? How long? When do I stop? Your turn: which step is clear enough for a computer? π °οΈ Walk for a while π ±οΈ Walk 10 steps forward π ² Walk nicely to school
-
Order mattersOrder changes everything π Same steps, wrong order = a mess! Use the β¬οΈ β¬οΈ buttons to fix this "put on shoes" algorithm, then press Check. β Check my order
-
Finding the bugHunting a bug π When an algorithm goes wrong, we say it has a bug. Fixing it is called debugging. Here is the algorithm for drinking a packet drink. One step is in the wrong place. Tap the buggy step! 1Take the drink packet from the fridge π§ 2Drink through the straw π 3Peel off the straw from the side 4Poke the straw into the hole π³οΈ β Fixed algorithm: take packet β peel straw β poke straw in β then drink. Debugging = finding the step that is out of place.
-
A real computer algorithmA real algorithm: sorting π Computers sort things all the time β names, prices, scores. Here is Selection Sort: find the smallest, put it first, repeat. π£ Do one step π Shuffle again Press "Do one step" to run the algorithm slowly.
-
You did it!π You now know what an algorithm is! π An algorithm is a list of steps that finishes a job. π Order matters β socks before shoes, straw before sipping. π Steps must be clear and exact β numbers beat "a while". π A wrong step is a bug; fixing it is debugging. π Computers use algorithms for real jobs, like sorting numbers. Try this at home: write the algorithm for making Milo π₯€ β every single step. Then read it to someone and make them follow it exactly. If they get it wrongβ¦ you found a bug! Great thinking today. You're already thinking like a computer scientist! π
Frequently asked questions
- What is an algorithm in simple words for a child?
- An algorithm is a set of steps, in order, that gets something done β like the steps for making a sandwich or brushing your teeth. Computers follow algorithms the same way, except they need every step spelt out exactly.
- Do you need to know how to code to understand algorithms?
- No. Algorithms are about thinking clearly in steps, not about typing code. Children can build and test algorithms using everyday routines, step-cards or drag-and-drop blocks long before they write a line of a programming language.
- Why does the order of steps matter so much?
- Because each step often depends on the one before it. Putting shoes on before socks uses exactly the same steps as the correct version, but the result does not work β and a computer will carry out the wrong order without complaining.
- What does "debugging" mean?
- A bug is a mistake in an algorithm β a step that is missing, wrong, or out of place. Debugging is the process of tracing through the steps one by one to find that mistake and fix it, which is a skill programmers use every single day.
- Is this related to what my child learns in school?
- Yes. Algorithmic thinking underpins the Code for Fun programme and the coding, robotics and Scratch activities many Singapore primary schools run, and it also strengthens Maths problem-solving, where working through steps in the right order is exactly what's being marked.
More Sparks like this
Related practice papers
Related reads
Loved this Spark? Sign up free for AskBuddy AI tutoring, past-year papers, and unlimited Sparks.
Sign up free β