Algorithms do things. Tada.
Here is another algorithm - this time a little more complex:
Algorithm Steps | Example |
---|---|
\text{Think of any two numbers from $1$ to $9$.} | \text{$3$ and $5$} |
\text{Make two $2$-digit numbers by putting them in either order.} | \text{$53$ and $35$} |
\text{Subtract the smaller number from the larger number.} | 53-35=18 |
\text{Divide the result by $9$.} | 18\div 9=2 |
\text{Finally, add the smaller starting number.} | 2+3=5 |
In the example, we chose the numbers 3 and 5 to start with. In the last step of the algorithm, we added the smaller of these numbers, 3, and got a result which was the larger number, 5.
Does this always happen? Try it yourself with two different numbers.
We are going to add these two numbers together, using the addition algorithm below:
37+46
Add the units.
Is the result at least 10?
If no - GO TO step 3.
If yes - regroup into tens and units, then GO TO step 3.
Add the tens.
Is the result at least 100?
If no - GO TO step 5.
If yes - regroup into hundreds and tens, then GO TO step 5.
Write the final answer by adding the hundreds, tens and units.
Which two numbers will be added in step 1?
Complete step 1: Add the units.
What do we need to do at step 2?
Regroup 13 into tens and units:
13 = ⬚+⬚
Now complete step 3: Add the tens.
What do we need to do at step 4?
Complete step 5: Write the final answer by adding the hundreds, tens and units.
We are going to subtract these two numbers, using the subtraction algorithm below:
91-26
Is the units digit of the first number less than the units digit of the second number?
If no - GO TO step 2.
If yes - regroup the tens from the first number to give a ten to the units, then GO TO step 2.
Subtract the units of the second number from the units of the first number.
Subtract the tens of the second number from the remaining tens of the first number.
Write the final answer by adding the results of steps 2 and 3.
Fill in the blanks below:
The units digit of the first number is ⬚.
The units digit of the second number is ⬚.
What do we need to do at step 1?
Fill in the blanks below:
We can regroup the tens part of 91 as 90=⬚+10, in order to give 10 to the units part, which will become 1+10=⬚.
Complete step 2: Subtract the units of the second number from the units of the first number.
Complete step 3: Subtract the tens of the second number from the remaining tens of the first number.
Complete step 4: Write the final answer by adding the results of steps 2 and 3.
We can use algorithms to add or subtract numbers.