Jamal wants to save 30 files onto disks, each with 1.44 MB space. 3 of the files take up 0.8 MB, 12 of the files take up 0.7 MB, and the rest take up 0.4 MB. It is not possible to split a file onto 2 different disks. What is the smallest number of disks needed to store all 30 files?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
Only 0.7+0.7, 0.8+0.4, 0.7+0.4 and 0.4+0.4+0.4 fit on a disk; the 15 large files force at least 9 disks with little room for the 15 small ones.
Solution
There are files of , of , and of . Call the and files "large" ( in all). Check what fits in : two large files fit only if both are (), and then nothing else fits; one large file leaves room for at most one ( is too much); a disk with no large file holds at most three files ().
Suppose disks were enough. Let be the numbers of disks holding two, one, or zero large files. Then and , so and . Those disks can hold at most small files, and forces , so at most small files fit. Contradiction: disks fail.
Thirteen disks work: three disks each with , six disks each with , and four disks each with three files. That stores files.
The answer is .
Why this works
Packing problems are solved by a two-sided argument: a lower bound from what cannot share a disk, and a concrete arrangement that meets it. The bound must respect the integrality constraint (files do not split), so raw total size is not enough; instead, classify disks by how many large files they carry and count leftover room for the small files.
Alternative approach
Greedy with a justification: each file needs its own disk, and the best use of its spare room is one file, so use disks for . The remaining MB exceeds , so at least more disks are required, and disks of plus disks of three 's achieve it: total.
The trap
Dividing total size 16.8 MB by 1.44 to get 12 disks, ignoring that files cannot be split and that 0.8 and 0.7 cannot share a disk.
Common mistakes
- Dividing total size 16.8 MB by 1.44 to get 12 disks, ignoring that files cannot be split and that 0.8 and 0.7 cannot share a disk.
- Pairing each with a (twelve disks) and then needing four more for the 's and leftover 's, arriving at or .
Techniques
Bound the quantity above/below or estimate to pin it down · Consider the largest/smallest element or boundary case