News Pi 600 400
2.1 min read

Monte Carlo Method and Pi Approximation Day

Monte Carlo Method and Pi Approximation Day

Pi (π) is probably one of the most recognizable and relevant constants in mathematics. Defined as the ratio between the perimeter of a circle and its diameter, its importance both in geometry and in other fields such as physics, architecture, or engineering is such that, since ancient times, we humans have sought methods to calculate its value, even in an approximate way. It’s not surprising that people decided to celebrate 22/07 as Pi’s approximation day.

As time passed, we have progressed from very crude approximations (such as the Babylonians’ π ≈ 3, which also appears in the Bible) to extraordinarily powerful formulas, such as those proposed by Ramanujan, whose methods, when combined with today’s computers, allow us to know the first 50000000000000 digits of π. Along the way, we have come across useful approximations such as Archimedes’ π ≈ 22/7, which gives rise to this day’s celebration, or Ptolemy’s π ≈ 377/120. We have even seen attempts to legislate the real value of Pi as one of these approximations, as π ≈ 16/5!

We at Quside, as random number lovers, enjoy using another method to calculate π: we warmly call it “The Pepperoni π-zza method”, although some will recognize it better by its regular name: the Monte Carlo method. ?

To calculate π using this method, we take a pizza in a box and start throwing pepperoni slices randomly into the box: the more we throw, the better (the more accurate the calculation and the better the pizza will taste). When we get enough, we count how many slices have fallen on top of the pizza: if we have done it right, the ratio between the number of pepperoni slices on the pizza and the total number of slices used is close to π/4.

The more slices we throw, the closer we get to the real value of Pi: here are some examples of how we get closer and closer the more slices of pepperoni we put on the pizza.

pepperoni sketch pizza

Pizza 1: π ≈ 12/15 x 4 = 3,2
Pizza 2: π ≈ 25/32 x 4 = 3,125

Using a Monte Carlo method to calculate an ultra-precise value of π is rare anyway. However, these tools are widely applied today in countless areas: logistics, finance, insurance, medicine, physics, engineering, … in all of them, a fast and reliable source of pepperoni random numbers, such as the ones we manufacture and sell at Quside, is essential to solving the problems that their users must deal with every single day.

Get to know Quside’s QRNG now, and, in between simulations, you can enjoy Pi’s approximation day by making a nice pizza “à la Monte Carlo”.

José Ramon Martínez

Carlos Abellan

Co-founder & CEO

PhD in quantum technologies at ICFO, where he developed the quantum randomness technologies that were transferred to Quside. 10 years of experience in quantum and photonics technologies, co-inventor of multiple patent families and co-author of 15+ papers in top scientific journals. Received the award MIT Innovators Under 35 Europe.

Want to hear more about the quantum side?

Can quantum random number generators improve computational results?

A research collaboration between Quside, ICFO, and others, has shown how using quantum random number generators provide the required quality and efficiency for safely running even the most complex stochastic simulations.

Quantum random numbers for physics-inspired optimization problems

Making decisions is commonly a challenge due to the uncertainty and overwhelming information needed to deal with a problem: from every engineering design, data analysis or most business decisions to...

Cyber Attacks and Ransomware: What You Need To Know

Cybercriminals don’t take vacations and the list of cyber attacks and ransomware keeps increasing throughout the year.