Algorithms and flowcharts: MYP maths practice
An algorithm is a precise list of steps that always gives an answer, whoever follows it. Tracing a flowchart by hand, and writing your own, trains the careful step-by-step thinking that algebra and programming both rely on.
Opens a Skill Builder on algorithms and flowcharts: a worked example, then questions marked as you go. Free account.
What you practise
Following an algorithm; Writing an algorithm as steps or a flowchart. We group it under discrete mathematics; the MYP framework places it in algebra.
Try 3 questions on algorithms and flowcharts
Have a go on paper first, then press Show me how for the worked solution.
Question 1 · No calculator · Easy
An algorithm: 1. Input a number. 2. Multiply it by 3. 3. Subtract 4. 4. Output the result.
- Find the output when the input is 7. [1]
- Find the output when the input is
. [1] - Which input gives the output 26? [2]
- (a)
, . - (b)
, . - (c) Work backwards: undo 'subtract 4' by adding 4, then undo 'multiply by 3' by dividing:
.
Question 2 · No calculator · Medium
An algorithm for two whole numbers
- Write down the output. [2]
- How many times is step 2 carried out? [1]
- Pass 1:
, so becomes . Pass 2: , giving . Pass 3: , giving . Now , so it stops. (a) 21 (the highest common factor of 252 and 105). - (b) 3 times.
Question 3 · No calculator · Hard
An algorithm: 1. Set
- Write the first four values of
, in order, as a list. [2] - Write down the output. [1]
- How many times is step 2 carried out? [1]
- Each new
is the sum of the previous two numbers: , , , , , , . (a) . - (b) 81 is below 100, so the loop continues; 131 is not, so the output is 131.
- (c) 7 values of
, so 7 times.
Teachers: this topic is in our example unit Step by step: algorithms and networks (MYP 5).
Your school builds its own MYP units, so this topic may sit in a different place, or under another name, in your course. All MYP 4-5 topics
MYP practice written and checked by us. It is not IB material, and IB Math Revision is not affiliated with or endorsed by the IB.