AQA D1 2010 January — Question 6

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2010
SessionJanuary
TopicFixed Point Iteration

6 A student is finding a numerical approximation for the area under a curve.
The algorithm that the student is using is as follows:
Line 10 Input \(A , B , N\)
Line 20 Let \(T = 0\)
Line 30 Let \(D = A\)
Line \(40 \quad\) Let \(H = ( B - A ) / N\)
Line \(50 \quad\) Let \(E = H / 2\)
Line 60 Let \(T = T + A ^ { 3 } + B ^ { 3 }\)
Line \(70 \quad\) Let \(D = D + H\)
Line 80 If \(D = B\) then go to line 110
Line 90 Let \(T = T + 2 D ^ { 3 }\)
Line 100 Go to line 70
Line \(110 \quad\) Print 'Area \(=\), \(T \times E\)
Line 120 End
Trace the algorithm in the case where the input values are:
  1. \(A = 1 , B = 5 , N = 2\);
  2. \(A = 1 , B = 5 , N = 4\).