Algorithm that makes maximum compression of completly diffused data.

Tim Chase python.list at
Mon Nov 4 14:08:03 CET 2013

On 2013-11-03 19:40, Mark Janssen wrote:
> But you cheated by using a piece of information from "outside the
> system": length.  A generic compression algorithm doesn't have this
> information beforehand.

By cheating with outside information, you can perfectly compress any
one data-set down to 1 bit.  Just store the data in the program, then
store 1 bit of "is this file the data we have stored in the
program?".  Granted, in modern OSes, you waste 7 extra bits since
they require you to write an entire byte at a time. :-)

And with that, you could even have an empty file and test for a file
extension. ;-)


More information about the Python-list mailing list