AS June 2019 Q2

EdexcelAS paperCurrent spec7 marksAlgorithms

2. The following algorithm produces a numerical approximation for the integral

\[I = \int_{\text{A}}^{\text{B}} x^4 \,\mathrm{d}x\]
Step 1Start
Step 2Input the values of A, B and N
Step 3Let H = (B – A) / N
Step 4Let C = H / 2
Step 5Let D = 0
Step 6Let D = D + A4 + B4
Step 7Let E = A
Step 8Let E = E + H
Step 9If E = B go to Step 12
Step 10Let D = D + 2 × E4
Step 11Go to Step 8
Step 12Let F = C × D
Step 13Output F
Step 14Stop

For the case when A = 1, B = 3 and N = 4,

(a)
(i) complete the table in the answer book to show the results obtained at each step of the algorithm.
(ii) State the final output. (4)

You may not need to use all the rows in this table.
It may not be necessary to complete all boxes in each row.

ABNHCDEF
                                                
                                                
                                                
                                                
                                                
                                                
(b) Calculate, to 3 significant figures, the percentage error between the exact value of \(I\) and the value obtained from using the approximation to \(I\) in this case. (3)