# Guided Approach to Approximating π

\begin{align*} &
f(x) = \dfrac{1}{1+x^2}
\end{align*}

Integrating with respect to x from 0 to 1 yields 0.25π. What makes this a guided approach is that this integration range can be easily approximated with Riemann Sums. Specifically looking at the Left compared to Right Endpoint Rule we can easily create an error range. Here's the values of x and f(x) if we have 4 equal sub-divisions:

As you'll notice the only difference is whether or not to use the first or last value in the estimation. This generalizes in all cases and creates our error range: the absolute value of the first minus the last term given its relation to the number of sub-divisions.

\begin{align*} &
L > \dfrac{\pi}{4} > R \\& \\&
f(x_1) + ... + f(x_{n-1}) > n\dfrac{\pi}{4} > f(x_2) + … + f(x_n) \\& \\&
f(x_1) - f(x_n) > n\dfrac{\pi}{4} - \left[ f(x_2) + … + f(x_{n}) \right] > 0 \\& \\&
\therefore Error = \dfrac{4 \left[ f(x_1) - f(x_n) \right]}{n} = \dfrac{2}{n} \\& \\&
\therefore \dfrac{2}{n} = (10)^{-k} \Longrightarrow n=2(10)^k
\end{align*}

So now the question is to what digit accuracy do you want (the k value I just used). NASA uses 15, so for them we'd need to conduct 2 quadrillion sub-divisions. However, this is an easy task for modern computer and especially nothing for super or the new quantum computers.

This site uses Akismet to reduce spam. Learn how your comment data is processed.