Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D1 and algorithms

Pack items using the first-fit, first-fit decreasing and full-bin methods, and compare them with a lower bound

A level Further Maths · D1 and algorithms

A question

These items are to be packed into bins:

\(40, 25, 20, 15, 40, 45, 20, 30, 25\)

Each bin has a capacity of \(50\). Calculate the lower bound for the number of bins needed. Then pack the items using the first-fit decreasing algorithm.

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. First-fit decreasing: first write the items in order of size, largest first: 45, 40, 40, 30, 25, 25, 20, 20, 15.
  2. Then take them in that order and put each one in the first bin with enough room left (bin size 50), opening a new bin only when it fits nowhere else.
    Bin 1: 45 (total 45)
    Bin 2: 40 (total 40)
    Bin 3: 40 (total 40)
    Bin 4: 30, 20 (total 50)
    Bin 5: 25, 25 (total 50)
    Bin 6: 20, 15 (total 35)
  3. First-fit decreasing uses 6 bins.

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.