Question 3

OCR B (MEI) Further Maths June 2023 Modelling with algorithms (Y413-01)AS10 marks

On the specification

(a)
A1–A11 Modelling with Algorithms (Y413): Algorithms
(b)(i)
A1–A11 Modelling with Algorithms (Y413): Algorithms
(b)(ii)
A1–A11 Modelling with Algorithms (Y413): Algorithms
(c)
A1–A11 Modelling with Algorithms (Y413): Algorithms
(d)(i)
A1–A11 Modelling with Algorithms (Y413): Algorithms
(d)(ii)
A1–A11 Modelling with Algorithms (Y413): Algorithms
Question text

3 The list below shows the sizes of 10 items. 17 15 18 9 23 20 14 12 25 11 (a) Use the quick sort algorithm to sort the list of numbers above into descending order. You should use the first value as the pivot for each sublist. [3] The first fit decreasing algorithm is used to pack items with the sizes listed above into bins that have a capacity of m, where m is a positive integer. The following packing is achieved. Bin 1: 25 20 Bin 2: 23 18 Bin 3: 17 15 14 Bin 4: 12 11 9 (b) (i) By considering the placement of the three largest items, determine the possible values of m. [1] (ii) By considering the total in each bin, further refine the possible values of m. [1] (c) Using the original list, show the result of applying the first fit algorithm to pack items with the sizes listed above into bins that have a capacity of m, where m takes any of the possible values found in part (b)(ii). [2] A list of n numbers is to be sorted into descending order using the quick sort algorithm. The number of comparisons made is used as a measure of complexity of the quick sort algorithm. (d) (i) By considering a worst case, determine an expression in terms of n, for the total number of comparisons required to sort the list using the quick sort algorithm in the worst case. [2] (ii) Hence state, in the worst case, the complexity of the quick sort algorithm. [1]