AQA D1 2011 June — Question 6 7 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2011
SessionJune
Marks7
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeAlgorithm Tracing
DifficultyEasy -1.2 This is a straightforward algorithm tracing exercise requiring systematic step-by-step execution of a simple bisection algorithm. Part (a) involves routine arithmetic and following conditional statements with no conceptual difficulty. Part (b) requires identifying obvious limitations (e.g., no handling of negative numbers, infinite loop potential) which are standard criticisms taught in D1. Significantly easier than average A-level maths questions.
Spec7.03c Working with algorithms: trace, interpret, adapt

6 A student is tracing the following algorithm.
Line 10 Let \(A = 6\) Line \(20 \quad\) Let \(B = 7\) Line 30 Input \(C\) Line 40 Let \(D = ( A + B ) / 2\) Line \(50 \quad\) Let \(E = C - D ^ { 3 }\) Line 60 If \(E ^ { 2 } < 1\) then go to Line 120
Line 70 If \(E > 0\) then go to Line 100
Line 80 Let \(B = D\) Line 90 Go to Line 40
Line \(100 \quad\) Let \(A = D\) Line 110 Go to Line 40
Line 120 Stop
  1. Trace the algorithm in the case where the input value is \(C = 300\).
  2. The algorithm is intended to find the approximate cube root of any input number. State two reasons why the algorithm is unsatisfactory in its present form.
    (3 marks)

Question 6:
Part (a):
AnswerMarks Guidance
AnswerMark Guidance
\(A=6, B=7, C=300\) Initial values
\(D=(6+7)/2=6.5\)B1 First iteration values correct
\(E=300-6.5^3=300-274.625=25.375\)
\(E^2=643.9...\) not \(<1\); \(E>0\) so go to Line 100
\(A=6.5\), go to Line 40B1 Correct branching and update
\(D=(6.5+7)/2=6.75\)
\(E=300-6.75^3=300-307.546...=-7.546...\)B1 Second iteration values correct
\(E^2=56.9...\) not \(<1\); \(E\) not \(>0\) so go to Line 80
\(B=6.75\), go to Line 40B1 Correct branching and update, award 4th mark for correct continuation showing loop
Part (b):
AnswerMarks Guidance
AnswerMark Guidance
The algorithm does not work for negative numbers / negative inputsB1 e.g. if \(C<0\), \(E\) will always be negative and \(B\) keeps updating causing infinite loop
The algorithm does not have a guaranteed stopping condition / could loop indefinitelyB1 Accept: no output statement / never prints the answer
There is no output statement (the answer is never displayed/printed)B1 Any two valid reasons from these three for 3 marks total — only 2 reasons needed for full marks
# Question 6:

## Part (a):

| Answer | Mark | Guidance |
|--------|------|----------|
| $A=6, B=7, C=300$ | | Initial values |
| $D=(6+7)/2=6.5$ | B1 | First iteration values correct |
| $E=300-6.5^3=300-274.625=25.375$ | | |
| $E^2=643.9...$ not $<1$; $E>0$ so go to Line 100 | | |
| $A=6.5$, go to Line 40 | B1 | Correct branching and update |
| $D=(6.5+7)/2=6.75$ | | |
| $E=300-6.75^3=300-307.546...=-7.546...$ | B1 | Second iteration values correct |
| $E^2=56.9...$ not $<1$; $E$ not $>0$ so go to Line 80 | | |
| $B=6.75$, go to Line 40 | B1 | Correct branching and update, award 4th mark for correct continuation showing loop |

## Part (b):

| Answer | Mark | Guidance |
|--------|------|----------|
| The algorithm does not work for negative numbers / negative inputs | B1 | e.g. if $C<0$, $E$ will always be negative and $B$ keeps updating causing infinite loop |
| The algorithm does not have a guaranteed stopping condition / could loop indefinitely | B1 | Accept: no output statement / never prints the answer |
| There is no output statement (the answer is never displayed/printed) | B1 | Any two valid reasons from these three for 3 marks total — only 2 reasons needed for full marks |

---
6 A student is tracing the following algorithm.\\
Line 10 Let $A = 6$\\
Line $20 \quad$ Let $B = 7$\\
Line 30 Input $C$\\
Line 40 Let $D = ( A + B ) / 2$\\
Line $50 \quad$ Let $E = C - D ^ { 3 }$\\
Line 60 If $E ^ { 2 } < 1$ then go to Line 120\\
Line 70 If $E > 0$ then go to Line 100\\
Line 80 Let $B = D$\\
Line 90 Go to Line 40\\
Line $100 \quad$ Let $A = D$\\
Line 110 Go to Line 40\\
Line 120 Stop
\begin{enumerate}[label=(\alph*)]
\item Trace the algorithm in the case where the input value is $C = 300$.
\item The algorithm is intended to find the approximate cube root of any input number.

State two reasons why the algorithm is unsatisfactory in its present form.\\
(3 marks)
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2011 Q6 [7]}}