Tuesday, March 14, 2023
Happy Pi Day, fellow nerds!
This is a holiday I’ve celebrated every year since at least 2010, and I’m not stopping anytime soon.
The celebrations have evolved.
It used to be just “bake a pie” and “haha pi, pie”.
Over time, I twisted it a bit (pizza is a pie of sorts! a cake with a pi symbol on it!).
This year is the next evolution.
I’ve made a cake with an experiment on it for estimating the value of pi.
This is a really cool technique called Buffon’s needle problem and I first heard about it from my grandfather at a restaurant.
I think I was in middle school.
Anyway, he was telling me about this way that you could estimate pi by tossing a needle on the floor and counting the number of times where it ended up crossing the line between floor boards.
I didn’t really get it then, but it stuck in my mind that it was really neat that you could do this thing to estimate the value of pi!
I understood it had something to do with the needle being able to form a circle (rotated around its center) and some such.
Fast forward to 2023, and I’m sitting idly thinking about Pi Day plans, and I realize.
I can make a cake.
I can draw lines on it.
I have sprinkles.
We can do Grandpa Bill’s pi needle estimate, but on a cake!
First, I have to figure out what is that even that he had told me about.
It was easy enough to find the Wikipedia page for Buffon’s needle problem.
The original formulation wasn’t around estimating the value of pi, but it sure can be used that way.
Basically, you have this formula: p = (2/pi) * (l/t)
, where:
p
is the probability that the needle will cross the line between two floor boardsl
is the length of the needlet
is the width of the floor boards
We can reformulate this as pi = (2/p) * (l/t)
, and then can derive an estimate of pi from an estimate of the probability that the needle crosses a floor board.
Or the probability that a sprinkle crosses a line on a cake.
You see where this is goi