Thread: [SOLVED] How to calculate PI

1. [SOLVED] How to calculate PI

Hi Every bdy

please how to PI that equal 3.14

2. Originally Posted by Magician
Hi Every bdy

please how to PI that equal 3.14
Are you asking how to find $\displaystyle \pi$?

3. Originally Posted by Magician
Hi Every bdy

please how to PI that equal 3.14

RonL

4. CaptainBlank post is not ideal because it is speaking how to find a fraction.
---

The way mathematicians did it is by an infinite series of an integral.
If you are familar with some Calculus, the curve $\displaystyle \sqrt{r^2-x^2}$ is a circle with radius $\displaystyle r$. So the area below it is,
$\displaystyle \int_{-r}^r \sqrt{r^2-x^2}dx=\pi r^2$
Setting $\displaystyle r=2$ and some manipulation,
$\displaystyle \int_0^2 \sqrt{4-x^2}=\pi$
You can calculate the integral on the top by means of an approximation and you have a value of $\displaystyle \pi$.

Another was is to use an infinite series,
$\displaystyle \frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+...$
But this series discovered by Leiniz converges too slowly, that means it does approach the value of $\displaystyle \pi$ but way too slow.

A quicker one I can imagine was proven by Euler, the Basel problem,
$\displaystyle 1+\frac{1}{2^2}+\frac{1}{3^2}+...=\frac{\pi^2}{6}$

But one of the most quickest converging series came from Ramanjuan, it is not as elegant looking as the ones above but it is far more efficient. I think each term add about 10 decimal places. So maybe this is the one that is programed into a computer to find decimal places.

5. Originally Posted by ThePerfectHacker
CaptainBlank post is not ideal because it is speaking how to find a fraction.
---

The way mathematicians did it is by an infinite series of an integral.
If you are familar with some Calculus, the curve $\displaystyle \sqrt{r^2-x^2}$ is a circle with radius $\displaystyle r$. So the area below it is,
$\displaystyle \int_{-r}^r \sqrt{r^2-x^2}dx=\pi r^2$
Except that it give the area of a semi-circle, you mean something like:

$\displaystyle \int_{0}^r \sqrt{r^2-x^2}dx=\pi r^2/4$

but this is of no use if you don't know calculus.

Code:
This is EULER, Version 2.3 RL-06.
Type help(Return) for help.
Enter command: (20971520 Bytes free.)
Processing configuration file.
Done.
>dx=0.01
0.01
>x=dx/2:dx:1;
>
>y=sqrt(1^2-x^2);
>
>Pi=sum(y)*dx*4
3.14194
>
RonL

6. you can also calculate PI using the Monte Carlo simulation method and the Buffon niddle problem.

7. here is another thread discussing different methods of calculating $\displaystyle \pi$.