OCR D1 2012 January — Question 6

Exam BoardOCR
ModuleD1 (Decision Mathematics 1)
Year2012
SessionJanuary
TopicFixed Point Iteration

6 The function \(\operatorname { INT } ( C )\) gives the largest integer that is less than or equal to \(C\).
For example: \(\operatorname { INT } ( 4.8 ) = 4 , \operatorname { INT } ( 7 ) = 7 , \operatorname { INT } ( 0.8 ) = 0 , \operatorname { INT } ( - 0.8 ) = - 1 , \operatorname { INT } ( - 2.4 ) = - 3\).
Consider the following algorithm.
Line 10Input \(A\) and \(B\)
Line 20Calculate \(C = B \div A\)
Line 30Let \(D = \operatorname { INT } ( C )\)
Line 40Calculate \(E = A \times D\)
Line 50Calculate \(F = B - E\)
Line 60Output the value of \(F\)
Line 70Replace \(B\) by the value of \(D\)
Line 80If \(B = 0\) then stop, otherwise go back to line 20
  1. Apply the algorithm using the inputs \(A = 10\) and \(B = 128\). Record the values of \(A , B , C , D , E\), and \(F\) every time they change. Record the output each time line 60 is reached.
  2. Show what happens when the input values are \(A = 10\) and \(B = - 13\).