AQA D1 2007 January — Question 5 8 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2007
SessionJanuary
Marks8
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeAlgorithm Tracing
DifficultyEasy -1.2 This is a straightforward algorithm tracing exercise requiring students to follow simple arithmetic operations and conditional statements. Part (a) involves mechanical step-by-step execution with small numbers, part (b) requires recognizing the algorithm computes LCM (lowest common multiple), and part (c) applies this understanding. No complex problem-solving or novel insight needed—purely procedural work typical of D1 module.
Spec7.03c Working with algorithms: trace, interpret, adapt

5 A student is using the following algorithm with different values of \(A\) and \(B\).
Line 10Input \(A , B\)
Line 20Let \(C = 0\) and let \(D = 0\)
Line 30Let \(C = C + A\)
Line 40Let \(D = D + B\)
Line 50If \(C = D\) then go to Line 110
Line 60If \(C > D\) then go to Line 90
Line 70Let \(C = C + A\)
Line 80Go to Line 50
Line 90Let \(D = D + B\)
Line 100Go to Line 50
Line 110Print \(C\)
Line 120End
    1. Trace the algorithm in the case where \(A = 2\) and \(B = 3\).
    2. Trace the algorithm in the case where \(A = 6\) and \(B = 8\).
  1. State the purpose of the algorithm.
  2. Write down the final value of \(C\) in the case where \(A = 200\) and \(B = 300\).

5(a)(i)
AnswerMarks Guidance
\((D)\) \(2\), \((B)\) \(3\), \(C\) \(0\), \(D\) \(0\) with totals \(2\), \(2\), \(3\), \(4\), \(6\), \(6\)M1, A1, A1 SCA: as far as \(D = 3\); For 4; All correct (3 marks total)
5(a)(ii)
AnswerMarks Guidance
\((D)\) \(6\), \((B)\) \(8\), \(C\) \(0\), \(D\) \(0\) with totals \(6\), \(8\), \(12\), \(16\), \(18\), \(24\), \(24\)M1, A1, A1 SCA: as far as \(D = 8\); For 12; All correct (3 marks total)
5(b)
AnswerMarks Guidance
Find LCMB1 Allow lowest common denominator (1 mark total)
5(c)
AnswerMarks Guidance
\(600\)B1 (1 mark total)
**5(a)(i)**
| $(D)$ $2$, $(B)$ $3$, $C$ $0$, $D$ $0$ with totals $2$, $2$, $3$, $4$, $6$, $6$ | M1, A1, A1 | SCA: as far as $D = 3$; For 4; All correct (3 marks total) |

**5(a)(ii)**
| $(D)$ $6$, $(B)$ $8$, $C$ $0$, $D$ $0$ with totals $6$, $8$, $12$, $16$, $18$, $24$, $24$ | M1, A1, A1 | SCA: as far as $D = 8$; For 12; All correct (3 marks total) |

**5(b)**
| Find LCM | B1 | Allow lowest common denominator (1 mark total) |

**5(c)**
| $600$ | B1 | (1 mark total) |
5 A student is using the following algorithm with different values of $A$ and $B$.

\begin{center}
\begin{tabular}{|l|l|}
\hline
Line 10 & Input $A , B$ \\
\hline
Line 20 & Let $C = 0$ and let $D = 0$ \\
\hline
Line 30 & Let $C = C + A$ \\
\hline
Line 40 & Let $D = D + B$ \\
\hline
Line 50 & If $C = D$ then go to Line 110 \\
\hline
Line 60 & If $C > D$ then go to Line 90 \\
\hline
Line 70 & Let $C = C + A$ \\
\hline
Line 80 & Go to Line 50 \\
\hline
Line 90 & Let $D = D + B$ \\
\hline
Line 100 & Go to Line 50 \\
\hline
Line 110 & Print $C$ \\
\hline
Line 120 & End \\
\hline
\end{tabular}
\end{center}
\begin{enumerate}[label=(\alph*)]
\item \begin{enumerate}[label=(\roman*)]
\item Trace the algorithm in the case where $A = 2$ and $B = 3$.
\item Trace the algorithm in the case where $A = 6$ and $B = 8$.
\end{enumerate}\item State the purpose of the algorithm.
\item Write down the final value of $C$ in the case where $A = 200$ and $B = 300$.
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2007 Q5 [8]}}