AQA D1 2008 January — Question 6 10 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2008
SessionJanuary
Marks10
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeAlgorithm Tracing
DifficultyEasy -1.8 This is a straightforward algorithm tracing exercise requiring only systematic substitution of values into a simple loop structure. The algorithm is clearly written with no complex logic, and part (b) requires only basic observation that division/leading term issues arise when A=0. This is significantly easier than average A-level maths, being purely mechanical execution with no mathematical insight or problem-solving required.
Spec7.03c Working with algorithms: trace, interpret, adapt

6 A student is solving cubic equations that have three different positive integer solutions.
The algorithm that the student is using is as follows:
Line 10 Input \(A , B , C , D\) Line \(20 \quad\) Let \(K = 1\) Line \(30 \quad\) Let \(N = 0\) Line \(40 \quad\) Let \(X = K\) Line 50 Let \(Y = A X ^ { 3 } + B X ^ { 2 } + C X + D\) Line 60 If \(Y \neq 0\) then go to Line 100
Line \(70 \quad\) Print \(X\), "is a solution"
Line \(80 \quad\) Let \(N = N + 1\) Line 90 If \(N = 3\) then go to Line 120
Line \(100 \quad\) Let \(K = K + 1\) Line 110 Go to Line 40
Line 120 End
  1. Trace the algorithm in the case where the input values are:
    1. \(A = 1 , B = - 6 , C = 11\) and \(D = - 6\);
    2. \(A = 1 , B = - 10 , C = 29\) and \(D = - 20\).
  2. Explain where and why this algorithm will fail if \(A = 0\).

Question 6(a)(i):
AnswerMarks Guidance
Answer/WorkingMarks Guidance
SCA with \(A=1, B=-6, C=11, D=-6\)M1 Must use at least 3 variables
\(K=1, N=0, X=1, Y=0\) (1st pass)A1 1st pass
\(K=2, N=1, X=2, Y=0\) (2nd pass)A1 2nd pass
\(K=3, N=2, X=3, Y=0\) (3rd pass, final answer \(N=3\))A1 All correct — 4 marks total
Question 6(a)(ii):
AnswerMarks Guidance
Answer/WorkingMarks Guidance
\(A=1, B=-10, C=29, D=-20\), SCAM1 1st pass, must use at least 3 variables
\(K=2, X=2, Y=6\) (2nd pass)A1 2nd pass
\(K=3, X=3, Y=4\) (3rd pass)A1 3rd pass
\(K=5, X=5, Y=0\), final \(N=3\)A1 All correct — 4 marks total
Question 6(b):
AnswerMarks Guidance
Answer/WorkingMarks Guidance
Line 90B1
Never ending or \(N \neq 3\)B1 2 marks total
# Question 6(a)(i):

| Answer/Working | Marks | Guidance |
|---|---|---|
| SCA with $A=1, B=-6, C=11, D=-6$ | M1 | Must use at least 3 variables |
| $K=1, N=0, X=1, Y=0$ (1st pass) | A1 | 1st pass |
| $K=2, N=1, X=2, Y=0$ (2nd pass) | A1 | 2nd pass |
| $K=3, N=2, X=3, Y=0$ (3rd pass, final answer $N=3$) | A1 | All correct — 4 marks total |

# Question 6(a)(ii):

| Answer/Working | Marks | Guidance |
|---|---|---|
| $A=1, B=-10, C=29, D=-20$, SCA | M1 | 1st pass, must use at least 3 variables |
| $K=2, X=2, Y=6$ (2nd pass) | A1 | 2nd pass |
| $K=3, X=3, Y=4$ (3rd pass) | A1 | 3rd pass |
| $K=5, X=5, Y=0$, final $N=3$ | A1 | All correct — 4 marks total |

# Question 6(b):

| Answer/Working | Marks | Guidance |
|---|---|---|
| Line 90 | B1 | |
| Never ending or $N \neq 3$ | B1 | 2 marks total |

---
6 A student is solving cubic equations that have three different positive integer solutions.\\
The algorithm that the student is using is as follows:\\
Line 10 Input $A , B , C , D$\\
Line $20 \quad$ Let $K = 1$\\
Line $30 \quad$ Let $N = 0$\\
Line $40 \quad$ Let $X = K$\\
Line 50 Let $Y = A X ^ { 3 } + B X ^ { 2 } + C X + D$\\
Line 60 If $Y \neq 0$ then go to Line 100\\
Line $70 \quad$ Print $X$, "is a solution"\\
Line $80 \quad$ Let $N = N + 1$\\
Line 90 If $N = 3$ then go to Line 120\\
Line $100 \quad$ Let $K = K + 1$\\
Line 110 Go to Line 40\\
Line 120 End
\begin{enumerate}[label=(\alph*)]
\item Trace the algorithm in the case where the input values are:
\begin{enumerate}[label=(\roman*)]
\item $A = 1 , B = - 6 , C = 11$ and $D = - 6$;
\item $A = 1 , B = - 10 , C = 29$ and $D = - 20$.
\end{enumerate}\item Explain where and why this algorithm will fail if $A = 0$.
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2008 Q6 [10]}}