Edexcel D1 2010 January — Question 4 11 marks

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2010
SessionJanuary
Marks11
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeQuick Sort Execution
DifficultyEasy -1.2 This is a straightforward procedural question requiring mechanical application of the quick sort algorithm and first-fit decreasing bin-packing. Part (a) is pure algorithm execution with no problem-solving, part (b) is simple arithmetic packing, and part (c) requires only basic verification—all standard D1 textbook exercises with no novel insight required.
Spec7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin

4. A builder is asked to replace the guttering on a house. The lengths needed, in metres, are $$0.6,4.0,2.5,3.2,0.5,2.6,0.4,0.3,4.0 \text { and } 1.0$$ Guttering is sold in 4 m lengths.
  1. Carry out a quick sort to produce a list of the lengths needed in descending order. You should show the result of each pass and identify your pivots clearly.
  2. Apply the first-fit decreasing bin-packing algorithm to your ordered list to determine the total number of 4 m lengths needed.
  3. Does the answer to part (b) use the minimum number of 4 m lengths? You must justify your answer.

Question 4(a):
AnswerMarks Guidance
AnswerMark Guidance
Row 1: 0.6, 4.0, 2.5, 3.2, 0.5, 2.6, 0.4, 0.3, 4.0, 1.0 → 2.6M1 Pivot chosen; list sorted \(>p\), \(p\), \(p\). If only choosing 1 pivot per iteration M1 only
Row 2: 4.0, 3.2, 4.0, \(\underline{2.6}\), 0.6, 2.5, 0.5, 0.4, 0.3, 1.0 → 3.2 0.4A1 \(1^{st}\) pass correct and chosen next two pivots correctly for sublists \(>1\)
Row 3: 4.0, 4.0, \(\underline{3.2}\), \(\underline{2.6}\), 0.6, 2.5, 0.5, 1.0, \(\underline{0.4}\), 0.34.0 0.5A1ft \(2^{nd}\) pass correct and chosen next two pivots correctly for sublists \(>1\)
Row 4: 4.0, \(\underline{4.0}\), \(\underline{3.2}\), \(\underline{2.6}\), 0.6, 2.5, 1.0, \(\underline{0.5}\), \(\underline{0.4}\), \(\underline{0.3}\) → 2.5A1ft \(3^{rd}\) pass correct and next pivot for sublist \(>1\) chosen correctly
Row 5: \(\underline{4.0}\), \(\underline{4.0}\), \(\underline{3.2}\), \(\underline{2.6}\), 2.5, 1.0, \(\underline{0.6}\), \(\underline{0.5}\), \(\underline{0.4}\), \(\underline{0.3}\)A1 cso
(5 marks)
Question 4(b):
AnswerMarks Guidance
AnswerMark Guidance
Length 1: 4M1 left column & 1.0 in place
Length 2: 4A1
Length 3: 3.2, 0.6A1 \(0.6\ \&\ 0.5\)
Length 4: 2.6, 1.0, 0.4A1 0.4; All correct (c.s.o)
Length 5: 2.5, 0.5, 0.3
(4 marks)
Question 4(c):
AnswerMarks Guidance
AnswerMark Guidance
\(19.1 \div 4 = 4.775\) so 5 lengths needed; accept total is 19.1m, or refer to 0.9 'spare'B1
Yes, the answer to (b) does use the minimum number of binsDB1 Dependent on B1
(2 marks) [11 total]
# Question 4(a):

| Answer | Mark | Guidance |
|--------|------|----------|
| Row 1: 0.6, 4.0, 2.5, 3.2, 0.5, **2.6**, 0.4, 0.3, 4.0, 1.0 → **2.6** | M1 | Pivot chosen; list sorted $>p$, $p$, $<p$ or $<p$, $p$, $>p$. If only choosing 1 pivot per iteration M1 only |
| Row 2: 4.0, **3.2**, 4.0, $\underline{2.6}$, 0.6, 2.5, 0.5, **0.4**, 0.3, 1.0 → **3.2 0.4** | A1 | $1^{st}$ pass correct and chosen next **two** pivots correctly for sublists $>1$ |
| Row 3: 4.0, **4.0**, $\underline{3.2}$, $\underline{2.6}$, 0.6, 2.5, **0.5**, 1.0, $\underline{0.4}$, **0.3** → **4.0 0.5** | A1ft | $2^{nd}$ pass correct and chosen next **two** pivots correctly for sublists $>1$ |
| Row 4: **4.0**, $\underline{4.0}$, $\underline{3.2}$, $\underline{2.6}$, 0.6, **2.5**, 1.0, $\underline{0.5}$, $\underline{0.4}$, $\underline{0.3}$ → **2.5** | A1ft | $3^{rd}$ pass correct and next pivot for sublist $>1$ chosen correctly |
| Row 5: $\underline{4.0}$, $\underline{4.0}$, $\underline{3.2}$, $\underline{2.6}$, **2.5**, **1.0**, $\underline{0.6}$, $\underline{0.5}$, $\underline{0.4}$, $\underline{0.3}$ | A1 cso | |

**(5 marks)**

---

# Question 4(b):

| Answer | Mark | Guidance |
|--------|------|----------|
| Length 1: 4 | M1 | left column & 1.0 in place |
| Length 2: 4 | A1 | |
| Length 3: 3.2, 0.6 | A1 | $0.6\ \&\ 0.5$ |
| Length 4: 2.6, 1.0, 0.4 | A1 | 0.4; All correct (c.s.o) |
| Length 5: 2.5, 0.5, 0.3 | | |

**(4 marks)**

---

# Question 4(c):

| Answer | Mark | Guidance |
|--------|------|----------|
| $19.1 \div 4 = 4.775$ so 5 lengths needed; accept total is 19.1m, or refer to 0.9 'spare' | B1 | |
| Yes, the answer to (b) does use the minimum number of bins | DB1 | Dependent on B1 |

**(2 marks) [11 total]**

---
4. A builder is asked to replace the guttering on a house. The lengths needed, in metres, are

$$0.6,4.0,2.5,3.2,0.5,2.6,0.4,0.3,4.0 \text { and } 1.0$$

Guttering is sold in 4 m lengths.
\begin{enumerate}[label=(\alph*)]
\item Carry out a quick sort to produce a list of the lengths needed in descending order. You should show the result of each pass and identify your pivots clearly.
\item Apply the first-fit decreasing bin-packing algorithm to your ordered list to determine the total number of 4 m lengths needed.
\item Does the answer to part (b) use the minimum number of 4 m lengths? You must justify your answer.
\end{enumerate}

\hfill \mbox{\textit{Edexcel D1 2010 Q4 [11]}}