OCR MEI D1 2014 June — Question 5

Exam BoardOCR MEI
ModuleD1 (Decision Mathematics 1)
Year2014
SessionJune
TopicPermutations & Arrangements
TypeAssignment/allocation matching problems

5
  1. The following instructions operate on positive integers greater than 4.
    Step 10 Choose any positive integer greater than 4, and call it \(n\).
    Step 15 Write down \(n\).
    Step 20 If \(n\) is even then let \(n = \frac { n } { 2 }\) and write down the result.
    Step 30 If \(n\) is odd then let \(n = 3 n + 1\) and write down the result.
    Step 40 Go to Step 20.
    1. Apply the instructions with 6 as the chosen integer, stopping when a sequence repeats itself.
    2. Apply the instructions with 256 as the chosen integer, stopping when a sequence repeats itself.
    3. Add an instruction to stop the process when \(n\) becomes 1 .
    4. It is not known if, when modified to stop cycling through \(4,2,1\), the instructions form an algorithm. What would need to be known for it to be an algorithm?
  2. Six items with weights given in the table are to be packed into boxes each of which has a capacity of 10 kg .
    ItemABCDEF
    Weight \(( \mathrm { kg } )\)216335
    The first-fit algorithm is as follows.
    \includegraphics[max width=\textwidth, alt={}, center]{aac29742-fee8-48a9-896c-e96696742251-7_809_1280_660_356}
    1. Use the first-fit algorithm to pack the items in the order given, and state how many boxes are needed.
    2. Place the items in increasing order of weight, and then apply the first-fit algorithm.
    3. Place the items in decreasing order of weight, and then apply the first-fit algorithm. An optimal solution is one which uses the least number of boxes.
    4. Find a set of weights for which placing in decreasing order of weight, and then applying the firstfit algorithm, does not give an optimal solution. Show both the results of first-fit decreasing and an optimal solution.
    5. First-fit decreasing has quadratic complexity. If it takes a person 30 seconds to apply first-fit decreasing to 6 items, about how long would it take that person to apply it to 60 items?