3 ms·
I'm skeptical that this could really save any space. Just speculating here, really, but it seems like on average the amount of space needed to store the starti
by bunderbunder 12y ago
I'm skeptical that this could really save any space. Just speculating here, really, but it seems like on average the amount of space needed to store the starting index of an arbitrary string of digits in pi should be greater than (or at least comparable to) the size of the string itself.
e.g., the first instance of "256" in pi starts at the 1750th digit. So in that case you're getting a 'compression' rate of -33% if we go by the count of decimal digits used.
- TheZenPsycho 12y ago... and that's the joke.
- peteretep 12y agoYou should really consider commenting on the project pointing this out to the author; I think he'll be disappointed to know that he hasn't discovered a way to magically compress random data. That said, I wonder if "but remember all that storage space we saved by moving our data into π? Why don't we store our file locations there!?!" wasn't meant as some kind of hint...
- Kapura 12y agoDon't worry, it scales well!
- hashmymustache 12y agoTo be fair, it compressed my 93 Gb file into 6 bytes. Incidentally, the file stored the first 100 billion decimals of pi.
- chacham15 12y agoNope, sry: "In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π."
- EarthLaunch 12y agoIt's obvious that, like many compression algorithms, this one is best suited for certain specific applications such as yours.
- vanderZwan 12y agoAh, the LenPEG approach. http://www.dangermouse.net/esoteric/lenpeg.html http://www.dangermouse.net/esoteric/lenpeg.html