Edexcel D1 2019 January — Question 4 14 marks

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2019
SessionJanuary
Marks14
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeQuick Sort Execution
DifficultyModerate -0.8 This is a routine D1 question testing standard algorithmic procedures (quick sort, bin packing algorithms) with straightforward execution. Parts (a)-(d) require only mechanical application of learned algorithms with no problem-solving insight, while part (e) requires minimal optimization thinking given the constraint. The quick sort execution is procedural with clear pivot selection rules, making this easier than average A-level maths questions.
Spec7.03j Sorting: bubble sort and shuttle sort7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin

4. $$\begin{array} { l l l l l l l l l l l } 180 & 80 & 250 & 115 & 100 & 230 & 150 & 95 & 105 & 90 & 390 \end{array}$$ The numbers in the list above represent the weights, in kilograms, of 11 boxes. John must transport all the boxes using his van. You may assume the van has sufficient space for any combination of boxes. Each van load of boxes must weigh at most 475 kg .
  1. Calculate a lower bound for the number of van loads needed to transport all 11 boxes.
  2. Use the first-fit bin packing algorithm to show how the boxes could be put into van loads. State the number of van loads needed according to this solution.
  3. Carry out a quick sort on the numbers in the list given above to produce a list of the weights in descending order. You should show the result of each pass and identify your pivots clearly.
  4. Use the first-fit decreasing bin packing algorithm on your ordered list to show how the boxes could be put into van loads. State the number of van loads needed according to this solution. Due to volume restrictions, the van cannot transport more than three boxes at any one time.
  5. Show how the boxes could now be put into the minimum number of van loads.

