A couple of weeks ago, it was 3/14, National PI day. (See the nonbinding resolution of the US House of Representatives HRES 224)
I created this wonderful reflective picture, something that Scott Kim would be proud of, and intended to use it as part of my Pi Day blog posting. I then downloaded the first billion digits of Pi and fully intended to do lots of juicy and whimsical datamining on those digits. The problem is, I couldn’t come up with a unique idea! 
Find your birthday in Pi page — Done (many times)
Find your social security number in Pi Page — Done (ditto)
Frequency analysis of the of the digits, couplets, ngrams in Pi — Done, Done, Done
If you can think of something to search for in Pi, Google it, and I’ll wager that somebody has probably already done it.
Pi has been calculated to so many digits (over 5 Trillion at the time I’m writing this)*, that if you search hard enough you and pretty much find anything you want in there. Conspiracy fanatics can stop reading now, I’m not going to excite you by showing how you can find details of all the past natural disasters buried in the digits (you can), or birth dates of all the US Presidents. If this disappoints you, might I suggest an evening enjoying a cocktail with Pink Floyd and The Wizard of Oz, or reading The Bible Code? What I’m going to do for my (belated) tribute to Pi day is to draw pictures of Pi, and search these pictures for a graphical representation of Pi inside of itself. Hey, why not? 

First of all, we want a target of what we’re looking for. Here it is. It’s a (7x5) bitmap of the symbol for Pi (the 16th letter in the Greek alphabet). I purposely selected this bitmap to have whitespace all around the edges so that it would be easy to see. 
Next we need to covert Pi into a bitmap. Using a simple translation on the decimal representation of Pi , I converted the digits to pixels with the key that the digits 04 are shaded white, and the digits 59 black. This produced a random strip of shaded pixels.
To convert this into a canvas, I stacked these strips into rows with 23 columns of digits per row to make a tall bitmap. Here are the first few rows of this bitmap. (If you look at the first row, you should be able to recognize the strip image above).
A couple of regular expression searches later, at position 345,385,381 we’ve found what we’re looking for. Look closely – we've found Pi inside Pi.
Is this amazing? No not really. When you have a billion random pixels, it’s pretty easy to find whatever you want! I could just as easily have searched for Pacman logos, or checkerboards instead of a Pi bitmap.
And why did I make the rows 23 characters wide (instead of 40, or 75)? No reason, and that’s just the point. I could have, just as easily, made the rows 31 columns wide, and then Pi appears at position 250,634,381 (see below).
You can find a pattern in anything if you stare at it long enough.
You can find a complete list of all the articles here.^{} Click here to receive email alerts on new articles.