OCR Further Discrete 2018 December — Question 3

Exam BoardOCR
ModuleFurther Discrete (Further Discrete)
Year2018
SessionDecember
TopicSorting Algorithms

3 A set of ten cards have the following values:
\(\begin{array} { l l l l l l l l l l } 13 & 8 & 4 & 20 & 12 & 15 & 3 & 2 & 10 & 8 \end{array}\) Kerenza wonders if there is a set of these cards with a total of exactly 50 .
  1. Which type of problem (existence, construction, enumeration or optimisation) is this? The five cards \(4,8,8,10\) and 20 have a total of 50.
  2. How many ways are there to arrange three of these five cards (with the two 8 s being indistinguishable) so that the total of the numbers on the first two cards is less than the number on the third card?
  3. How many ways are there to select (choose) three of the five cards so that the total of the numbers on the three cards is less than 25 ?
  4. Show how quicksort works by using it to sort the original list of ten cards into increasing order.
    You should indicate the pivots used and which values are already known to be in their correct position.