# Maths question on using the minimum amount of DVD disc

1. Mar 6, 2013

### kenny1999

this is a practical question

I have 14 files to burn on a single layer DVD5 disc in which each of them has a size approximately 4.37GB

Those 14 files are of the size (in GB)

2.25
2.25
1.15
3.05
1.16
2.40
0.65
2.05
1.36
1.97
1.11
1.14
2.48
2.65

All values are in GB

If I want to burn these 14 files into minimum number of DVD discs for environmental and economic purposes, how should these files be arranged? I think at least a few discs could be saved if the files are arranged correctly, and I want to learn the concept. thanks

2. Mar 6, 2013

### Vargo

Basically you want to pack each disk as much as possible. You could figure it out like this. Start with your largest file and burn it on a disk. Then you'll have 4.37-3.05=1.32 space. There is not enough room for the two smallest files to fit on that disk, so just put the largest file on their with less than 1.32. In other words, the 1.16. So your first disk is
(3.05, 1.16).
Cross those off your list and continue this process. Next step you load
(2.65, 1.36), so cross those off the list.
Then you load 2.48 and notice you have 1.89 space left. Your largest available file is 1.15 which leaves you enough room to squeeze on the .65, so you got
(2.48, 1.15, .65)
Next
(2.40, 1.97) an exact fillup. Hopefully that one actually fits :)
You could probably figure out the last five.

Now you only have 7 left...

3. Mar 6, 2013

### kenny1999

Thanks i ll try

4. Mar 6, 2013

### AlephZero

Several of the files are bigger than half the size of the DVD.

You con't fit two of those files onto the same DVD, so that gives you the minimum possible number of disks.

You then need to check that you can actually fit all the files onto that many disks.

5. Mar 6, 2013

### Petek

Your task is what's called the bin packing problem. For such a small number of files, any brute force approach probably will be satisfactory. Another possibility: If you don't need to store the files in their native format, most compression programs will allow you to split the files across multiple discs. That feature allows you to fill up each disc before going to the next one.