| Exam Board | AQA |
|---|---|
| Module | D1 (Decision Mathematics 1) |
| Year | 2005 |
| Session | January |
| Marks | 4 |
| Paper | Download PDF ↗ |
| Mark scheme | Download PDF ↗ |
| Topic | Sorting Algorithms |
| Type | Algorithm Tracing |
| Difficulty | Easy -2.0 This is a straightforward algorithm tracing exercise requiring only arithmetic substitution through given steps with no problem-solving, insight, or understanding of algorithms needed—purely mechanical execution of simple operations. |
| Spec | 7.03c Working with algorithms: trace, interpret, adapt |
| LINE 10 | INPUT \(A , B\) |
| LINE 20 | LET \(C = A - B\) |
| LINE 30 | LET \(D = A + B\) |
| LINE 40 | LET \(E = ( D * D ) - ( C * C )\) |
| LINE 50 | LET \(F = E / 4\) |
| LINE 60 | PRINT \(F\) |
| LINE 70 | END |
| Answer | Marks | Guidance |
|---|---|---|
| Answer | Marks | Guidance |
| Sorting network diagram with \(A=5\), \(B=3\) | M1 | SCA |
| Value \(2\) in position \(C\) | A1 | For 2 or 8 |
| Value \(60\) in position \(E\) | A1 | For 60 |
| Value \(15\) in position \(F\) | A1F | For 15 |
| Total: 4 |
## Question 1:
| Answer | Marks | Guidance |
|--------|-------|----------|
| Sorting network diagram with $A=5$, $B=3$ | M1 | SCA |
| Value $2$ in position $C$ | A1 | For 2 or 8 |
| Value $60$ in position $E$ | A1 | For 60 |
| Value $15$ in position $F$ | A1F | For 15 |
| **Total: 4** | | |
---
1 A student is using the algorithm below.
\begin{center}
\begin{tabular}{|l|l|}
\hline
LINE 10 & INPUT $A , B$ \\
\hline
LINE 20 & LET $C = A - B$ \\
\hline
LINE 30 & LET $D = A + B$ \\
\hline
LINE 40 & LET $E = ( D * D ) - ( C * C )$ \\
\hline
LINE 50 & LET $F = E / 4$ \\
\hline
LINE 60 & PRINT $F$ \\
\hline
LINE 70 & END \\
\hline
\end{tabular}
\end{center}
Trace the algorithm in the case where $A = 5$ and $B = 3$.
\hfill \mbox{\textit{AQA D1 2005 Q1 [4]}}