Do you know how to use a function machine? It's like an algorithm with just one step.
Look at the following function machine:
Complete this table of inputs and outputs:
Input | Output |
---|---|
6 | |
7 | |
8 |
Function machines show the relationship between the input (starting number) and output (answer).
If you are given the output, you can find the input by reversing the rule.
To explore what an algorithm is, we'll use an example of getting dressed, then see how we can use an algorithm to sort some coins into order by value.
Write 327 in expanded form by following these steps:
First, write down the hundreds part.
Next, write down the tens part.
Now, write down the units (ones) part.
Now, write the number in expanded form by adding these three numbers together.
⬚+⬚+⬚
An algorithm is a set of steps that tells us what we need to do, and when. It can be used in lots of ways, but we have seen how to use it to sort numbers into different orders.