AQA D1 2012 June — Question 8 8 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2012
SessionJune
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 through a loop with 4 iterations. The miscopied line question (part b) requires only basic observation that it creates an infinite loop. No problem-solving or mathematical insight needed beyond careful bookkeeping.
Spec7.03c Working with algorithms: trace, interpret, adapt

8 The following algorithm finds an estimate of the value of the number represented by the symbol e:
Line 10Let \(A = 1 , B = 1 , C = 1\)
Line 20Let \(D = A\)
Line 30Let \(C = C \times B\)
Line 40Let \(D = D + ( 1 / C )\)
Line 50If \(B = 4\) then go to Line 80
Line 60Let \(B = B + 1\)
Line 70Go to Line 30
Line 80Print 'An estimate of e is', \(D\)
Line 90End
  1. Trace the algorithm.
  2. A student miscopied Line 70 . His line was
    Line 70 Go to Line 10
    Explain what would happen if his algorithm were traced.

Question 8:
(a)
AnswerMarks Guidance
AnswerMarks Guidance
Correct trace table showing iterations:M1 Method for tracing
\(B=1\): \(C=1\times1=1\), \(D=1+1/1=2\)A1
\(B=2\): \(C=1\times2=2\), \(D=2+1/2=2.5\)A1
\(B=3\): \(C=2\times3=6\), \(D=2.5+1/6=2.6\overline{6}\)A1
\(B=4\): condition met, print \(D \approx 2.708\overline{3}\)A1 A1 Final value and print statement
(b)
AnswerMarks Guidance
AnswerMarks Guidance
Algorithm returns to Line 10 resetting \(A=1, B=1, C=1\), causing an infinite loopB1 B1 B1 for restart/reset, B1 for infinite loop conclusion
## Question 8:

**(a)**
| Answer | Marks | Guidance |
|--------|-------|----------|
| Correct trace table showing iterations: | M1 | Method for tracing |
| $B=1$: $C=1\times1=1$, $D=1+1/1=2$ | A1 | |
| $B=2$: $C=1\times2=2$, $D=2+1/2=2.5$ | A1 | |
| $B=3$: $C=2\times3=6$, $D=2.5+1/6=2.6\overline{6}$ | A1 | |
| $B=4$: condition met, print $D \approx 2.708\overline{3}$ | A1 A1 | Final value and print statement |

**(b)**
| Answer | Marks | Guidance |
|--------|-------|----------|
| Algorithm returns to Line 10 resetting $A=1, B=1, C=1$, causing an infinite loop | B1 B1 | B1 for restart/reset, B1 for infinite loop conclusion |
8 The following algorithm finds an estimate of the value of the number represented by the symbol e:

\begin{center}
\begin{tabular}{ l l }
Line 10 & Let $A = 1 , B = 1 , C = 1$ \\
Line 20 & Let $D = A$ \\
Line 30 & Let $C = C \times B$ \\
Line 40 & Let $D = D + ( 1 / C )$ \\
Line 50 & If $B = 4$ then go to Line 80 \\
Line 60 & Let $B = B + 1$ \\
Line 70 & Go to Line 30 \\
Line 80 & Print 'An estimate of e is', $D$ \\
Line 90 & End \\
\end{tabular}
\end{center}
\begin{enumerate}[label=(\alph*)]
\item Trace the algorithm.
\item A student miscopied Line 70 .

His line was\\
Line 70 Go to Line 10\\
Explain what would happen if his algorithm were traced.
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2012 Q8 [8]}}