We celebrate Pi day with a poem. Why, you ask? Because it puts the  PI in PoetIc, and that is your clue. Scroll to the end of the poem if you’d like the answer.

Poe, E. Near a Raven Midnights so dreary, tired and weary.      Silently pondering volumes extolling all by-now obsolete lore.  During my rather long nap – the weirdest tap!      An ominous vibrating sound disturbing my chamber’s antedoor.          “This”, I whispered quietly, “I ignore”.   Perfectly, the intellect remembers: the ghostly fires, a glittering ember.      Inflamed by lightning’s outbursts, windows

Today, we take a quick look at two methods for computing pi using your humble PC. These two methods are infinite sums, meaning that the value of the sum approaches pi as you increase the number of terms added. Here they are. 

1. Ramanujan’s Formula

2. Plouffe’s spigot formula To save you the calculator work, you can use the following python code to execute both calculations. I have listed the results for 10 iterations of each formula below. from __future__ import division import numpy as np import random import math np.set_printoptions(precision=15) def pi_plouffe(n): return np.cumsum([x for x in[(4./(8.*k+1.) -2./(8.*k+4.)

When I was young, I thought I could derive the value of pi as follows. Imagine a badly drawn hexagon as below. Every hexagon is the combination of 12 right angled triangles like the one shown in red. 

The following is known from trigonometry. If we extrapolate from a hexagon to a polygon of N sides, we get the following. Note that 2Nx/2r is the ratio of the hexagon’s perimeter to its ‘radius’. As N approaches infinity, the polygon approaches a circle and the value of 2Nx/2r should approach pi.

Using the same principle, you can also easily derive

I saw this in the supermarket the other day. Could this be an unintended reference to the co-inventor of calculus, now inadvertently immortalized as a biscuit brand? 

Apparently, this is not an error. Leibniz biscuits are indeed named after Gottfried Leibniz by the Bahlsen confectionery company which makes them!

A full FAQ on the subject is available on the Bahlsen website. Here’s some pertinent information translated straight from the german FAQ.

1) Company founder Hermann Bahlsen created “Leibniz Cakes” in 1891, naming it after one of the most famous inhabitants of Hanover, Gottfried Wilhelm

An adventurer has been bitten by a poisonous creature and has sought refuge in a shack. The adventurer is too weak to move from the shack and will die unless an anti-toxoid is administered. Luckily for the adventurer, the shack seems to be someone’s old abandoned home lab. One of the vials in the lab is precisely the quantity of anti-toxoid that the adventurer needs. Unfortunately, the anti-toxoid is dissolved together with a chemical preservative which the adventurer is highly allergic to. This preservative will kill the adventurer unless its levels are reduced by at least 150 times.

Besides 5