Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D1 and algorithms

Follow an algorithm given as a flow chart, recording each step in a trace table

A level Further Maths · D1 and algorithms

Try a question

Apply the algorithm shown by this flow chart to the data \( u_1 = 51, u_2 = 52, u_3 = 38, u_4 = 35, u_5 = 49 \).
StartLet n = 1, A = u₁, B = u₁Box 1Let n = n + 1Box 2Let T = uₙBox 3IsT > A?Box 4YesLet A = TBox 5NoIsT < B?Box 6YesLet B = TBox 7NoIsn < 5?Box 8YesNoPrint A − BBox 9Stop
(a) Write down the values of \(A\) and \(B\) each time Box 8 is reached, when \(n = 2\) and \(n = 3\).
\(n=2\): \(A =\)   \(B =\)
\(n=3\): \(A =\)   \(B =\)

(b) Write down the output.  

(c) The algorithm is to be applied to a list of \( 12 \) numbers instead. Which box would need to be altered? Give the box number.  

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. Box 1 sets \(A = B = u_1 = 51\). Each time round, \(A\) becomes \(T\) if \(T\) is bigger (Boxes 4 and 5) and \(B\) becomes \(T\) if \(T\) is smaller (Boxes 6 and 7).
  2. (a) \(n = 2\): \(T = 52\), \(A = 52\), \(B = 51\); \(n = 3\): \(T = 38\), \(A = 52\), \(B = 38\).
  3. Then \(n = 4\): \(T = 35\), \(A = 52\), \(B = 35\); \(n = 5\): \(T = 49\), \(A = 52\), \(B = 35\).
  4. (b) When \(n = 5\), Box 8 answers No and Box 9 prints \(A - B = 52 - 35 = 17\): the range of the list.
  5. (c) For a list of 12 numbers only the stopping test changes: Box 8 becomes \(n \lt 12\).
  6. Answers: (a) 52, 51, 52, 38; (b) 17; (c) Box 8.

Answer: a) 52 b) 51 c) 52 d) 38 e) 17 f) 8

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.