D1 June 2014 Q6
6.
24 14 8 \(x\) 19 25 6 17 9
The numbers in the list represent the exact weights, in kilograms, of 9 suitcases. One suitcase is weighed inaccurately and the only information known about the unknown weight, \(x\) kg, of this suitcase is that \(19 \lt x \leqslant 23\). The suitcases are to be transported in containers that can hold a maximum of 50 kilograms.
After the first-fit decreasing bin packing algorithm has been applied to the ordered list, one of the containers is full.
| Scheme | Marks |
|---|---|
| Bin 1: 24 14 8 Bin 2: \(x\) 19 6 Bin 3: 25 17 Bin 4: 9 | M1 A1 A1 |
| (3) |
Notes
a1M1 First four items placed correctly and at least six values put in bins (so bin 1 correct and the \(x\) in bin 2). If a candidate gives \(x\) a value in the given interval then allow this for the M mark in (a) only.
a1A1 First seven items placed correctly (so bins 1 and 2 correct and 25 in bin 3)
a2A1 cso – all correct
| Scheme | Marks |
|---|---|
| e.g. using middle right | |
| 24 14 8 \(x\) 19 25 6 17 9 pivot 19 | M1 (quick sort) |
| 24 \(x\) 25 19 14 8 6 17 9 pivots \(x\) 6 | A1 (1st pass/pivots for 2nd) |
| 24 25 \(x\) 19 14 8 17 9 6 pivots 25 17 | |
| 25 24 \(x\) 19 17 14 8 9 6 pivots (24) 8 | A1ft (2nd and 3rd passes correct) |
| 25 24 \(x\) 19 17 14 9 8 6 pivot 9 | |
| 25 24 \(x\) 19 17 14 9 8 6 (sort complete) | A1cso |
| (4) |
Notes
b1M1 Quick sort, pivot, p, chosen (must be choosing middle left or right – choosing first/last item as pivot is M0) and first pass gives >p, p, <p. So after the first pass the list should read (values greater than the pivot), pivot, (values less than the pivot). If only choosing one pivot per iteration M1 only
b1A1 First pass correct, next two pivots chosen correctly for second pass. If a candidate gives \(x\) a value in the given interval then allow this for the M mark and first A mark only in (b).
b2A1ft Second and third passes correct (follow through from their first pass and choice of pivots) – need not be choosing pivot(s) for the fourth pass for this mark.
b3A1 CSO (correct solution only- all previous marks in this part must have been awarded) including choice of pivots for the fifth pass and ‘sort complete’ – this could be shown either by a ‘stop’ statement or final list being re-written or using each item as a pivot.
Part (b) Using middle left as pivot
| 24 14 8 \(x\) 19 25 6 17 9 pivot 19 | |
| 24 \(x\) 25 19 14 8 6 17 9 pivots \(x\) 6 | M1 A1 |
| 24 25 \(x\) 19 14 8 17 9 6 pivots 24 8 | |
| 25 24 \(x\) 19 14 17 8 9 6 pivots (25) 14 (9) | A1 |
| 25 24 \(x\) 19 17 14 9 8 6 sort complete | A1cso |
Misreads
- If they have used the correct numbers at any point in part (a) and then use incorrect numbers in part (b) (say 71 instead of 17) from the beginning of the sort or misread their own numbers during part (b) then count it as an error in part (b) (so they will lose at least the final A mark but should be able to gain at least the M mark and ft A mark) – then mark part (c) according to the SC above.
Sorting list into ascending order in (b)
- If the candidate sorts the list into ascending order and reverse the list in part (b) then they can score full marks in (b).
- If the list is not reversed in part (b) then mark as a misread (so remove the last two A marks if earned in (b)). If the list is reversed at the start of (c) but not in (b) then still treat this as a misread. If the list is still in ascending order in part (c) award no marks for first fit increasing. If the candidate says that the list needs reversing in part (b) but doesn’t actually show the reversed list in (b) then remove the final A mark in (b).
Ascending (middle left)
| 24 14 8 \(x\) 19 25 6 17 9 | M1 |
| 14 8 6 17 9 19 24 \(x\) 25 | A1 |
| 6 14 8 17 9 19 \(x\) 24 25 | |
| 6 8 14 17 9 19 \(x\) 24 25 | A1 |
| 6 8 14 9 17 19 \(x\) 24 25 | |
| 6 8 9 14 17 19 \(x\) 24 25 | A1cso |
Ascending (middle right)
| 24 14 8 \(x\) 19 25 6 17 9 | |
| 14 8 6 17 9 19 24 \(x\) 25 | |
| 6 14 8 17 9 19 \(x\) 24 25 | |
| 6 14 8 9 17 19 \(x\) 24 25 | |
| 6 8 14 9 17 19 \(x\) 24 25 | |
| 6 8 9 14 17 19 \(x\) 24 25 |
| Scheme | Marks |
|---|---|
| (i) Bin 1: 25 24 Bin 2: \(x\) 19 9 Bin 3: 17 14 8 6 (ii) Bin 1: 25 24 Bin 2: \(x\) 19 8 Bin 3: 17 14 9 6 | M1 A1 A1 A1 |
| (4) |
Notes
c1M1 Must be using ‘sorted’ list in decreasing order. First four items placed correctly and at least six values put in bins (so bin 1 correct and the \(x\) and 19 in bin 2). If a candidate has given \(x\) a value in (c) then M0.
c1A1 First six values correct (bin 1 corerct, the \(x\) and 19 in bin 2, the 17 and 14 in bin 3)
c2A1 One allocation correct
c3A1 Both allocations correct - both allocations must be clear.
SC for (c): if ‘sorted’ list has one error from (b) (e.g. a missing number, an extra number or one number incorrectly placed) then M1A1 can be awarded in (c) (for four items (M1) and six items (A1) correctly placed - see above). However no marks in (d). If there is more than one error then M0.
| Scheme | Marks |
|---|---|
| \(x + 19 + 9 = 50 \Rightarrow x = 22\) \(x + 19 + 8 = 50 \Rightarrow x = 23\) | B2,1,0 |
| (2) | |
| (13 marks) |
Notes
d1B1 A correct value of \(x\) stated (working not necessary) – dependent on one correct allocation in (c).
d2B1 Both values correctly calculated (with relevant working) – dependent on both allocations correct seen in (c). If more than two values for \(x\) stated (e.g. all possible integer values) then no marks in (d).