# 11.01 Solve problems using an algorithm

Lesson

The word "algorithm" is used in computer science, mathematics, and many other areas, to describe a process or set of steps we can follow to complete a task or problem.

Here is an algorithm:

Algorithm Steps Example
Think of any two numbers from $1$1 to $9$9. $3$3 and $5$5
Make two $2$2-digit numbers by putting them in either order. $53$53 and $35$35
Subtract the smaller number from the larger number. $53-35=18$5335=18
Divide the result by $9$9. $18\div9=2$18÷​9=2
Finally, add the smaller starting number. $2+3=5$2+3=5

In the example, we chose the numbers $3$3 and $5$5 to start with. In the last step of the algorithm, we added the smaller of these numbers, $3$3, and got a result which was the larger number, $5$5.

Does this always happen? Try it yourself with two different numbers!

#### Worked Examples

##### Question 1

We are going to add these two numbers together, using the addition algorithm below:

$37+46$37+46

 1 Add the units. 2 Is the result at least $10$10? If no - GO TO step 3. If yes - regroup into tens and units, then GO TO step 3. 3 Add the tens. 4 Is the result at least $100$100? If no - GO TO step 5. If yes - regroup into hundreds and tens, then GO TO step 5. 5 Write the final answer by adding the hundreds, tens and units.
1. Which two numbers will be added in step 1?

$7$7$\text{and}$and$6$6

A

$3$3$\text{and}$and$4$4

B
2. Complete step 1: Add the units.

3. What do we need to do at step 2?

GO TO step 3.

A

First regroup into tens and units, then GO TO step 3.

B
4. Regroup $13$13 into tens and units:

$13=\editable{}+\editable{}$13=+

5. Now complete step 3: Add the tens.

6. What do we need to do at step 4?

GO TO step 5.

A

First regroup into hundreds and tens, then GO TO step 5.

B
7. Complete step 5: Write the final answer by adding the hundreds, tens and units.

##### Question 2

We are going to add these two numbers together, using the addition algorithm below:

$89+65$89+65

 1 Add the units. 2 Is the result at least $10$10? If no - GO TO step 3. If yes - regroup into tens and units, then GO TO step 3. 3 Add the tens. 4 Is the result at least $100$100? If no - GO TO step 5. If yes - regroup into hundreds and tens, then GO TO step 5. 5 Write the final answer by adding the hundreds, tens and units.
1. Complete step 1: Add the units.

2. What do we need to do at step 2?

GO TO step 3.

A

First regroup into tens and units, then GO TO step 3.

B
3. Regroup $14$14 into tens and units:

$14=\editable{}+\editable{}$14=+

4. Now complete step 3: Add the tens.

5. What do we need to do at step 4?

GO TO step 5.

A

First regroup into hundreds and tens, then GO TO step 5.

B
6. Regroup $150$150 into hundreds and tens:

$150=\editable{}+\editable{}$150=+

7. Now complete step 5: Write the final answer by adding the hundreds, tens and units.

##### Question 3

We are going to subtract these two numbers, using the subtraction algorithm below:

$91-26$9126

 1 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. 2 Subtract the units of the second number from the units of the first number. 3 Subtract the tens of the second number from the remaining tens of the first number. 4 Write the final answer by adding the results of steps 2 and 3.
1. Fill in the blanks below:

The units digit of the first number is $\editable{}$.

The units digit of the second number is $\editable{}$.

2. What do we need to do at step 1?

GO TO step 2.

A

Regroup the tens part of $91$91, then GO TO step 2.

B
3. Fill in the blanks below:

We can regroup the tens part of $91$91 as $90=\editable{}+10$90=+10, in order to give $10$10 to the units part, which will become $1+10=\editable{}$1+10=.

4. Complete step 2: Subtract the units of the second number from the units of the first number.

5. Complete step 3: Subtract the tens of the second number from the remaining tens of the first number.

6. Complete step 4: Write the final answer by adding the results of steps 2 and 3.

### Outcomes

#### 8.C3.1

Solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves the analysis of data in order to inform and communicate decisions.

#### 8.C3.2

Read and alter existing code involving the analysis of data in order to inform and communicate decisions, and describe how changes to the code affect the outcomes and the efficiency of the code.