OCR MEI D1 2005 January — Question 3

Exam BoardOCR MEI
ModuleD1 (Decision Mathematics 1)
Year2005
SessionJanuary
TopicNumber Theory

3 The following algorithm finds the highest common factor of two positive integers. ("int (x)" stands for the integer part of x, e.g. int (7.8) = 7.) \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{b9ee9306-18ca-42b3-9f2e-b23849374b5e-4_888_693_422_717} \captionsetup{labelformat=empty} \caption{Fig. 3.1}
\end{figure}
  1. Run the algorithm with \(\mathrm { A } = 84\) and \(\mathrm { B } = 660\), showing all of your calculations.
  2. Run the algorithm with \(\mathrm { A } = 660\) and \(\mathrm { B } = 84\), showing as many calculations as are necessary.
  3. The algorithm is run with \(\mathrm { A } = 30\) and \(\mathrm { B } = 42\), and the result is shown in Table 3.2 below. \begin{table}[h]
    ABQR 1R 2
    3042112
    123026
    6
    61220
    \captionsetup{labelformat=empty} \caption{Print 6}
    \end{table} Table 3.2 The first line of the table shows that \(12 = 42 - 1 \times 30\).
    Use the second line to obtain a similar expression for 6 in terms of 30 and 12.
    Hence express 6 in the form \(\mathrm { m } \times 30 - \mathrm { n } \times 42\), where m and n are integers.