-1

I have a file of 100 MB and it was compressed by huffman coding 20 times.

I want to draw a diagram for the changes of the size of the file while compressing it, so the x axis will have the number of compression times, and the y axis is the size of the file?

how it will be ?

Adly
  • 597
  • 3
  • 12
  • 23
  • Graph paper? If you want this done by a computer, you'll need to give SOME more details as to the form of diagram you want, what form the data is in, etc. – Scott Hunter Jun 27 '13 at 14:37
  • I don't mean that, I wanted only to know what's happens to the size of the file if frequent compression have been made on it? its size will be smaller? or it will saturate at some size then being bigger again because of randomness?! – Adly Jun 27 '13 at 14:42
  • @OP: "I want to draw a diagram" – Scott Hunter Jun 27 '13 at 14:43
  • @ScottHunter so what do you think? I think Tatterdemalion's answer is right? – Adly Jun 27 '13 at 14:45

1 Answers1

0

Your question seems unclear. Do you mean what would it roughly look like? Repeated compression on files has very steep diminishing returns. That is to say, the first compression will shrink it significantly, the second a little to none at all, and the subsequent tries will really not compress it at all, or possibly even get bigger. Compression is predicated on a lack of randomness, patterns, and being able to make those patterns represented with fewer bytes. After compression, files look more like random noise, so they are more difficult to compress.

Read through some of this for more information: http://mattmahoney.net/dc/dce.html#Section_11

Whelchel
  • 303
  • 2
  • 10
  • Yes, that's what I want. So after the size saturate at some point, its size will be bigger right? .. That's because the header of each compression process? – Adly Jun 27 '13 at 14:40
  • I think so, yes. You might want to test it our for yourself and see what happens. You might be able to download an old copy of 'pack', which does Huffman Encoding (but is deprecetad), and run it five times on a file say and just look at what happens. [Huffman Pack](http://en.wikipedia.org/wiki/Pack_%28compression%29) – Whelchel Jun 27 '13 at 14:45