NZ Level 3

Following Algorithms

Lesson

Image by Mateyko Thiessen

An algorithm (pronounced al-go-ri-them) is a step by step guide on how to do something.

We use them all the time, although you probably didn't realise. Ever followed a recipe? That is an algorithm.

Do you know how to use the column addition method? Then you have learned and applied an algorithm.

It is important that the steps are clear. This is why if you follow a recipe they often split it up into parts, so it is easy to see what to do and in which order.

Algorithms are used in computing too. It is even more important to be clear when writing instructions for a computer as they cannot guess what you mean. When we give instructions to computers we need to write code or use a flow chart. There are lots of different types of code (they are called languages) but they work in the same ways.

Remember!

For an algorithm you need to make sure each step is clear

You also have to make sure you give the correct order

Look at the following algorithm. Try to work out what it is for.

- boil kettle
- put teabag into tea cup
- add milk
- put water into kettle
- take out teabag
- stir with a spoon
- add one teaspoon of sugar

Could you guess this was supposed to be the instructions for how to make a cup of tea? What was wrong with the algorithm? What do you need to do to improve it?

Now try writing a short algorithm for yourself. Imagine you are giving your algorithm instructions to a robot. Would the robot know what to do?

You could try writing an algorithm to explain how to:

- walk from your school to the nearest park
- make a snow angel
- pat a dog
- grow a sunflower

Choose all the tasks below that can be completed by following an algorithm.

Falling asleep

AFalling in love

BCooking a meal from a recipe book

CBuilding a toy out of Lego

DFalling asleep

AFalling in love

BCooking a meal from a recipe book

CBuilding a toy out of Lego

D

Follow this algorithm.

Start with the number $16$16.

Add $5$5 to $16$16.

Double your answer to part a.

Follow this algorithm and work out the output at each step.

Output **Step 1:**Start with $80$80$\editable{}$ **Step 2:**Add $19$19 to $80$80$\editable{}$ **Step 3:**Round the result to the nearest ten.$\editable{}$