What is an algorithm?

An algorithm is a sequence of instructions or a set of rules that are followed to complete a task. This task can be anything, so long as you can give clear instructions for it.

For example, to make yourself a drink you have to follow a sequence of steps in the right order. If you do something in the wrong order you might end up making a mess.

Clear instructions

When you write an algorithm you need to include precise, step-by-step instructions.

Here are the instructions for making a smoothie:

  1. Add fruit to the blender.

  2. Add milk to the blender.

  3. Put the lid on the blender.

  4. Switch the blender on.

Imagine if we missed out one of the steps or reversed the order. We could end up switching on the blender with nothing in it. Or there could just be milk in the blender and no fruit.

That wouldn't make a very tasty smoothie, would it? In fact, it wouldn't make a smoothie at all!

An algorithm is a clear set of instructions. In this case the instructions are how to make a smoothie.

Speaking a computer's language

Computers won’t understand your algorithm as they use a different language.

It will need to be translated into code which the computer will then follow to complete a task.

This code is written in a programming language. There are many different types of programming languages.

Some that you may come across are Logo, Scratch, Blockly, Python and Kodu. Each of these languages are suited to different things.

The class in this video translate their algorithm into a coding language and program a toy car to move between two locations.

In this video Nate follows an algorithm he has written to carry out a science experiment.

Nate follows an algorithm to safely make a fireball. Don't try this at home.