Showing posts with label pi. Show all posts
Showing posts with label pi. Show all posts

Thursday, January 29, 2009

Waldo's Been Found In The PI

Hey There,

Last Friday, we posted a little puzzle we made up entitled "Where's Waldo?" where the objective was to find Waldo amongst the first million digits to the right side of the decimal point in the irrational number PI. Apologies for the picture as my editor couldn't deal with the length of the line and insisted on chopping it up into bits. The numbers were in order, so all that was necessary to get the entire string without spaces was doing simple deletion of all the space characters.

Of course, there was only supposed to be one answer, but, if you're among the many who found Waldo all over the place, I guess we can count that, too. Although I wasn't specific, I assumed a knowledge of Waldo that wasn't shared by everyone (He's a goofy bastard that likes to hide in large crowds of people wearing a silly hat ;) No matter. For instance, many folks posited that any number could represent Waldo (just as a picture - a singular thing - of a cat could represent the three letters C, A and T). This is logically valid, and those of you who took that position are probably still laid out by Waldo-overload ;)

Also (closer to our solution) it was suggested that any 5 consecutive-and-unique numbers could represent Waldo. This is also true.

However, and this is why we put the puzzle up (because we figured this out by accident and it seemed kind of cool) there is a way to determine the "ONE" Waldo that's hiding in those million digits.

WARNING: If any of the above put you off and you want to go find the "ONE" Waldo on your own, please stop reading now, because this post will ruin it for you ;)

Here's how we found the "ONE" Waldo:

a. First, we tried the really simple stuff that was guaranteed to fail, but tested just to make sure that it did, anyway. And, we're happy to report that it all did :)

For instance(s):
i. Waldo, in binary, with a capital W (0101011101100001011011000110010001101111) and a lowercase w (0111011101100001011011000110010001101111) doesn't show up anywhere in the sequence.

ii. Waldo, in decimal converted from binary, with a capital W (8797108100111) and a lowercase w (11997108100111) doesn't show up either.

iii. Waldo, in simple a=1, b=2, etc, code (where case doesn't matter and both Waldo's are 23112416) doesn't exist within the million digits either. I actually thought that one might be there.

b. Then we went for the answer that ended up exposing where the "ONE" Waldo was. To tell you the truth, we didn't expect to find him, so this spur-of-the-moment puzzle was probably just as much fun (or just as irritating) for us as it was for you ;)

i. As above, the assumption was that Waldo had to belong to a group of 5 digits that included no duplicates, since there are no duplicate letters in Waldo's name.

ii. In order to find all of these possible combinations within the million digits we employed an expanded routine based on a previous post we did on finding overlapping matches using Perl lookahead assertions to run through all 5-digit combinations in the million numbers, looping through those to find all the ones that only appeared once in the million-digit chain and then, from that subset, only keeping those that didn't contain any duplicate digits (I put all the digits into a one line file called "pi"), resulting in the following suspects (The command line's ugly... I know ;)

host # perl -e 'open(PI, "<pi");$variable = <PI>; @variable = $variable =~ /\d(?=(\d\d\d\d\d))/g;for $var (@variable) {$matches{$var}++;};while (($key,$value) = each %matches) { if ( $value == 1 ) { $key =~ tr/0-9/0-9/s;if ( length($key) == 5 ) {print "$key => $value\n"} } };'
27315 => 1
04937 => 1
75138 => 1
92758 => 1
87329 => 1
76923 => 1
04504 => 1
69768 => 1
67482 => 1
40212 => 1
10686 => 1
35052 => 1
15320 => 1
95485 => 1
50134 => 1
74839 => 1
91867 => 1
72382 => 1
31640 => 1
75205 => 1
97823 => 1
63502 => 1
29090 => 1
23291 => 1
85476 => 1
26323 => 1
32013 => 1
01456 => 1
94357 => 1
96874 => 1
63160 => 1
91493 => 1
53268 => 1
91926 => 1
57521 => 1
36748 => 1
09074 => 1
81764 => 1


