A2 October 2020 Q5

EdexcelCurrent spec7 marksAlgorithms

5. The nine distinct numbers in the following list are to be packed into bins of size 50

231719\(x\)248181021

When the first-fit bin packing algorithm is applied to the numbers in the list it results in the following allocation.

Bin 1:23   17   8
Bin 2:19   \(x\)   10
Bin 3:24   18
Bin 4:21
(a) Explain why \(13 \lt x \lt 21\) (3)

The same list of numbers is to be sorted into descending order. 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

23191724\(x\)1810218
(b) Using this information, write down the smallest interval that must contain \(x\), giving your answer as an inequality. (2)

When the first-fit decreasing bin packing algorithm is applied to the nine distinct numbers it results in the following allocation.

Bin 1:24   23
Bin 2:21   19   10
Bin 3:18   17   \(x\)
Bin 4:8

Given that only one of the bins is full and that \(x\) is an integer,

(c) calculate the value of \(x\). You must give reasons for your answer. (2)