| Exam Board | Edexcel |
|---|---|
| Module | D1 (Decision Mathematics 1) |
| Year | 2023 |
| Session | June |
| Marks | 6 |
| Paper | Download PDF ↗ |
| Mark scheme | Download PDF ↗ |
| Topic | Sorting Algorithms |
| Type | Algorithm Tracing |
| Difficulty | Easy -1.8 This is a straightforward algorithm tracing exercise requiring only arithmetic operations (division, multiplication, subtraction) and the INT function. Part (a) is pure mechanical execution with no problem-solving, and part (b) asks students to recognize the obvious pattern that the algorithm extracts digits. This is significantly easier than typical A-level questions as it requires no mathematical insight, just careful following of instructions. |
| Spec | 7.03c Working with algorithms: trace, interpret, adapt |
3. In this question, the function $\operatorname { INT } ( X )$ is the largest integer less than or equal to $X$.
For example,
$$\begin{aligned}
\mathrm { INT } ( 5.7 ) & = 5 \\
\mathrm { INT } ( 8 ) & = 8 \\
\mathrm { INT } ( - 2.3 ) & = - 3
\end{aligned}$$
Consider the following algorithm.\\
Step 1 Input $N$\\
Step 2 Calculate $A = N \div 10$\\
Step 3 Let $B = \operatorname { INT } ( A )$\\
Step 4 Calculate $C = B \times 10$\\
Step 5 Calculate $D = N - C$\\
Step 6 Output $D$\\
Step $7 \quad$ Replace $N$ by $B$\\
Step 8 If $N = 0$ then STOP, otherwise go back to Step 2
\begin{enumerate}[label=(\alph*)]
\item Complete the table in the answer book, using $N = 4217$, to show the results obtained at each step of the algorithm.
\item Explain how the output values of the algorithm relate to the original input $N$, where $N$ is any positive integer.
\end{enumerate}
\hfill \mbox{\textit{Edexcel D1 2023 Q3 [6]}}