Happy Pi Day!! In this Coding Challenge, I use the "monte Carlo" method to approximate the value of Pi in Processing (Java).
Saturday -- March 14, 2015, or 3/14/15 -- marks an extremely nerdy holiday. It is the official celebration of π, the magical, mathematical and infinite constant that is the ratio of a circle’s circumference to its diameter.
For any circle you can imagine, if you divide the distance around the circle by the distance across it, you will get pi, or 3.1415926535897932384626433832795028841971693993751058209749
445923078164062862089986280348253421170679821480865132823066
470938446095505822317253594081284811174502841027019385…
We could keep going, but you get the picture.
Some people will celebrate the holiday by making and eating pies (Washington restaurants are offering specials on everything from pizza to banana cream). Others will run a Pi-K race of 3.14 kilometers. And some data tinkerers are making art that visualize pi’s infinite and random digits.
One of the best known of these data tinkerers is Martin Krzywinski, a scientist who specializes in bioinformatics, or using computer science and statistics to understand biological data. Krzywinski started publishing his pi art in 2013, beginning with this visualization:
Each digit of pi is represented by a dot of a different color: 3 is orange, 1 is red, 4 is yellow, and so on. Krzywinski then folded these colored dots, each of which represents a different digit ("1" or "4"), into a spiral. Going from the center of the circle outward, here is the first 13,689 digits of pi:
So what is the point of all this? Mostly, the works are meant to be beautiful and fun to look at. But beyond that, Krzywinski says the art is meant to awaken emotions about math (hopefully emotions other than dislike and confusion) and start conversations about numbers and randomness.