πfs – A data-free filesystem
github.com
github.com
At the time I thought it could work with a big enough bank of digits of PI on both sides. If transfer was expensive, and calculating digits was cheap then you could give everyone an infinite supply of digits of pi and have a nearly infinite compression system.
I discovered that often the offset into pi is much larger than the data you are sending. Turns out it's an expensive way to sent things.
Also, it turns out that this area was already well understood. There are no free lunches with entropy.
But it was a fun idea to kick around.
The idea of using Pi is essentially the same as having a shared dictionary as used in both regular compression and in lossy as waveforms (in layman's, terms - technically it's a best match) both ends have the dictionary and you simply index it.
In fact whole network protocols use this concept too such as protocolbuffers which are part of grpc.
The difference here being the dictionary is infinite and until we get quantum computers on the desktop indexing into pi will always be slow. Some of the address space may not be feasible too, e.g. your file may require a billion bit address/index.
It may still be feasible to do partial matches for a file, 50% one index, 50% another for performance improvement.
I guess the trade off is a balance between performance and number of indexes Vs the original file length, and where in Pi the address space becomes unfeasible.
It's a more practical ( then my idea ) shared dictionary.
Shouldn't the offset be roughly the same size? If you look for a 1000 digit sequence, you need to try about 10^1000 starting points, which makes your offset about 1000 digits.
If I ever go mad and I breach the 'crankpot line' this will be it. There is something in entropy that I just can't fully grasp even though I understand (or I can convince myself that I do) Shannon, Kolmogorov etc.
"out of the box" means works right away, as soon as you take it out of the box, no assembly required.
> maximise performance, we consider each individual byte of the file separately, and look it up in π.
Ok, so we store a byte and look it up in π. Now we get an offset. The exact offset will depend on the byte of course. But to simplify let's assume that π is "optimal". We will assume that the fist 256 offsets contain the first 256 bytes.
So our offset will be in the range 0-255. Storing our offset will then take 1 byte of storage.
Oh, I have found the problem.
So yes, you can find any data in π. But storing the location of that data will on average take the same amount of space as the data itself.
You only need 2 bits 1 and 0 to store every file there can ever be, and then store sequences in file metadata. Call it bifs.
I thought you are supposed to find the offset where your entire file is sequentially there in pi.
Because if it's infinite and not repeating, then that string should be in there somewhere.
But I suspect that the analysis would look very similar for the entire file. Just calculate the average offset of the file of a given size. It won't be smaller than the file itself.
...of course you are still better off to just compress the file consisting of a single repeated byte.
Not on average. Not even at minimum. Since the leading values of pi are definitely _not_ so compact (and we have yet to identify any contiguous segment that is), the absolute minimum is N + plus the overhead to support the optimization of sometimes only using single-byte offsets by declaring the offset size as a header.
(edit for pedantism and type of atom) at an optimistic 100 billion carbon atoms in length for a metre stick, the maximum distinct cuts you can make are 100 billion, or 100 gigabytes of info. We do much better these days with thumb drives.
With only one cut as the parent comment describes, you can only store the log base 2 of 100 billion, which is 36, so about 4 bytes of info, or one long integer.
I didn't think that was actually mathematically proven yet. Was some proof accepted recently that makes that quoted sentence true?
πfs – A data-free filesystem - https://news.ycombinator.com/item?id=28699499 - Sept 2021 (30 comments)
PiFS – The Data-Free Filesystem - https://news.ycombinator.com/item?id=26208704 - Feb 2021 (1 comment)
Πfs: Never worry about data again - https://news.ycombinator.com/item?id=21359338 - Oct 2019 (1 comment)
The π Filesystem for FUSE: Store Your Data in π - https://news.ycombinator.com/item?id=19223032 - Feb 2019 (1 comment)
pifs - Avoid disk space usage by saving your files in the digits of Pi - https://news.ycombinator.com/item?id=18687275 - Dec 2018 (1 comment)
πfs – A data-free filesystem - https://news.ycombinator.com/item?id=13869691 - March 2017 (105 comments)
Πfs: Stores your data in π - https://news.ycombinator.com/item?id=10856108 - Jan 2016 (1 comment)
Πfs: Never worry about data again - https://news.ycombinator.com/item?id=10847693 - Jan 2016 (1 comment)
File system that stores location of file in Pi - https://news.ycombinator.com/item?id=8018818 - July 2014 (98 comments)
100% Compression Using Pi - https://news.ycombinator.com/item?id=6698852 - Nov 2013 (32 comments)
In this implementation, to maximise performance, we consider each individual byte of the file separately, and look it up in π.
LOL so you get to store your data for free, and all it takes is allocating like 8 bytes for every byte. This project is galaxy brain eating the onion
anecdotes of having the same idea
https://en.wikipedia.org/wiki/Normal_number
https://en.wikipedia.org/wiki/Pigeonhole_principleHad me laughing out loud. Priceless!
This isn't necessarily true, right? AFAIK this only holds if pi is normal, which we haven't proven.
https://www.sciencefocus.com/science/how-do-we-know-that-pi-...
0.101001000100001000001... (with an increasing-by-one sequence of zeroes between each successive 1.) It doesn't contain all sequences of digits, or even all digits, yet it cannot be written as a fraction.
Is that trivial?
My understanding is that it is a trivial (or at least well-known) result that a rational will always have a finite, infinitely-repeating terminal sequence in any base.
My sequence is a trillion consecutive 0s, followed by a trillion consecutive 1s, etc, all the way up through a trillion consecutive 9s. Who wins the bet?
In this case you win it when you check enough digits of pi that, if pi were normal, the expected probability of finding your string. Probably not gonna happen, but if you ever do hit me up! If you do that work I'll have the opportunity to win lots of smaller bets
edit: Wait that loses me catastrophic amounts of money. Keep checking until P<1/11,000, I think that's fair.
There are an infinite number of integers. You can start at 10 and count up forever, never running out of integers. But no matter how high you count, you’ll never count to “orange” - “orange” is not contained in the sequence of infinite integers.
You’ll need to first prove that every sequence of integers is contained somewhere in pi, since the number of possible integer sequences grows faster than the “space” for sequences in pi. In other words, I can always pick a digit that creates a valid, non repeating, integer sequence from the pool of possible sequences while never creating the integer sequence “123456789123456789123456789.” You’d need to prove that pi doesn’t do this.
Even if pi does contain every sequence of integers and you could map that to bytes which, in turn, maps to a file, this would not compress.
Your metadata directory would be larger than the raw files unless you get very lucky and your file is very early in the sequence of pi.
A byte can represent 256 unique values. 256 unique values can not compress to less than a byte. So if your index is a digit of pi where your file starts, your file starts after some other number of files. Your index is going to be the index inside of the address space of “all possible files.” This will get large very quickly.
What is a string, but a sequence of bytes? What is a sequence of bytes, but a decomposed integer?
"orange" = 111,494,907,916,911
You can encode orange in RGB and HSL too, but the set of all integers still does not contain the concept of an orange. You’ve just assigned meaning to an integer.
In the same way you can’t count to orange, you can never start at 1 and count up to -1. There are an infinite number of different integers greater than 1, and that infinity does not contain -1.
SciFi likes abusing this. Just because there are an infinite number of universes doesn’t mean there is a universe that contains anything you can dream up Rick and Morty style.
Nobody claimed "the concept of an orange" can be found. The claim that the word "orange" can't be found, however, is provably false.
If we're going by this logic, then nothing but 0 and 1 can ever be stored on any medium, because a hard drive can't possibly store "the concept of an orange" either.
> Just because there are an infinite number of universes doesn’t mean there is a universe that contains anything you can dream up Rick and Morty style.
And you know this with certainty.... how? With enough branches in a truly infinite timeline, the likelihood of there being a combination which produces a specific outcome is quite high.
It is not. It is quite low. The number of possible states grows at a faster rate than the rate necessary to maintain “infinity.” It’s only true if you assert that all possible states at a branch are added to the set, which is a tautology.
A fun puzzle. Let’s say you have an empty set whose members are sets. You add a set to it of infinite size (like the set of all positive integers). Next, you add another set to it whose size is also infinite but whose members are not contained in the first set. Now you repeat this process an infinite number of times.
You have an infinite set of infinite sets. The question is: is such a set possible and, if so, does your infinite set of infinite sets necessarily contain all possible infinite sets?
That is generally how "multiverses"/branching timelines are handled, yes.
Nor can any file system store the "concept of an orange".
File systems are really just pointers to numbers, if you think about it.
> If we're going by this logic, then nothing but 0 and 1 can ever be stored on any medium, because a hard drive can't possibly store "the concept of an orange" either.
We all do, all day, every day. Isn’t that exactly what computer science and mathematics is?
> Just because there are an infinite number of universes doesn’t mean there is a universe that contains anything you can dream up Rick and Morty style.
Sure, there are many different kinds of infinities, but what does that have to do with pi and file systems?
Even if the first million digits of some unnamed number were all nines (with no more afterward), it would not be normal because the distribution of nines, as the number of digits goes to infinity, would go down.
https://en.m.wikipedia.org/wiki/Illegal_number
I want my ShorFS where data is stored as factors.
Ok but I don't see how that relates to the idea of storing sequences of numbers (the basic function of a filesystem) in Pi. Orange is not a number so it doesn't make sense to look for it in any sequence of numbers. "Orange" can however be represented as a sequence of ASCII characters, and if every sequence of numbers is contained in Pi, then an ascii representation of any string can also be found.
> This will get large very quickly.
Right, but here's a thought...
Suppose the place in Pi where your sequence is located is huge. You could maybe (probably) find a sequence earlier in Pi that is a pointer to your actual location :) So the metadata would need like 3 things to make this work. 1) length of your data, 2) checksum of your data and 3) pointer into Pi. If hash of (pointer+length) doesn't match checksum, it's a pointer (which may point to a different pointer etc).
That might make it compress a bit better. Although you may need huge amount of RAM just to dereference the pointers.
If the sequence of bytes necessary to represent the file encodes to an integer index into pi, and that integer index encodes to a sequence of bytes larger than the original file, I have no reason to believe trying to repeat that process would result in anything other than an even larger integer index.
Is this true? Aren't the digits of pi and the number of possible (finite) integer sequences both countable?
From the link: One of the properties that π is conjectured to have is that it is normal, which is to say that its digits are all distributed evenly, with the implication that it is a disjunctive sequence, meaning that all possible finite sequences of digits will be present somewhere in it. If we consider π in base 16 (hexadecimal) , it is trivial to see that if this conjecture is true, then all possible finite files must exist within π. The first record of this observation dates back to 2001.
> Your metadata directory would be larger than the raw files unless you get very lucky and your file is very early in the sequence of pi.
This is very very clearly a tongue in cheek project and not intended as a practical way to store files
.(0123456789) has this property too.
Edit: oops, I forgot about n-length sequences of digits, .(0123456789) is definitely not normal, this is why I’m not a mathematician.
It's easy to construct a sequence of digits that is larger than any N digit number. But it's obviously impossible for any such number to be the largest number.
It is not, since the readme considers it an (unproven) working assumption.
>This will get large very quickly.
What? I can not believe that this joke repo, which even explains that saving a few hundred bytes takes minutes, is not in fact practical.
Well, certainly not with that attitude!
Meanwhile, in my highly efficient, proprietary fruit string compression scheme, "orange" is represented by the integer 8. (Don't confuse it with "blood orange" though; that's 26.)
Psst... That was the joke :)
Somewhere in pi (at some insane offset) is the entire work of William Shakespeare.
Is that the basic idea here?
You have to calculate the probability of a monkey coming up with a work of Shakespeare, and then subtract that from 1 to get the probability of a monkey coming up with anything other than a work of Shakespeare, and then figure out what power N to raise that to (N attempts) for it to cross below some confidence value, like 0.05 ... then subtract that from 1 in order to get the probability of a monkey coming up with a work of Shakespeare after that many attempts.
(no matter how high N is, you will never get 0, so no matter how many times you attempt, you always "could" still not produce a work of Shakespeare, because there's always a chance that none of those attempts worked)
Then calculate how much time that might take (actually, you might even have to account for failed attempts that are shorter or longer than a work of Shakespeare, so you might even have to start with time rather than number of attempts, but I digress) and you have a possible figure for "how much time it would take to have a certain probability of a monkey having come up with a work of shakespeare" and oh dear I may have missed the joke
Isn't this where the old meme of a hacksaw inside a cake came from?
Nope, I’m undertraining. Get ready for TauOS.