| Exam Board | Edexcel |
|---|---|
| Module | D1 (Decision Mathematics 1) |
| Year | 2019 |
| Session | June |
| Marks | 18 |
| Paper | Download PDF ↗ |
| Mark scheme | Download PDF ↗ |
| Topic | Sorting Algorithms |
| Type | Quick Sort Execution |
| Difficulty | Moderate -0.8 This is a standard D1 question testing routine application of algorithms (bin packing, quick sort, Chinese Postman). Part (c) requires mechanical execution of quick sort with no problem-solving—just following the algorithm step-by-step. The other parts are similarly algorithmic. This is easier than average A-level maths as it requires no mathematical insight, just procedural recall. |
| 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 | Guidance |
|---|---|---|
| Answer | Marks | Guidance |
| \(\frac{132}{42} = 3.14...\) so lower bound is 4 | M1 A1 | a1M1: Attempt to find the lower bound (\(132 ÷ 22\)) / 42 (a value of 3.14 (or better) seen with no working can imply this mark). a1A1: CSO - correct calculation seen or 3.14 followed by 4 – accept 3.1 if correct calculation seen. An answer of 4 with no working scores M0A0 |
| Group 1: 8 17 9 7; Group 2: 14 18 10; Group 3: 12 22; Group 4: 15 | M1 A1 | b1M1: First six items placed correctly and at least eight items placed in bins – condone cumulative totals for M1 only (the values in bold). b1A1: CSO (so no additional/repeated values) |
| e.g. middle right: 8 17 9 14 18 12 22 10 15 7; 17 14 18 22 15 12 8 9 10 7; 22 18 17 14 15 12 10 8 9 7; 22 18 17 15 14 12 10 9 8 7; 22 18 17 15 14 12 10 9 8 7; 22 18 17 15 14 12 10 9 8 7 | M1 A1 A1ft A1 | c1M1: Quick sort, pivot, p, chosen (must be choosing middle left or right – choosing first/last item as the pivot is M0). After the first pass the list must read (values greater than the pivot), pivot, (values less than the pivot). If only choosing one pivot per iteration then M1 only. c1A1: First pass correct and next pivots chosen correctly for the second pass (but the second pass does not need to be correct) – so they must be choosing (if middle right) a pivot values of 18 and 10 for the second pass or (if middle left) a pivot value of 14. a2A1ft: Second and third passes correct (follow through from their first pass and choice of pivots). They do not need to be choosing a pivot for the fourth pass for this mark. c3A1: CSO (correct solution only – all previous marks in this part must have been awarded) including if middle right a fourth pass with the 15 and 7 used as pivots or if middle left a fifth pass with the 8 used as a pivot |
| Group 1: 22 18; Group 2: 17 15 10; Group 3: 14 12 9 7; Group 4: 8 | M1 A1 | d1M1: First six items placed correctly and at least eight items placed in bins – condone cumulative totals for M1 only (the values in bold). d1A1: CSO (so no additional/repeated values) |
| B(E)C + G(I)H = (11.2 + 14.5) + (8.3 + 17.2) = 51.2*; B(F)G + C(E)JH = (10.3 + 15.2) + (14.5 + 7.5 + 16.2) = 63.7; B(E)JH + C(I)FG = (11.2 + 7.5 + 16.2) + (14.5 + 4.3 + 15.2) = 68.9; Repeat as: BE, CE, GI, HI | M1 A1 A1 A1 | e1M1: Correct three pairings of the correct four odd nodes (B, C, G and H). e1A1: Any one row correct including pairings and totals. e2A1: All three rows correct including pairings and totals. e3A1: CAO correct arcs clearly stated: BE, CE, GI and HI – must be these arcs and not e.g. BEC, GIH, or BC via E, etc. |
| Route e.g. ABEBFECECIJFGIHIJDCA; Length \(= 227.2 + 51.2 = 278.4\) (m) | B1 B1ft | f1B1: Any correct route (checks: 21 vertices, starting and ending at A, BE, CE, GI and HI appearing twice, A(2), B(2), C(2), D(1), E(3), F(2), G(2), H(2), I(3), J(2)). f2B1ft: For \(227.2 +\) their smallest repeat out of a choice of at least two totals seen in (e) – this mark is dependent on M1 in (e) |
| Finishing vertex: C; Reduction in lengths: \(51.2 – (10.3 + 15.2) = 25.7\) (m) | B1 B1 | g1B1: CAO (C). g2B1: CAO (25.7) – note that the correct answer can come from incorrect working e.g. \(11.2 + 14.5 = 25.7\) is B0 (just adding BE and EC together) so this answer need to be checked carefully – correct method is \(51.2 – (10.3 + 15.2)\) (subtracting BF and FG from 51.2) but give bod on a correct answer of 25.7 with no working |
| Total: 18 marks |
| Answer | Marks | Guidance |
|--------|-------|----------|
| $\frac{132}{42} = 3.14...$ so lower bound is 4 | M1 A1 | a1M1: Attempt to find the lower bound ($132 ÷ 22$) / 42 (a value of 3.14 (or better) seen with no working can imply this mark). a1A1: CSO - correct calculation seen or 3.14 followed by 4 – accept 3.1 if correct calculation seen. An answer of 4 with no working scores M0A0 |
| Group 1: **8** 17 9 7; Group 2: 14 **18** 10; Group 3: 12 **22**; Group 4: **15** | M1 A1 | b1M1: First six items placed correctly and at least eight items placed in bins – condone cumulative totals for M1 only (the values in bold). b1A1: CSO (so no additional/repeated values) |
| e.g. middle right: 8 17 9 14 18 12 22 10 15 7; 17 14 18 22 15 **12** 8 9 10 7; 22 **18** 17 14 15 **12** 10 8 9 7; 22 **18** 17 15 14 **12** 10 9 8 7; 22 **18** 17 15 14 **12** 10 9 8 7; 22 **18** 17 15 14 **12** 10 9 8 7 | M1 A1 A1ft A1 | c1M1: Quick sort, pivot, p, chosen (must be choosing middle left or right – choosing first/last item as the pivot is M0). After the first pass the list must read (values greater than the pivot), pivot, (values less than the pivot). **If only choosing one pivot per iteration then M1 only**. c1A1: First pass correct and next pivots chosen correctly for the second pass (but the second pass does not need to be correct) – so they must be choosing (if middle right) a pivot values of 18 and 10 for the second pass or (if middle left) a pivot value of 14. a2A1ft: Second and third passes correct (follow through from their first pass and choice of pivots). They do not need to be choosing a pivot for the fourth pass for this mark. c3A1: CSO (correct solution only – all previous marks in this part must have been awarded) including if middle right a fourth pass with the 15 and 7 used as pivots or if middle left a fifth pass with the 8 used as a pivot |
| Group 1: **22 18**; Group 2: **17 15** 10; Group 3: 14 12 9 7; Group 4: 8 | M1 A1 | d1M1: First six items placed correctly and at least eight items placed in bins – condone cumulative totals for M1 only (the values in bold). d1A1: CSO (so no additional/repeated values) |
| B(E)C + G(I)H = (11.2 + 14.5) + (8.3 + 17.2) = 51.2*; B(F)G + C(E)JH = (10.3 + 15.2) + (14.5 + 7.5 + 16.2) = 63.7; B(E)JH + C(I)FG = (11.2 + 7.5 + 16.2) + (14.5 + 4.3 + 15.2) = 68.9; Repeat as: BE, CE, GI, HI | M1 A1 A1 A1 | e1M1: Correct three pairings of the correct four odd nodes (B, C, G and H). e1A1: Any one row correct including pairings and totals. e2A1: All three rows correct including pairings and totals. e3A1: CAO correct arcs clearly stated: BE, CE, GI and HI – must be these arcs and not e.g. BEC, GIH, or BC via E, etc. |
| Route e.g. ABEBFECECIJFGIHIJDCA; Length $= 227.2 + 51.2 = 278.4$ (m) | B1 B1ft | f1B1: Any correct route (checks: 21 vertices, starting and ending at A, BE, CE, GI and HI appearing twice, A(2), B(2), C(2), D(1), E(3), F(2), G(2), H(2), I(3), J(2)). f2B1ft: For $227.2 +$ their smallest repeat out of a choice of at least two totals seen in (e) – this mark is dependent on M1 in (e) |
| Finishing vertex: C; Reduction in lengths: $51.2 – (10.3 + 15.2) = 25.7$ (m) | B1 B1 | g1B1: CAO (C). g2B1: CAO (25.7) – note that the correct answer can come from incorrect working e.g. $11.2 + 14.5 = 25.7$ is B0 (just adding BE and EC together) so this answer need to be checked carefully – correct method is $51.2 – (10.3 + 15.2)$ (subtracting BF and FG from 51.2) but give bod on a correct answer of 25.7 with no working |
| **Total: 18 marks** | | |
---
3. Pupils from ten schools are visiting a museum on the same day. The museum needs to allocate each school to a tour group. The maximum size of each tour group is 42 pupils. A group may include pupils from more than one school. Pupils from each school must be kept in the same tour group. The numbers of pupils visiting from each school are given below.
$$\begin{array} { l l l l l l l l l l }
8 & 17 & 9 & 14 & 18 & 12 & 22 & 10 & 15 & 7
\end{array}$$
\begin{enumerate}[label=(\alph*)]
\item Calculate a lower bound for the number of tour groups required. You must make your method clear.
\item Using the above list, apply the first-fit bin packing algorithm to allocate the pupils visiting from each school to tour groups.
The above list of numbers is to be sorted into descending order.
\item Perform a quick sort to obtain the sorted list. You should show the result of each pass and identify your pivots clearly.
\item Using your sorted list from (c), apply the first-fit decreasing bin packing algorithm to obtain a second allocation of pupils to tour groups.
\begin{figure}[h]
\begin{center}
\includegraphics[alt={},max width=\textwidth]{aef6a6dd-76ec-47f7-b8c9-449006da29d3-04_712_1141_1363_463}
\captionsetup{labelformat=empty}
\caption{Figure 2}
\end{center}
\end{figure}
[The total weight of the network is 227.2]\\
Figure 2 represents the corridors in the museum. The number on each arc is the length, in metres, of the corresponding corridor. Sally is a tour guide in the museum and she must travel along each corridor at least once during each tour. Sally wishes to minimise the length of her route. She must start and finish at the museum's entrance at A .
\item Use an appropriate algorithm to find the corridors that Sally will need to traverse twice. You should make your method and working clear.
\item Write down a possible shortest route, giving its length.
Sally is now allowed to start at H and finish her route at a different vertex. A route of minimum length that includes each corridor at least once needs to be found.
\item State the finishing vertex of Sally's new route and calculate the difference in length between this new route and the route found in (f).
\end{enumerate}
\hfill \mbox{\textit{Edexcel D1 2019 Q3 [18]}}