News for hackers. Stuff that matters.
Re:Converting Pi to binary: Don't do it by techiferous on Friday August 06, 2010 @03:55PM (#1582147)
Hilarious. :)

This is an "illusion" of sorts that works by ignoring contextual information. Sure, all that stuff is in pi, but it takes intelligence for someone to extract the right number of bits starting at the right position and decide to put that in a certain context where it makes sense (SSN, executable machine code, JPEG, etc.).

For example, the UTF-8 representation of this comment is somewhere in pi, but you can't say that the full information of this comment is in pi. Part of the information lies outside of pi, in the person who finds that part of pi and chooses to decode it as UTF-8.

Re:Converting Pi to binary: Don't do it by ansgri on Friday August 06, 2010 @05:39PM (#1582397)
And it directly follows that you can encode any document as 2 numbers: (start-index, length) in the Pi representation. Well, this is also a bad idea since you can always treat the entire document as one binary number...
Re:Converting Pi to binary: Don't do it by DrJokepu on Friday August 06, 2010 @06:23PM (#1582491)
You don't even need length because there must be an instance of the document in pi that is already prefixed by the correct length, so all you really need is the offset of the first occurrence of that variation.
Re:Converting Pi to binary: Don't do it by StavrosK on Friday August 06, 2010 @06:02PM (#1582432)
Did you know that absolutely anything you can imagine is encrypted with an OTP in the first N digits of pi, where N is the length of your information?
Re:Converting Pi to binary: Don't do it by Natsu on Friday August 06, 2010 @07:25PM (#1582618)
Pity this sort of OTP is actually unbreakable.

It's because you can find absolutely anything there that you can never be sure that you've found what you're looking for.

Re:Converting Pi to binary: Don't do it by rlpb on Saturday August 07, 2010 @12:10PM (#1583765)
It's a shame that such an index-based encoding scheme will use more bits to store the index than the size of the document itself.
Re:Converting Pi to binary: Don't do it by Natsu on Friday August 06, 2010 @04:17PM (#1582201)
This sort of discussion often leads to someone wondering why it can't be used as a compression scheme, especially when you can calculate hexadecimal digits of pi without calculating any of the previous digits.

The first problem with that is finding the desired content somewhere in the number. You can't just Google it. In fact, I know of no way to search for it except for brute force (i.e. continue to calculate pi until such time as you find it). Because the odds are so low for any reasonably sized file, this is going to take a long time. Even if you measure using a scale where one unit is the current age of the universe, you would find the scale to be too small.

Even if someone solves that problem, the other problem is file size. You have to store offset and length. The length for most files would be reasonable, the problem is the offset. In all probability, that number is larger than your original file. Much larger. There are exceptions, of course, but not enough of them to help.

That said, I wonder how long it will be before some mathematician starts writing theorems about the "set of illegal numbers" like the 09F9 number and the rest.

Re:Converting Pi to binary: Don't do it by DougWebb on Friday August 06, 2010 @04:27PM (#1582237)
There's bound to be an exponential form for the offset which would take up a reasonable amount of space. eg: 2^100^100 takes up just 9 bytes, but if I wrote it out longhand it would be over 3000 bytes. Remember that it doesn't have to be human readable either; the 2 could be assumed and the 100's could be \x64\x64, just two bytes. In that form, you have a compact way to express large numbers, and any offset could be expressed as a sum of some such numbers.

I think the real problem, as you said, is having a copy of the full sequence around for encoding and decoding, and finding any given string of bits within it.

Re:Converting Pi to binary: Don't do it by evo on Friday August 06, 2010 @04:45PM (#1582270)
I would imagine that there is no exponential form that would take up less space in all cases than the original offset itself. You could think of the "exponential form" as a sort of compression algorithm with the same pitfalls as the latter, some exponential forms will end up taking more space than the original offset.

Furthermore, I would guess the offset has even less entropy on average than the bitsequence you're hoping to compress, so if you had an algorithm that would shorten the expression of the offset you might very well be able to apply it to the original bitsequence with the same or better results.

I'd think an information theory expert could probably tackle these sorts of questions very rigorously, but I am not one so this is mostly conjecture.

Re:Converting Pi to binary: Don't do it by btilly on Friday August 06, 2010 @06:23PM (#1582492)
You are absolutely right, and the argument is the same as why there cannot be a compression algorithm that compresses something without making something else larger.

