in reply to Re^3: Efficient 7bit compression
in thread Efficient 7bit compression
A more formal version of the proof is as follows. Suppose that a lossless compression algorithm manages to compress some string of length longer than n to length n or less. There are exactly 2**n + 2**(n-1) + ... + 2**0 = 2**(n+1) - 1 strings of length n or less. If the algorithm does not make any string of length n or less longer than n, then at least 2**(n+1) strings must map into this set, and by the pidgeonhole principle at least 2 strings are sent to the same result. However if we get that resulting then we can't figure out the original string (because we could have started with 2 different strings) contradicting our assumption that the algorithm was lossless.
Therefore a lossless compression algorithm that manages to compress any string must make some other string longer.
(Of course in practice one hopes that the strings which are made longer are likely to be rare and not made much longer, while the strings that are made shorter are likely to be common and made much shorter...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Efficient 7bit compression
by MidLifeXis (Monsignor) on Mar 17, 2005 at 13:19 UTC |