iii. Then, to find the "ONE" Waldo, we just augmented the previous Perl command line program to ensure that it met the following simple specifications: Based on simple case-insensitive alphabet-numeral code (a=1 .. z=26), the numbers had to appear in an order that would satisfy the name "Waldo" (e.g. W had to be greater than a, l, d and o, etc), which broke down to this simple table (actually listed above as one of the numeral sequences that couldn't be found... of course, it changes after we're done here, since we're applying the relative weight of each letter, rather than assigning each a specific numeric value):

W a l d o = 23 1 12 4 16


using this template, the "ONE" number from the list above would have to satisfy the relative-weight differences between all 5 letters/numerals

Name: W a l d o
Pos: 0 1 2 3 4
Weight: 23 1 12 4 16


in short, in the "ONE" correct 5-digit string, in subsequent order, the first digit would have to be greater than the fifth, which would have to be greater than the third, which would have to be greater than the forth, which would have to be greater than the second.

If you'll pardon the monstrous code, the command line Perl used to find "Waldo" follows:

host # perl -e 'open(PI, "<pi");$variable = <PI>; @variable = $variable =~ /\d(?=(\d\d\d\d\d))/g;for $var (@variable) {$matches{$var}++;};while (($key,$value) = each %matches) { if ( $value == 1 ) { $key =~ tr/0-9/0-9/s; @key = split(//, $key);if ( length($key) == 5 && ( $key[0] > $key[4] ) && ( $key[4] > $key[2] ) && ( $key[2] > $key[3] ) && ( $key[3] > $key[1] )) {print "$key => $value\n"} } };'
92758 => 1


leaving us with our answer: 92758. Below are the original list of million digits and the same list with "Waldo" in bold red font (hyperlinked to an offsite location for the actual million digit lists through pictures of parts of them).

Hope you enjoyed the challenge. Everyone who gave this some thought won, even if they didn't reach the same conclusion as we did :) And if you did find another way to reach "one" conclusion, please email us and let us know. We'd love to post the alternative answer!

Cheers,


Where's Waldo?


Where Is Waldo?


There's Waldo!


There Is Waldo!

, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Friday, January 23, 2009

A Unix/Linux "Where's Waldo?" Or "Who Wants Some PI?"

Hey there,

I thought I'd finish off this miserable week (lots of work; little sleep) with a puzzle for everyone, like we do from time to time, if you ever want to check out older posts on seemingly random numbers and the M I U puzzle. There are even more that you can find by just searching the index of the blog.

Today, I'm leaching off a somewhat-familiar challenge: Where's Waldo? Except, in this version he's hiding somewhere in the first million numbers to the right of the decimal point of PI. Finding him will require some really simple conversion, but I have checked to verify that he is, in fact, in there (in more ways than one, depending on how you decide to do your translation of integers to... what have you? :)

Hope you guys have fun with this. I'll post my answers (and their respective rationales) in a near-future post. I've left off the leading 3, since it throws off the nice pretty columns.

CLUE/SPOILER-ALERT: In this version, Waldo is not wearing his trademark hat!!! ;)

Enjoy, and have some PI - Click the picture below to be taken to my offsite page that contains the the million digits. It won't work in Blogspot and it would probably destroy the RSS feed, anyway ;)

Cheers,

who wants more pi?

, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Saturday, September 27, 2008

Converting PI To Binary - More Linux/Unix Humor

Hey there,

Another week has come and gone and it's Saturday again; just like last week. Lather, rinse, repeat ;)

This week's bit of Linux/Unix humour comes from deep within the pages at keithlynch.net. I'd highly recommend you go check it out. It's a very simple page (as in "no flashy graphics") but, once you get through half of his life story, I think you'll find that it's amazing he has a sense of humour left. Seriously; check out his page. He's been through the ringer. Nevertheless, he is also responsible for some pretty funny stuff. Check out the April Fool's section, for the bulk of the jokes on the site. All in all, it's a pretty interesting read. Partly serious, with some levity thrown in for good measure.

Below, I've reprinted one of my favorites that he's written. Since Pi, it's widely believed but not absolutely provable, never repeats itself on the right side of the decimal (although, another piece of Rye Humor (Rye spelled incorrectly on purpose ;) contests that it does repeat at the hyper-thousandth level), the joke below may not be all that far from the truth :)

So I leave you with this pun, that both begs to be written and, at the same time, put out of its misery: You can't have your Pi and eat it 10. <-- 10 is binary 2, like too... Man, that's a groaner. Almost as bad as "There are 10 kind of people in the world. Those that get binary and those that don't." Had to include it for completeness' sake. Sorry. Eat lots of charcoal to get the taste out of your mouth ;)

Enjoy, and have a great Saturday!



Converting pi to binary: Don't do it!



by Keith F. Lynch <kfl@keithlynch.net>



Warning: Do not calculate Pi in binary. It is conjectured that this number is normal, meaning that
it contains all finite bit strings.



If you compute it, you will be guilty of:





  • Copyright infringement (of all books, all short stories, all newspapers, all magazines, all web
    sites, all music, all movies, and all software, including the complete Windows source code)



  • Trademark infringement



  • Possession of child pornography



  • Espionage (unauthorized possession of top secret information)



  • Possession of DVD-cracking software



  • Possession of threats to the President



  • Possession of everyone's SSN, everyone's credit card numbers, everyone's PIN numbers, everyone's
    unlisted phone numbers, and everyone's passwords



  • Defaming Islam. Not technically illegal, but you'll have to go into hiding along with Salman
    Rushdie.



  • Defaming Scientology. Which is illegal -- just ask Keith Henson.





Also, your computer will contain all of the nastiest known computer viruses. In fact, all of the
nastiest possible computer viruses.



Some of the files on my PC are intensely personal, and I for one don't want you snooping through a
copy of them.



You might get away with computing just a few digits, but why risk it? There's no telling how far
into Pi you can go without finding the secret documents about the JFK assassination, a photograph of
your neighbor's six year old daughter doing the nasty with the family dog, or a complete copy of the
not-yet-released Pearl Harbor movie. So just don't do it.



The same warning applies to e, the square root of 2, Euler's constant, Phi, the cosine of any non-
zero algebraic number, and the vast majority of all other real numbers.



There's a reason why these numbers are always computed and shown in decimal, after all.




Keith F. Lynch - kfl@keithlynch.net - http://keithlynch.net/
I always welcome replies to my e-mail, postings, and web pages, but
unsolicited bulk e-mail sent to thousands of randomly collected
addresses is not acceptable, and I do complain to the spammer's ISP.



, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.