D1 June 2007 Q3

EdexcelOld spec9 marksAlgorithms

3. An algorithm is described by the flow chart shown in Figure 3.

Figure 3: flow chart. Let A = 0, input x, y; if x even, x = x / 2 and y = 2y and repeat; if x odd, A = A + y, x = x - 1, then if x = 0 output A and stop, else x = x / 2, y = 2y
Figure 3
(a) Given that \(x = 54\) and \(y = 63\), complete the table in the answer book to show the results obtained at each step when the algorithm is applied. (7)
(b) State what the algorithm achieves. (2)