Namely that there are 2^n possible signals with n bits, so if a compression algorithm compresses some signal that is larger than n bits down to n bits or less, then there aren't enough possibilities left for all possible signals of at most n to also be encoded with n bits or less.

Re:Converting Pi to binary: Don't do it by Natsu on Friday August 06, 2010 @07:23PM (#1582615)
Indeed he is correct. But I would like to note that you can cap how much space you waste on incompressible things, though. Just store a flag with it that indicates whether that chunk of data is incompressible and don't even try to compress the incompressible things. The decoder for that is simple: read the flag (which only has to be 1 bit) and decompress it if it was compressed, or just return the unchanged data otherwise.

However, you'll still find that there are still limits to exactly how much you can compress things. And you'll find that, sometimes when you think you've found something that looks like it should be able to compress things down to nothing, that you've just been hiding the data in your decompression program.

In a sense, when you consider special-purpose compression and decompression functions, it's not unlike how "RETR some_huge_file.rar" sent to an FTP program will "decompress" that tiny string into some multi-GB file. But that only works because the program already has a copy of the data.

Re:Converting Pi to binary: Don't do it by sp332 on Friday August 06, 2010 @05:13PM (#1582339)
The problem is information content. 2^100^100 is a special case: what if I want 2^100^100+1? or (2 * 10^100) + (1 * 10^99) + (3 * 10^98) + (7 * 10^97)... it would be much shorter to write that in its regular decimal form 2,137,... So to specify a sequence, you would (on average, not for special cases like the one you picked) need just as much information as there is in the sequence!
Re:Converting Pi to binary: Don't do it by Dove on Friday August 06, 2010 @08:44PM (#1582791)
That's funny, but it reflects a poor understanding of probability.

Figure as an upper bound that there are 10^90 particles in the universe. Now imagine that you could turn the entire universe into such an efficient computer that every particle stored a bit of information, and you used it to calculate pi.

The probability of finding an arbitrary binary string of length N in that pi is (1/2^N)*10^90. Set to .5, solve for N, and you get . . .

388 bits. You have a 50/50 probability of finding an arbitrary 388 bit string somewhere in there. For reference, that's about 50 characters in ASCII. Maybe enough for a threat against the president. CD cracking software seems more dubious.

When dealing with brute force probability, the numbers get big very, very fast. Don't assume that just because they seem big to you means they're big enough to solve the problem you're thinking about. Do the math.

Re:Converting Pi to binary: Don't do it by phn on Friday August 06, 2010 @04:10PM (#1582187)
This reminds me of a python script me and some friends wrote that would generate all the possible images of a given arbitrary size :)
Re:Converting Pi to binary: Don't do it by StavrosK on Friday August 06, 2010 @06:05PM (#1582438)
Did you ever get past the first 10 pixels?
Re:Converting Pi to binary: Don't do it by sigstoat on Friday August 06, 2010 @06:27PM (#1582505)
it is worth noting that pi also contains every possible convincing lie, along with photographic evidence.

(don't trust pi!)

Re:Converting Pi to binary: Don't do it by jpablo on Friday August 06, 2010 @04:00PM (#1582158)
It could be fun if someone made an analysis of the more interesting strings that can be extracted from the currently calculated trillions of digits of pi.

I wonder if we can even extract a full sentence that makes sense out of the current digits that we have.

Re:Converting Pi to binary: Don't do it by techiferous on Friday August 06, 2010 @04:07PM (#1582176)
I just realized that--if expanded to enough digits--the alphabet clock contains every possible finite English sentence (without punctuation or spaces). And this happens at every moment.

http://alphabetclock.com

Re:Converting Pi to binary: Don't do it by reader5000 on Friday August 06, 2010 @03:54PM (#1582145)
To be fair, this would be true of base-10 pi as well..
Re:Converting Pi to binary: Don't do it by DaemonXI on Friday August 06, 2010 @03:43PM (#1582126)
I always wondered how binary conversions worked with a floating point.
Re:Converting Pi to binary: Don't do it by mahmud on Friday August 06, 2010 @03:51PM (#1582139)
Re:Converting Pi to binary: Don't do it by rick_2047 on Friday August 06, 2010 @03:51PM (#1582138)
Someone should write a Sci Fi story about a research facility where every possible resource is dedicated to exploring strings of bits of pi. In the process they could discover a lot of things like

1)We are living in an illusion and are simulated (not like matrix, as in a real program) on the computer of a geeky alien in his basement (or equivalent in his world).

