# Non-lossy compression implications

**URL:** <https://boards.straightdope.com/t/non-lossy-compression-implications/398625>\
**Category:** Factual Questions\
**Created:** [April 3, 2007, 10:07pm UTC](https://boards.straightdope.com/t/non-lossy-compression-implications/398625 "2007-04-03T22:07:54Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![Canadjun](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Canadjun](https://boards.straightdope.com/u/Canadjun)\
**Post date:** [April 4, 2007, 1:16pm UTC](https://boards.straightdope.com/t/non-lossy-compression-implications/398625/21 "2007-04-04T13:16:44Z")

</div>

There’s a simple reductio ad absurdum argument to show that not all strings can be compressed in a loss-less fashion.

Assume the contrary. Compress the string. It must be at least one bit shorter or you couldn’t say you had compressed it. Now compress the compressed string. Repeat as many times as there were bits in the original string. You have now compressed the entire string down to one bit in a loss-less fashion. Since all those steps were loss-less, you should now be able to expand that one bit back into the original string. How do you propose to do that?

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [April 4, 2007, 5:48pm UTC](https://boards.straightdope.com/t/non-lossy-compression-implications/398625/22 "2007-04-04T17:48:32Z")

</div>

> [@](#):
>
> However to do so I had to set up several 1,000 place arrays to store the intermediate figures. (can it be done without it?)

There’s no known way, in base 10. But a few years ago, someone found [an algorithm](http://www.sciencenews.org/pages/sn_arc98/2_28_98/mathland.htm) for generating the nth base-2 (or any base that’s a power of 2) digit of pi, without having to store all the others.

Of course, the fact that a base-10 algorithm still requires loads of memory doesn’t change the fact that the digits are still highly compressible. The decompression is very difficult, sure, but it’s possible in principle.

[Previous page](https://boards.straightdope.com/t/non-lossy-compression-implications/398625.md?page=1)
