Edexcel FD1 AS 2024 June — Question 1 9 marks

Exam BoardEdexcel
ModuleFD1 AS (Further Decision 1 AS)
Year2024
SessionJune
Marks9
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeQuick Sort Execution
DifficultyModerate -0.8 This is a routine algorithmic execution question requiring mechanical application of standard algorithms (quick sort, bin packing, bubble sort) with no problem-solving or novel insight. Part (a) is straightforward pivot selection and partitioning, part (b) is direct algorithm application, part (c) requires simple lower bound calculation, and part (d) needs basic observation about bubble sort properties. Easier than average A-level maths due to purely procedural nature.
Spec7.03j Sorting: bubble sort and shuttle sort7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin

1. $$\begin{array} { l l l l l l l l l l l } 4 & 6.5 & 7 & 1.3 & 2 & 5 & 1.5 & 6 & 4.5 & 6 & 1 \end{array}$$ The list of eleven numbers shown above is to be sorted into descending order.
  1. Carry out a quick sort to produce the sorted list. You should show the result of each pass and identify the pivots clearly.
  2. Use the first-fit decreasing bin packing algorithm to pack the numbers into bins of size 10
  3. Determine whether your answer to part (b) uses the minimum number of bins. You must justify your answer. A different list of eleven numbers is to be sorted into descending order using a bubble sort. The list after the second pass is
    1.6
    1.7
    1.5
    3.8
    3.3
    4.5
    4.8
    5.6
    5.4
    6.7
    9.1
  4. Explain how you know that at least one of the first two passes of the bubble sort was not carried out correctly.

