Design algorithms involving branching and iteration - Maths Curriculum Companion - Department of Education & Training

## Teaching Context

### Victorian Curriculum

Design algorithms involving branching and iteration to solve specific classes of mathematical problems (VCMNA221)

VCAA Sample Program: A set of sample programs covering the Victorian Curriculum Mathematics.

VCAA Mathematics glossary: A glossary compiled from subject-specific terminology found within the content descriptions of the Victorian Curriculum Mathematics.

##### Achievement standards

Students recognise the properties of prime, composite, square and triangular numbers and determine sets of these numbers. They solve problems that involve all four operations with whole numbers and describe the use of integers in everyday contexts.

Students locate fractions and integers on a number line and connect fractions, decimals and percentages as different representations of the same number. They solve problems involving the addition and subtraction of related fractions.

Students calculate a simple fraction of a quantity and calculate common percentage discounts on sale items, with and without the use of digital technology. They make connections between the powers of 10 and the multiplication and division of decimals.

Students add, subtract and multiply decimals and divide decimals where the result is rational.

Students write number sentences using brackets and order of operations, and specify rules used to generate sequences involving whole numbers, fractions and decimals. They use ordered pairs of integers to represent coordinates of points and locate a point in any one of the four quadrants on the Cartesian plane.

## Teaching ideas

### Teaching a robot to perform arithmetical operations

Tab Content

The purpose of this activity is to require students to revisit what we actually do when we add two numbers. This basic idea easily gets lost when students memorise the results. They break down the process into small steps so a computer (or robot) will be able to follow.

Students start with teaching the robot to add two small numbers; place value will not be involved. This will take them back to thinking about what adding actually means.

There will need to be a ‘counter’ (the student) who counts out the first number and then counts on while the second number is added.

An alternative is to use a number line, moving right from 0 for the first number, and then moving right extra steps for the second number.

Students need to think out how to tell the robot what to do to get the sum of the two numbers. When they think they have an algorithm that works, students should test it for themselves with two numbers. After testing students can determine if their design was effective, or if they need to add or remove steps to their design.

Tab Content

Here is one possible algorithm; in line 4 the second number is used to make the count increase.

Example: 3 + 2

Lines 1, 2 and 3 will put 3 blocks onto the answer pile, and the count will be at 3.

Lines 1, 2 and 4 will put 2 more blocks onto the pile and the count will be at 5.

Tab Content

Extensions:

'Subtract two numbers'

The purpose of this activity is to require students to revisit what we actually do when we subtract one number from another. This basic idea easily gets lost when students memorise the results. They break down the process into small steps so a computer (or robot) will be able to follow.

This time we count out the larger number and then remove the smaller number of blocks from it. Again the counter is the student. Students should test their algorithm with two numbers. If using the number line alternative, there are steps to the right for the first (larger) number followed by steps to the left for the second (smaller) number. Here is one possible algorithm; in line 4 the second number is used to make the count decrease.

Example: 3 – 2

Lines 1, 2 and 3 will put 3 blocks onto the answer pile, and the count will be at 3.

Lines 4, 5 and 6 will take 2 blocks from the pile and the count will be at 1.

Tab Content

Multiply one number by another

The purpose of this activity is to require students to revisit what we actually do when we multiply two numbers. This basic idea easily gets lost when students memorise the results. They break down the process into small steps so a computer (or robot) will be able to follow. This is designed to remind students that multiplication is just repeated addition. The first number (the ‘multiplier’) tells how many times the second number (the amount) is added. The counter is the student. Students should test their algorithm with two numbers.

Example: 3 x 2 Line 6 will add 2 blocks to the answer pile, and continue to do this three times, when the counter is at 3 and the process stops.

Tab Content

Divide one number by another

The purpose of this activity is to require students to revisit what we actually do when we divide one number by another. This basic idea easily gets lost when students memorise the results. They break down the process into small steps so a computer (or robot) will be able to follow.

In a division question, we are splitting the first amount equally into the second number of ‘share piles’. If there is a remainder, we will say what it is. The counter is the student. Students should test their algorithm with two numbers.

Example: 13 ÷ 3. There are 3 ‘share piles’. Line 2 will move one of the 13 blocks to each of 3 piles and continue to do it 4 times, until there is only one block left (less than 3). The answer is 4 (blocks in each of 3 piles) and there is 1 over.

### Calculate expressions using "order of operations'

Tab Content

Having taught their robot all the operations, students now need to give instructions for evaluating expressions with more than one operation. They break down the process into small steps so a computer (or robot) will be able to follow.

The order of operations precedes this content at level 6 (VCMNA220) and this is a good time and method to get the order quite clear. The algorithm is a series of simple yes/no decisions. It can become more complicated if there are two sets of brackets; this has been ignored here.

### Create a reflection image of a point in s mirror line

Tab Content

Students know that mathematics comprises more than number operations. To perform well in this activity, encourage students to think carefully about what makes a reflection image in a mirror line, and also what gives a shape the property we call line symmetry. Students can teach the robot to create a mirror reflection of a shape in a mirror line, point by point. If we do this for all the vertices of any shape, we could join the vertices with lines. In this case let us assume that the robot knows how to make lines equal in length and to draw 90° angles.

The challenge for students is to recognise that the equal distances and the right angle in this drawing is what constitutes creating a mirror image.

Tab Content

Extension: Test a shape for line symmetry The test for line symmetry uses the same ideas backwards. In this case let us assume that the robot knows how to make midpoints and test for 90° angles

## Related content areas

###### Previous Level
Following a mathematical algorithm
###### Next Level
Design and implement mathematical algorithms