AnswerMarks Guidance
Answer/WorkingMarks Guidance
\(\frac{1785}{475} = 3.75...\) so lower bound is 4M1 A1 (2)
Van 1: 180 80 115 100 Van 2: 250 150 Van 3: 230 95 105 Van 4: 90 Van 5: 390 The van is therefore required 5 timesM1 A1 A1 (3)
e.g. using middle right 180 80 250 115 100 230 150 95 105 90 390Pivot 230 M1
250 390 230 180 80 115 100 150 95 105 90Pivots 390, 150 A1
390 250 230 180 150 80 115 100 95 105 90Pivots (250, 180) 95 A1ft
390 250 230 180 150 115 100 105 95 80 90Pivots 100, 90 A1
390 250 230 180 150 115 105 100 95 90 80Pivot(s) 105 (80) A1
390 250 230 180 150 115 105 100 95 90 80(Sort complete)
Van 1: 390 80 Van 2: 250 180 Van 3: 230 150 95 Van 4: 115 105 100 90 The van is therefore required 4 timesM1 A1 A1 (3)
e.g. (note that these lists are not exhaustive – see guidance in notes) Van 1: 390 80 Van 1: 390 80 Van 1: 390 80 Van 2: 250 115 105 Van 2: 250 115 105 Van 2: 250 100 95 Van 3: 230 150 95 Van 3: 230 150 90 Van 3: 230 150 90 Van 4: 180 100 90 Van 4: 180 100 95 Van 4: 180 115 105M1 A1 (2)
14 marks
Notes for Question 4:
PLEASE NOTE NO MISREADS IN THIS QUESTION – MARK ACCORDING TO THE SCHEME AND THE SPECIAL CASES IN PARTS (c) AND (d)
- a1M1: Attempt to find the lower bound (\(\frac{1785 \pm 390}{475}\) (a value of 3.75 or 3.76 seen with no working can imply this mark)
- a1A1: CSO - correct calculation seen or 3.75 or 3.76 followed by 4 – accept 3.8 if correct calculation seen. An answer of 4 with no working scores M0A0.
- b1M1: First four items placed correctly and at least eight values placed in bins - condone cumulative totals for M1 only (the boxed values)
- b1A1: First eight items placed correctly (the boxed and underlined values)
- b2A1: CSO (so no additional/repeated values) + explicitly stating 5 or 5 vans or 5 loads but not 5 bins
- c1M1: Quick sort, pivot, p chosen (must be checking 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 – Bubble sort is not a MR and scores M1 only for 180 250 115 100 230 150 95 105 90 390 80 (for left to right) or 390 180 80 250 115 100 230 150 95 105 90 (for right to left)
- c1A1: First two passes correct. They do not need to be choosing a pivot for the third pass.
- c2A1ft: Third and fourth passes correct (follow through from their second pass and choice of pivots). They do not need to be choosing a pivot for the fifth pass for this mark.
- c3A1: CSO (correct solution only – all pivots marks in this part must have been awarded) including if middle right a fifth pass in which the 105 is used as a pivot or if middle left a 'sort complete' - this could be shown by the final list being re-written or 'sorted' statement or each item being used as a pivot (which would therefore mean that the final list would have been written twice).
SC for (c): If using an incorrect list from the start of (c) with only one error (an error is either one missing number, one extra number, two numbers transposed or one incorrect number) then the most they can score is M1A0A1ftA0.
Middle left for (c)
AnswerMarks
180 80 250 115 100 230 150 95 105 90 390Pivot 230
250 390 230 180 80 115 100 150 95 105 90Pivots 250, 100
390 250 230 180 115 150 105 100 95 80 90Pivots (390), 115, 95
390 250 230 180 150 115 105 100 95 80 90Pivots 180, (105), 80
390 250 230 180 150 115 105 100 95 90 80Sort complete
- d1M1: Must be using the correct sorted list in descending order. First four items placed correctly and at least eight values placed in bins – condone cumulative totals for M1 only (the boxed values)
- d1A1: First eight items placed correctly (the boxed and underlined values)
- d2A1: CSO (so no additional/repeated values) + explicitly stating 4 or 4 vans or 4 loads but not 4 bins. However, only penalise the lack of (or incorrectly) stating the number of van loads once on the first occurrance (so if a candidate fails to state the number of van loads in both parts they could score at most two marks in (b) but all three marks in (d)).
- e1M1: A solution containing all correct eleven values (so no ft from misreads or incorrect values in this part) in which each van has no more than 3 values and does not contain more than 475 in total – allow at most five vans used.
- e1A1: CAO (4 vans only, no van containing more than 3 values and no van containing more than 475)
Note for (e): possibilities are
- A bin with 390 and 80
- A bin with 250 and any two of the remaining values below 150
- A bin with 230 and either 150 and 90 or 150 and 95 or any two remaining values < 150
- A bin with 180 and the remaining values
| Answer/Working | Marks | Guidance |
|---|---|---|
| $\frac{1785}{475} = 3.75...$ so lower bound is 4 | M1 A1 | (2) |
| Van 1: 180 80 115 100 Van 2: 250 150 Van 3: 230 95 105 Van 4: 90 Van 5: 390 **The van is therefore required 5 times** | M1 A1 A1 | (3) |
| e.g. using middle right 180 80 250 115 100 230 150 95 105 90 390 | Pivot 230 | M1 | |
| 250 390 230 180 80 115 100 150 95 105 90 | Pivots 390, 150 | A1 | |
| 390 250 230 180 150 80 115 100 95 105 90 | Pivots (250, 180) 95 | A1ft | |
| 390 250 230 180 150 115 100 105 95 80 90 | Pivots 100, 90 | A1 | |
| 390 250 230 180 150 115 105 100 95 90 80 | Pivot(s) 105 (80) | A1 | |
| 390 250 230 180 150 115 105 100 95 90 80 | (Sort complete) | | |
| Van 1: 390 80 Van 2: 250 180 Van 3: 230 150 95 Van 4: 115 105 100 90 **The van is therefore required 4 times** | M1 A1 A1 | (3) |
| e.g. (note that these lists are not exhaustive – see guidance in notes) Van 1: 390 80 Van 1: 390 80 Van 1: 390 80 Van 2: 250 115 105 Van 2: 250 115 105 Van 2: 250 100 95 Van 3: 230 150 95 Van 3: 230 150 90 Van 3: 230 150 90 Van 4: 180 100 90 Van 4: 180 100 95 Van 4: 180 115 105 | M1 A1 | (2) |
| | **14 marks** | |

**Notes for Question 4:**

**PLEASE NOTE NO MISREADS IN THIS QUESTION – MARK ACCORDING TO THE SCHEME AND THE SPECIAL CASES IN PARTS (c) AND (d)**

- **a1M1**: Attempt to find the lower bound ($\frac{1785 \pm 390}{475}$ (a value of 3.75 or 3.76 seen with no working can imply this mark)
- **a1A1**: CSO - correct calculation seen or 3.75 or 3.76 followed by 4 – accept 3.8 if correct calculation seen. An answer of 4 with no working scores M0A0.
- **b1M1**: First four items placed correctly and at least eight values placed in bins - condone cumulative totals for M1 only (the boxed values)
- **b1A1**: First eight items placed correctly (the boxed and underlined values)
- **b2A1**: CSO (so no additional/repeated values) + explicitly stating 5 or 5 vans or 5 loads but **not 5 bins**
- **c1M1**: Quick sort, pivot, p chosen (must be checking 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** – Bubble sort is not a MR and scores M1 only for 180 250 115 100 230 150 95 105 90 390 80 (for left to right) or 390 180 80 250 115 100 230 150 95 105 90 (for right to left)
- **c1A1**: First two passes correct. They do not need to be choosing a pivot for the third pass.
- **c2A1ft**: Third and fourth passes correct (follow through from their second pass and choice of pivots). They do not need to be choosing a pivot for the fifth pass for this mark.
- **c3A1**: CSO (correct solution only – all pivots marks in this part must have been awarded) including if middle right a fifth pass in which the 105 is used as a pivot or if middle left a 'sort complete' - this could be shown by the final list being re-written or 'sorted' statement or each item being used as a pivot (which would therefore mean that the final list would have been written twice).

**SC for (c)**: If using an incorrect list from the start of (c) with only one error (an error is either one missing number, one extra number, two numbers transposed or one incorrect number) then the most they can score is M1A0A1ftA0.

**Middle left for (c)**
180 80 250 115 100 230 150 95 105 90 390 | Pivot 230
250 390 230 180 80 115 100 150 95 105 90 | Pivots 250, 100
390 250 230 180 115 150 105 100 95 80 90 | Pivots (390), 115, 95
390 250 230 180 150 115 105 100 95 80 90 | Pivots 180, (105), 80
390 250 230 180 150 115 105 100 95 90 80 | Sort complete

- **d1M1**: Must be using the correct sorted list in descending order. First four items placed correctly and at least eight values placed in bins – condone cumulative totals for M1 only (the boxed values)
- **d1A1**: First eight items placed correctly (the boxed and underlined values)
- **d2A1**: CSO (so no additional/repeated values) + explicitly stating 4 or 4 vans or 4 loads but **not 4 bins**. However, only penalise the lack of (or incorrectly) stating the number of van loads once on the first occurrance (so if a candidate fails to state the number of van loads in both parts they could score at most two marks in (b) but all three marks in (d)).
- **e1M1**: A solution containing all **correct eleven values** (so no ft from misreads or incorrect values in this part) in which each van has no more than 3 values and does not contain more than 475 in total – allow at most five vans used.
- **e1A1**: CAO (4 vans only, no van containing more than 3 values and no van containing more than 475)

**Note for (e)**: possibilities are
- A bin with 390 and 80
- A bin with 250 and any two of the remaining values below 150
- A bin with 230 and either 150 and 90 or 150 and 95 or any two remaining values < 150
- A bin with 180 and the remaining values

---
4.

$$\begin{array} { l l l l l l l l l l l } 
180 & 80 & 250 & 115 & 100 & 230 & 150 & 95 & 105 & 90 & 390
\end{array}$$

The numbers in the list above represent the weights, in kilograms, of 11 boxes. John must transport all the boxes using his van. You may assume the van has sufficient space for any combination of boxes. Each van load of boxes must weigh at most 475 kg .
\begin{enumerate}[label=(\alph*)]
\item Calculate a lower bound for the number of van loads needed to transport all 11 boxes.
\item Use the first-fit bin packing algorithm to show how the boxes could be put into van loads. State the number of van loads needed according to this solution.
\item Carry out a quick sort on the numbers in the list given above to produce a list of the weights in descending order. You should show the result of each pass and identify your pivots clearly.
\item Use the first-fit decreasing bin packing algorithm on your ordered list to show how the boxes could be put into van loads. State the number of van loads needed according to this solution.

Due to volume restrictions, the van cannot transport more than three boxes at any one time.
\item Show how the boxes could now be put into the minimum number of van loads.
\end{enumerate}

\hfill \mbox{\textit{Edexcel D1 2019 Q4 [14]}}