Algorithms and flowcharts: MYP maths practice

Standard and extendedDiscrete mathematicsMYP 4-5

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.

Practise this topic

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.

  1. Find the output when the input is 7. [1]
  2. Find the output when the input is −2. [1]
  3. Which input gives the output 26? [2]
3 steps · 1 to fill in

Question 2 · No calculator · Medium

An algorithm for two whole numbers A>B: 1. Input A and B. 2. Find the remainder R when A is divided by B. 3. Replace A by B and then B by R. 4. If B≠0, go back to step 2. 5. Output A. The inputs are A=252 and B=105.

  1. Write down the output. [2]
  2. How many times is step 2 carried out? [1]
2 steps

Question 3 · No calculator · Hard

An algorithm: 1. Set a=2 and b=5. 2. Set c=a+b. 3. Set a=b, then set b=c. 4. If c<100, go back to step 2. 5. Output c.

  1. Write the first four values of c, in order, as a list. [2]
  2. Write down the output. [1]
  3. How many times is step 2 carried out? [1]
3 steps

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.