Question 1:
Part (a)
Middle right pivot(s):
\[4 \quad 6.5 \quad 7 \quad 1.3 \quad 2 \quad \boxed{5} \quad 1.5 \quad 6 \quad 4.5 \quad 6 \quad 1\]
\[6.5 \quad 7 \quad \boxed{6} \quad 6 \quad \underline{5} \quad 4 \quad 1.3 \quad 2 \quad \boxed{1.5} \quad 4.5 \quad 1\]
\[6.5 \quad \boxed{7} \quad \underline{6} \quad 6 \quad \underline{5} \quad 4 \quad \boxed{2} \quad 4.5 \quad 1.5 \quad 1.3 \quad \boxed{1}\]
\[\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4 \quad \boxed{4.5} \quad \underline{2} \quad 1.5 \quad 1.3 \quad \underline{1}\]
\[\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad 4 \quad \underline{2} \quad 1.5 \quad 1.3 \quad \underline{1}\]
Middle left pivot(s):
\[4 \quad 6.5 \quad 7 \quad 1.3 \quad 2 \quad \boxed{5} \quad 1.5 \quad 6 \quad 4.5 \quad 6 \quad 1\]
\[6.5 \quad \boxed{7} \quad 6 \quad 6 \quad \underline{5} \quad 4 \quad 1.3 \quad \boxed{2} \quad 1.5 \quad 4.5 \quad 1\]
\[\underline{7} \quad 6.5 \quad \boxed{6} \quad 6 \quad \underline{5} \quad \boxed{4} \quad 4.5 \quad \underline{2} \quad 1.3 \quad 1.5 \quad 1\]
\[\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad \underline{4} \quad \underline{2} \quad 1.5 \quad \boxed{1.3} \quad 1\]
\[\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad \underline{4} \quad \underline{2} \quad 1.5 \quad \underline{1.3} \quad 1\]
AnswerMarks Guidance
M1 for correct method shown; A1 A1 for correct passesM1, A1, A1 1.1b
(3 marks)
Part (b)
AnswerMarks Guidance
Bin 1: \(\boxed{7}\) \(\quad 2 \quad 1\)
Bin 2: \(\boxed{6.5}\) \(\quad 1.5 \quad 1.3\)
Bin 3: \(\boxed{6}\) \(\quad 4\)
Bin 4: \(\boxed{6}\)
Bin 5: \(\boxed{5}\) \(\quad \boxed{4.5}\)
Correct bin-packing shownM1, A1(underlined), A1 1.1b
(3 marks)
Part (c)
Lower bound for number of rolls required:
\[\frac{4 + 6.5 + 7 + 1.3 + 2 + 5 + 1.5 + 6 + 4.5 + 6 + 1}{10} = \frac{44.8}{10} = 4.48\]
Therefore the minimum number of bins is 5. Yes, the solution is optimal.
AnswerMarks Guidance
\(\frac{44.8}{10} = 4.48\)M1 1.1b
Minimum number of bins is 5; Yes, solution is optimalA1 2.2a
(2 marks)
Part (d)
AnswerMarks Guidance
e.g. The lowest two values should be in the two far right positions, and they are not. OR 1.6 is not in the correct positionB1 3.1a
(1 mark)
Total: (9 marks)
Question 1:
Part (a)
AnswerMarks Guidance
Answer/WorkingMark Guidance
Quick sort: pivot \(p\) selected, first pass gives \(>p, p, M1 If choosing 1 pivot per iteration, award M1 only. Bubble sort is M0. If sorting into ascending order, pivots chosen for second pass M1 only. If inconsistent with middle left/middle right M1 only.
Second and third passes correctA1
CSO including fourth passA1 Miscopy/misread can score maximum of M1A0A0
Part (b)
AnswerMarks Guidance
Answer/WorkingMark Guidance
First six items placed correctly (values in boxes) with at least eight values placedM1 Allow cumulative totals for M1 only
First nine items placed correctly (values in boxes and underlined)A1
CSO (therefore no repeated values)A1
Part (c)
AnswerMarks Guidance
Answer/WorkingMark Guidance
Lower bound calculation attempted: \([37.5, 51.8]/10\) (accept sight of 4.48) or total wastage calculation attempted and compared with 10 or total space used and compared with 50 or clear statement that four values are over half bin capacity and one equals half, therefore minimum bins must be 5M1 Either method acceptable
"Minimum 5 bins" with correct numerical argument (4.48) or correct numerical justification for why answer to (b) does use minimum number of binsA1 CSO. Dependent on correct bin packing in (b). Requires both a statement and a correct numerical argument
Part (d)
AnswerMarks Guidance
Answer/WorkingMark Guidance
Must mention either the two smallest values being in tenth and eleventh positions is not the case, or that second smallest value (1.6) is not in the correct position. Alternatively, may consider both ends: two largest numbers not in order at one end and two smallest numbers not in order at the other endB1 Allow candidates to only consider the right-hand end of the given list (condone omission of considering the left-hand end)
## Question 1:

### Part (a)
**Middle right pivot(s):**

$$4 \quad 6.5 \quad 7 \quad 1.3 \quad 2 \quad \boxed{5} \quad 1.5 \quad 6 \quad 4.5 \quad 6 \quad 1$$
$$6.5 \quad 7 \quad \boxed{6} \quad 6 \quad \underline{5} \quad 4 \quad 1.3 \quad 2 \quad \boxed{1.5} \quad 4.5 \quad 1$$
$$6.5 \quad \boxed{7} \quad \underline{6} \quad 6 \quad \underline{5} \quad 4 \quad \boxed{2} \quad 4.5 \quad 1.5 \quad 1.3 \quad \boxed{1}$$
$$\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4 \quad \boxed{4.5} \quad \underline{2} \quad 1.5 \quad 1.3 \quad \underline{1}$$
$$\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad 4 \quad \underline{2} \quad 1.5 \quad 1.3 \quad \underline{1}$$

**Middle left pivot(s):**

$$4 \quad 6.5 \quad 7 \quad 1.3 \quad 2 \quad \boxed{5} \quad 1.5 \quad 6 \quad 4.5 \quad 6 \quad 1$$
$$6.5 \quad \boxed{7} \quad 6 \quad 6 \quad \underline{5} \quad 4 \quad 1.3 \quad \boxed{2} \quad 1.5 \quad 4.5 \quad 1$$
$$\underline{7} \quad 6.5 \quad \boxed{6} \quad 6 \quad \underline{5} \quad \boxed{4} \quad 4.5 \quad \underline{2} \quad 1.3 \quad 1.5 \quad 1$$
$$\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad \underline{4} \quad \underline{2} \quad 1.5 \quad \boxed{1.3} \quad 1$$
$$\underline{7} \quad 6.5 \quad \underline{6} \quad 6 \quad \underline{5} \quad 4.5 \quad \underline{4} \quad \underline{2} \quad 1.5 \quad \underline{1.3} \quad 1$$

| M1 for correct method shown; A1 A1 for correct passes | M1, A1, A1 | 1.1b |

**(3 marks)**

---

### Part (b)

| Bin 1: $\boxed{7}$ $\quad 2 \quad 1$ | | |
|---|---|---|
| Bin 2: $\boxed{6.5}$ $\quad 1.5 \quad 1.3$ | | |
| Bin 3: $\boxed{6}$ $\quad 4$ | | |
| Bin 4: $\boxed{6}$ | | |
| Bin 5: $\boxed{5}$ $\quad \boxed{4.5}$ | | |

| Correct bin-packing shown | M1, A1(underlined), A1 | 1.1b |

**(3 marks)**

---

### Part (c)

Lower bound for number of rolls required:

$$\frac{4 + 6.5 + 7 + 1.3 + 2 + 5 + 1.5 + 6 + 4.5 + 6 + 1}{10} = \frac{44.8}{10} = 4.48$$

Therefore the minimum number of bins is 5. Yes, the solution is optimal.

| $\frac{44.8}{10} = 4.48$ | M1 | 1.1b |
| Minimum number of bins is 5; Yes, solution is optimal | A1 | 2.2a |

**(2 marks)**

---

### Part (d)

| e.g. The lowest two values should be in the two far right positions, and they are not. OR 1.6 is not in the correct position | B1 | 3.1a |

**(1 mark)**

**Total: (9 marks)**

# Question 1:

## Part (a)
| Answer/Working | Mark | Guidance |
|---|---|---|
| Quick sort: pivot $p$ selected, first pass gives $>p, p, <p$ | M1 | If choosing 1 pivot per iteration, award M1 only. Bubble sort is M0. If sorting into ascending order, pivots chosen for second pass M1 only. If inconsistent with middle left/middle right M1 only. |
| Second and third passes correct | A1 | |
| CSO including fourth pass | A1 | Miscopy/misread can score maximum of M1A0A0 |

## Part (b)
| Answer/Working | Mark | Guidance |
|---|---|---|
| First six items placed correctly (values in boxes) with at least eight values placed | M1 | Allow cumulative totals for M1 only |
| First nine items placed correctly (values in boxes and underlined) | A1 | |
| CSO (therefore no repeated values) | A1 | |

## Part (c)
| Answer/Working | Mark | Guidance |
|---|---|---|
| Lower bound calculation attempted: $[37.5, 51.8]/10$ (accept sight of 4.48) **or** total wastage calculation attempted and compared with 10 **or** total space used and compared with 50 **or** clear statement that four values are over half bin capacity **and** one equals half, therefore minimum bins must be 5 | M1 | Either method acceptable |
| "Minimum 5 bins" with correct numerical argument (4.48) **or** correct numerical justification for why answer to (b) does use minimum number of bins | A1 | CSO. Dependent on correct bin packing in (b). Requires both a statement and a correct numerical argument |

## Part (d)
| Answer/Working | Mark | Guidance |
|---|---|---|
| Must mention either the two smallest values being in tenth and eleventh positions is not the case, or that second smallest value (1.6) is not in the correct position. Alternatively, may consider both ends: two largest numbers not in order at one end and two smallest numbers not in order at the other end | B1 | Allow candidates to only consider the right-hand end of the given list (condone omission of considering the left-hand end) |

---
1.

$$\begin{array} { l l l l l l l l l l l } 
4 & 6.5 & 7 & 1.3 & 2 & 5 & 1.5 & 6 & 4.5 & 6 & 1
\end{array}$$

The list of eleven numbers shown above is to be sorted into descending order.
\begin{enumerate}[label=(\alph*)]
\item Carry out a quick sort to produce the sorted list. You should show the result of each pass and identify the pivots clearly.
\item Use the first-fit decreasing bin packing algorithm to pack the numbers into bins of size 10
\item Determine whether your answer to part (b) uses the minimum number of bins. You must justify your answer.

A different list of eleven numbers is to be sorted into descending order using a bubble sort. The list after the second pass is\\
1.6\\
1.7\\
1.5\\
3.8\\
3.3\\
4.5\\
4.8\\
5.6\\
5.4\\
6.7\\
9.1
\item Explain how you know that at least one of the first two passes of the bubble sort was not carried out correctly.
\end{enumerate}

\hfill \mbox{\textit{Edexcel FD1 AS 2024 Q1 [9]}}