Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Sadly we don't have lossless compression of all inputs, merely a subset of inputs whose content is somewhat predictable. There's no way to uniquely represent all of 2^m distinct input bitstrings using 2^n outputs where n < m. In practice we assume input that's typically used has some predictable and redundant substrings, and that makes compression a win on average. But if you try to compress a high-entropy bitstring (such as comes out of a good implementation of /dev/random with noise from hardware), you will find it gets slightly larger, because the compression algorithm has to resort to supplying a literal copy of the input plus some small metadata saying it did so.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: