Live data from Hacker News

File system that stores location of file in Pi

github.com

41–50 of 102 posts

Re: File system that stores location of file in Pi

#41

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…

To be fair, it compressed my 93 Gb file into 6 bytes. Incidentally, the file stored the first 100 billion decimals of pi.

Ah, the LenPEG approach.

http://www.dangermouse.net/esoteric/lenpeg.html

Re: File system that stores location of file in Pi

#42
post #5

Now, we all know that it can take a while to find a long sequence of digits in π, so for practical reasons, we should break the files up into smaller chunks that can be more readily found. In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π. Definitely worth a chuckle. Very cute idea and implementation.

You laugh now, but when we develop a trivial method to calculate pi and other irrational constants to quadrillions of digits, this will be wonderful.

By the pigeonhole principle, no matter how fast you can calculate pi, you cannot actually use this to compress data. The index to relevant sequence is on average >= the size of the data to be stored.

Re: File system that stores location of file in Pi

#43
post #39

If you're going to use a normal number for this purpose, why not choose a much nicer one? Let's use a number such that its binary representation is the concatenation of consecutive ascending binary numbers. 0 1 10 11 100 101 110 111 1000... becomes 0.0110111001011101111000... It's much easier to demonstrate that this number is normal than to do so for pi. It's also much easier to calculate the nth digit, and to find…

[deleted]

Re: File system that stores location of file in Pi

#45
I've been looking for the lyrics to the song that, when sung, will bring about peace on this planet. Now to hear that the file containing these lyrics is already contained in pi is revelatory. Could someone please give me the index and length of the file? I've got some singing to do.

Re: File system that stores location of file in Pi

#46

Obligatory Dinosaur Comics: http://www.qwantz.com/index.php?comic=353 "You can't copyright a fact (like a number), but you can copyright a creative work, like a song or a piece of software. But since one can be transformed into another, copyright law is logically INCOHERENT."

You cant copyright a number, but you can make it illegal[0].

[0]:https://en.wikipedia.org/wiki/Illegal_number

Re: File system that stores location of file in Pi

#50
post #33
post #5

Now, we all know that it can take a while to find a long sequence of digits in π, so for practical reasons, we should break the files up into smaller chunks that can be more readily found. In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π. Definitely worth a chuckle. Very cute idea and implementation.

If you used small chunks (say, up to four bytes) you could just have a lookup table storing all the indices. Or - what a genius idea! - we could use Pi itself as a lookup table and use the sequence of n bytes at that position of pi as an implicit lookup table.

There are 4,294,967,296 possibilities in 4 bytes.

To store a number in range of 0 to 4,294,967,296 - you will need exactly 4 bytes.

Post reply on HN