| Exam Board | OCR |
|---|---|
| Module | D1 (Decision Mathematics 1) |
| Year | 2016 |
| Session | June |
| Marks | 9 |
| Paper | Download PDF ↗ |
| Mark scheme | Download PDF ↗ |
| Topic | Sorting Algorithms |
| Type | Comparing Sorting Algorithms |
| Difficulty | Moderate -0.8 This question tests recall and mechanical application of standard sorting algorithms (bubble sort, shuttle sort) and bin-packing methods. All parts require following learned procedures with no problem-solving or novel insight—students simply need to recognize algorithm patterns and execute steps. The conceptual demand is low for A-level, making it easier than average. |
| Spec | 7.03j Sorting: bubble sort and shuttle sort7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin |
| Answer | Marks |
|---|---|
| After bubble sort, largest value (53) would be at the right-hand end, but 53 is not at the right-hand end (26 is) | B1 |
| Answer | Marks | Guidance |
|---|---|---|
| Original list: 32 41 22 37 53 43 15 29 26 or 32 41 22 37 53 43 29 15 26 | B1 | Either possibility |
| Answer | Marks | Guidance |
|---|---|---|
| After second pass: 32 22 37 41 53 43 15 29 26 → 22 32 37 41 53 43 15 29 26 (dependent on original) | B1 | Follow through from (ii) |
| Answer | Marks |
|---|---|
| 8 passes | B1 |
| Answer | Marks | Guidance |
|---|---|---|
| Decreasing order: 53, 43, 41, 37, 32, 29, 26, 22, 15 | M1 | Correct decreasing order stated |
| Bin 1: 53, 43 (total 96); Bin 2: 41, 37, 22 (total 100); Bin 3: 32, 29, 26, 15 (wait — check sums) | M1 | Applying FFD correctly |
| Bin 1: 53, 43 (96); Bin 2: 41, 37, 22 (100); Bin 3: 32, 29, 26, 15 (102 — overflow) | ||
| Bin 1: 53, 43 (96); Bin 2: 41, 37, 22 (100); Bin 3: 32, 29, 26 (87); Bin 4: 15 | A1 | 4 bins needed |
| Answer | Marks | Guidance |
|---|---|---|
| Bin 1: 53, 22, 15 (90); Bin 2: 43, 29, 26 (98); Bin 3: 41, 37, 22... | M1 | Valid attempt using 3 bins |
| e.g. Bin 1: 53, 32, 15 (100); Bin 2: 43, 29, 26 (98) [check: 22+41+37=100 ✓] Bin 3: 41, 37, 22 (100) | A1 | All three bins ≤100, all items included |
# Question 2:
**(i)**
| After bubble sort, largest value (53) would be at the right-hand end, but 53 is not at the right-hand end (26 is) | B1 | |
**(ii)**
| Original list: **32 41 22 37 53 43 15 29 26** or **32 41 22 37 53 43 29 15 26** | B1 | Either possibility |
**(iii)**
| After second pass: **32 22 37 41 53 43 15 29 26** → **22 32 37 41 53 43 15 29 26** (dependent on original) | B1 | Follow through from (ii) |
**(iv)**
| **8 passes** | B1 | |
**(v)**
| Decreasing order: 53, 43, 41, 37, 32, 29, 26, 22, 15 | M1 | Correct decreasing order stated |
| Bin 1: 53, 43 (total 96); Bin 2: 41, 37, 22 (total 100); Bin 3: 32, 29, 26, 15 (wait — check sums) | M1 | Applying FFD correctly |
| Bin 1: 53, 43 (96); Bin 2: 41, 37, 22 (100); Bin 3: 32, 29, 26, 15 (102 — overflow) | | |
| Bin 1: 53, 43 (96); Bin 2: 41, 37, 22 (100); Bin 3: 32, 29, 26 (87); Bin 4: 15 | A1 | 4 bins needed |
**(vi)**
| Bin 1: 53, 22, 15 (90); Bin 2: 43, 29, 26 (98); Bin 3: 41, 37, 22... | M1 | Valid attempt using 3 bins |
| e.g. Bin 1: 53, 32, 15 (100); Bin 2: 43, 29, 26 (98) [check: 22+41+37=100 ✓] Bin 3: 41, 37, 22 (100) | A1 | All three bins ≤100, all items included |
---
2 Shaun measured the mass, in kg, of each of 9 filled bags. He then used an algorithm to sort the masses into increasing order.
Shaun's list after the first pass through the sorting algorithm is given below.
$$\begin{array} { l l l l l l l l l }
32 & 41 & 22 & 37 & 53 & 43 & 29 & 15 & 26
\end{array}$$
\begin{enumerate}[label=(\roman*)]
\item Explain how you know that Shaun did not use bubble sort.
In fact, Shaun used shuttle sort, starting at the left-hand end of the list.
\item Write down the two possibilities for the original list.
\item Write down the list after the second pass through the shuttle sort algorithm.
\item How many passes through shuttle sort were needed to sort the entire list?
Shaun's sorted list is given below.
$$\begin{array} { l l l l l l l l l }
15 & 22 & 26 & 29 & 32 & 37 & 41 & 43 & 53
\end{array}$$
Shaun wants to pack the bags into bins, each of which can hold a maximum of 100 kg .
\item Write the list in decreasing order of mass and then apply the first-fit decreasing method to decide how to pack the bags into bins. Write the weights of the bags in each bin in the order that they are put into the bin.
\item Find a way to pack all the bags using only 3 bins, each of which can hold a maximum of 100 kg .
\end{enumerate}
\hfill \mbox{\textit{OCR D1 2016 Q2 [9]}}