All worksheets topics

Algorithms and flowchartsIB MYP Maths Extended: Subtopic test

10 questions, 27 marks

IB MYP Maths Extended

Algorithms and flowcharts

Total 27 marks

Name

Class

Date

  1. 1
    An algorithm is written in steps. Step 1: Set n=5n=5 and total=0total=0. Step 2: Add nn to totaltotal. Step 3: Reduce nn by 11. Step 4: If n>0n>0, go back to Step 2; otherwise output totaltotal and stop.
    (a)
    What does the algorithm output?
    [1 mark]
    • A1010
    • B1515
    • C55
    • D1414
    (b)
    How many times is Step 2 carried out?
    [1 mark]
    • A44
    • B66
    • C1515
    • D55
    (c)
    Step 1 is changed to set n=8n=8. Find the new output.
    [2 marks]

    Total for question 1: 4 marks

  2. 2
    A flowchart takes a number xx as its input. Process: double xx and subtract 33 to get yy. Decision: if y>10y>10, output the word "Large"; otherwise output yy.
    (a)
    What is the output when x=4x=4?
    [1 mark]
    • A55
    • B"Large"
    • C88
    • D1111
    (b)
    What is the output when x=6.5x=6.5?
    [1 mark]
    • A"Large"
    • B1313
    • C1010
    • D1616
    (c)
    Find the smallest whole number input that gives the output 'Large'.
    [2 marks]

    Total for question 2: 4 marks

  3. 3
    A sequence is generated by an algorithm. Step 1: Set the first term u1=3u_1=3. Step 2: To get the next term, multiply the previous term by 22 and then add 11. Step 3: Repeat Step 2 until the terms needed have been found.
    (a)
    Use the algorithm to find the first five terms of the sequence.
    [3 marks]
    (b)
    Continue the algorithm to find the first term that is greater than 500500, and state its position in the sequence.
    [4 marks]

    Total for question 3: 7 marks

  4. 4
    An algorithm solves equations of the form ax+b=cax+b=c. Step 1: Input aa, bb and cc. Step 2: Subtract bb from cc. Step 3: Divide the result by aa. Step 4: Output the answer as xx.
    (a)
    (i) Use the algorithm with a=3a=3, b=5b=5 and c=29c=29 to find xx.
    (ii) Explain why the algorithm fails when
    a=0a=0.
    [6 marks]
    (b)
    Write the steps of an algorithm to solve px+q=rx+spx+q=rx+s, where p≠rp\ne r. Use your algorithm to solve 5x+7=2x+225x+7=2x+22 and verify your answer.
    [6 marks]

    Total for question 4: 12 marks

End of questions

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).