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.
File system that stores location of file in Pi
41–50 of 102 posts
Re: File system that stores location of file in Pi
#42Now, 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.
Re: File system that stores location of file in Pi
#43If 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…
Re: File system that stores location of file in Pi
#44Re: File system that stores location of file in Pi
#45Re: File system that stores location of file in Pi
#46Obligatory 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."
Re: File system that stores location of file in Pi
#47Here's a link in case you have trouble locating it within Pi: http://hyperdiscordia.crywalt.com/library_of_babel.html
Re: File system that stores location of file in Pi
#48Re: File system that stores location of file in Pi
#49Re: File system that stores location of file in Pi
#50Now, 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.
To store a number in range of 0 to 4,294,967,296 - you will need exactly 4 bytes.