Edexcel D1 2017 June — Question 3 13 marks

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2017
SessionJune
Marks13
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeDeducing Original List Properties
DifficultyModerate -0.8 This is a routine D1 question testing standard algorithm execution (bin packing, quicksort, bubble sort). Part (d) requires logical deduction about x's value from bubble sort behavior, but this follows directly from understanding how bubble sort swaps work—if x moved from position 4 to position 5 between passes, it must satisfy 18 < x < 20. This is straightforward algorithmic reasoning with no novel problem-solving required, making it easier than average A-level maths questions.
Spec7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin

3. \(\quad \begin{array} { l l l l l l l l l l } 42 & 21 & 15 & 16 & 35 & 10 & 31 & 11 & 27 & 39 \end{array}\)
  1. Use the first-fit bin packing algorithm to determine how the numbers listed above can be packed into bins of size 65
  2. The list of numbers is to be sorted into descending order. Use a quick sort to obtain the sorted list. You should show the result of each pass and identify your pivots clearly.
  3. Use the first-fit decreasing bin packing algorithm on your ordered list to pack the numbers into bins of size 65 The nine distinct numbers below are to be sorted into descending order $$\begin{array} { l l l l l l l l l } 23 & 14 & 17 & \boldsymbol { x } & 21 & 18 & 8 & 20 & 11 \end{array}$$ A bubble sort, starting at the left-hand end of the list, is to be used to obtain the sorted list. After the first complete pass, the list is $$\begin{array} { l l l l l l l l l } 23 & 17 & \boldsymbol { x } & 21 & 18 & 14 & 20 & 11 & 8 \end{array}$$ After the second complete pass, the list is $$\begin{array} { l l l l l l l l l } 23 & 17 & 21 & 18 & \boldsymbol { x } & 20 & 14 & 11 & 8 \end{array}$$
  4. Using this information, write down the smallest interval that must contain \(\boldsymbol { x }\). Give your answer as an inequality.

3. $\quad \begin{array} { l l l l l l l l l l } 42 & 21 & 15 & 16 & 35 & 10 & 31 & 11 & 27 & 39 \end{array}$
\begin{enumerate}[label=(\alph*)]
\item Use the first-fit bin packing algorithm to determine how the numbers listed above can be packed into bins of size 65
\item The list of numbers is to be sorted into descending order. Use a quick sort to obtain the sorted list. 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 pack the numbers into bins of size 65

The nine distinct numbers below are to be sorted into descending order

$$\begin{array} { l l l l l l l l l } 
23 & 14 & 17 & \boldsymbol { x } & 21 & 18 & 8 & 20 & 11
\end{array}$$

A bubble sort, starting at the left-hand end of the list, is to be used to obtain the sorted list. After the first complete pass, the list is

$$\begin{array} { l l l l l l l l l } 
23 & 17 & \boldsymbol { x } & 21 & 18 & 14 & 20 & 11 & 8
\end{array}$$

After the second complete pass, the list is

$$\begin{array} { l l l l l l l l l } 
23 & 17 & 21 & 18 & \boldsymbol { x } & 20 & 14 & 11 & 8
\end{array}$$
\item Using this information, write down the smallest interval that must contain $\boldsymbol { x }$. Give your answer as an inequality.
\end{enumerate}

\hfill \mbox{\textit{Edexcel D1 2017 Q3 [13]}}