Approximating pi using IP addresses

Your IP is 38.103.63.62. Therefore the vector made by your IP is (-0.701, -0.191, -0.505, -0.513)

The absolute value of that vector is > 1. Which means that your IP is not "within" the hypersphere.

2967 people have visited this page. Of them 864 has had an IP adress whose vector has a absolute value <=1. Thus PI can be approximated to:
3.05262240359469

How does it work?

The "volume" of a 4-dimensional sphere with radius 1 is (pi)^2/2. In 4-dimensional space this hypersphere is contained into the hypercube ranging from (-1,-1,-1,-1) to (1,1,1,1).

The four parts of the ip adress is each translated into a number between -1 to 1 with the formula x=(y-127.5)/127.5. So now the IP is actually a point in the hypercube mentioned above.

To see whether a point is within the hypersphere is easy. Its only to check the absolute value of the vector, and see if it is <= 1.

Of the "volume" (which is 16) of the hypercube, (pi)^2/32 is covered by the sphere. Thus a random point selected into the cube has a chance of (pi)^2/32 to lie into the sphere. Therefore, if there has been a visitors, and b of them lying inside the hypersphere, b/a=pi^2/32, or pi=sqrt(32*b/a). And that's it!

another approximation made from IP adresses which is a lot better: 3.19092388982145. I will be adding more information about that later.

Erik Bernhardsson