2)A method is discovered to capture bit strings which are part of real world and thus creates a computer which knows all the secrets.

3)That we are not the makers of our own destinies. Pi holds our past present and future.

Man this is exciting exploration into science fiction.

Re:Converting Pi to binary: Don't do it by dillydally on Friday August 06, 2010 @04:28PM (#1582240)
This is more-or-less the plot of Borges' "The Library of Babel," except he doesn't talk about binary, computers, or pi.

Instead the Library is a place where you have books that contain the every string of symbols.

http://jubal.westnet.com/hyperdiscordia/library_of_babel.htm...

Re:Converting Pi to binary: Don't do it by FiddlerClamp on Friday August 06, 2010 @03:57PM (#1582151)
In Carl Sagan's 'Contact', "Ellie, acting upon a suggestion by the senders of the message, works on a program which computes the digits of π to record lengths and in different bases. Very, very far from the decimal point (1020) and in base 11, it finds that a special pattern does exist when the numbers stop varying randomly and start producing 1s and 0s in a very long string. The string's length is the product of 11 prime numbers. The 1s and 0s when organized as a square of specific dimensions form a rasterized circle."
Re:Converting Pi to binary: Don't do it by sp332 on Friday August 06, 2010 @05:21PM (#1582353)
Haha, you can't make a square with a number of elements equal to the product of 11 different primes (or any number of primes).
Re:Converting Pi to binary: Don't do it by sorbus on Friday August 06, 2010 @07:09PM (#1582598)
Given that it was a "square of specific dimensions," I just assumed that it was supposed to be a rectangle.
Re:Converting Pi to binary: Don't do it by ugh on Friday August 06, 2010 @08:28PM (#1582759)
It wouldn’t work. Say you are looking for a recipe for apple pie. You will be able to find a infinite number of recipes for apple pie, which do you pick? Not only that, there will be an infinite number of recipes with the headline ”Recipe for Apple Pie” which are, in fact, not recipes for apple pie.

Still not convinced that mining Pi for usable data would be a bad idea? How about this: You will be able to find those recipes not only once, you will find them several times. As ASCII encoded bytes, as PDF document, as DOC document, as JPEG, as iPhone and Android app (different versions for every version of iOS and Android that there will ever be). And you don’t have to stop there, you can just continue on. Just think of the millions of versions of the recipes with a few typos.

Re:Converting Pi to binary: Don't do it by rick_2047 on Saturday August 07, 2010 @01:13AM (#1583095)
Just introduce two things

1)A genius mathematicians.

2)A theorem to extract contextual information from Pi bits. It would give not only the info, but also work out the context.

Re:Converting Pi to binary: Don't do it by sliverstorm on Friday August 06, 2010 @05:38PM (#1582390)
Why not a lone computer hacker who discovers his own destiny written in pi? Or discovers the corruption of the evil government, or something along those lines?
Re:Converting Pi to binary: Don't do it by ugh on Friday August 06, 2010 @08:24PM (#1582746)
Or the infinite amount of strings that sound just like his destiny but are, in fact, not it?
Re:Converting Pi to binary: Don't do it by sliverstorm on Friday August 06, 2010 @08:32PM (#1582765)
I can't decide what would make a better thriller- decoding his actual destiny, or trying to figure out which one is the real destiny
Re:Converting Pi to binary: Don't do it by ugh on Friday August 06, 2010 @09:16PM (#1582837)
I don’t think that hacker has thought that through. Sure, he will find an infinite number of biographies which tell the story of his life up to the present with unbelievable accuracy, he, however, has no way of knowing which one of them actually predicts the future. The information just isn’t there. Oh, sure, among the infinite number of biographies there will be one which is correct, but it doesn’t come with a “authentic biography” meta tag (well, actually there will be a version that does, but so will the fakes).
Re:Converting Pi to binary: Don't do it by russell on Friday August 06, 2010 @04:11PM (#1582188)
Carl Sagan: Contact. Ellie found an 11 dimensional image of a circle.
Re:Converting Pi to binary: Don't do it by cgs1019 on Friday August 06, 2010 @03:58PM (#1582154)
Sagan does something like this in Contact (the book).
Re:Converting Pi to binary: Don't do it by valkyrja on Friday August 06, 2010 @04:17PM (#1582202)
You just ruined my evil plans to rule the world

Yes, the plans involved Pi.