Jump to content
IsaacAsimov

Methods of Estimating Pi

Recommended Posts

Area of Circumscribed (around a circle) n-gon = n/tan[(n-2)(180)/(2n)]

 

 

square:

Find: As, pi

Given: r=1, n=4

 

As=n/tan[(n-2)(180)/(2n)]=4/tan[(4-2)(180)/(2x4)]=4/tan[2(180)/8]=4/tan45 = 4

 

 

hexagon:

Find: Ah, pi

Given: r=1, n=6

 

Ah=6/tan[(6-2)(180)/(2X6)]=6/tan[(4)(180)/12]=6/tan60 = 3.464

 

 

decagon:

Find: Ad, pi

Given: r=1, n=10

 

Ad=10/tan[(10-2)(180)/(2x10)]=10/tan[8(180)/20]=10/tan72 = 3.249

 

 

hectagon:

Find: Ah

Given: r=1, n=100

 

Ah=100/tan[(100-2)(180)/(2x100)]=100/tan[98(180)/200]=100/tan88.2 = 3.14263

 

 

chiliagon:

Find: Ac

Given: n=1000

 

Ac=1000/tan[(1000-2)(180)/(2x1000)]=1000/tan[998(180)/2000]=1000/tan89.82 = 3.1416

 

 

megagon:

Find: Am

Given: n=1E6

 

Am=1E6/tan[(1E6-2)(180)/(2x1E6)]=1E6/tan[(999998)(180)/2E6]=1E6/tan89.99982 = 3.141592654 = pi

Edited by IsaacAsimov

Share this post


Link to post
Share on other sites

MacLaurin Series?

 

[math]\tan x = \sum_{n=0 }^{\infty} \frac{Bernouli_{2n}(-4)^n(1-4^n)}{(2n)!}x^{2n-1}[/math]

Share this post


Link to post
Share on other sites

3.141592654 = pi

 

A small nit, but the above isn't right. 3.141592654 is not equal to pi, but is a close approximation

 

3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 is the approximation to 100 digits, but it is not equal.

 

Nit picking? Yes. Correct and important to realize that the above are both just approximations? I say also, yes.

Share this post


Link to post
Share on other sites

Cool, but how do you calculate tan(x)?

 

Calculating tan(x) is easy - just use a calculator or a computer.

Share this post


Link to post
Share on other sites

Calculating tan(x) is easy - just use a calculator or a computer.

 

Why not cut out a step and use the calculator or computer to tell you pi? Surely the infinite series is the way to go in order to maintain the simple definition rather than use the blackbox of a calculator

Share this post


Link to post
Share on other sites

Why not cut out a step and use the calculator or computer to tell you pi? Surely the infinite series is the way to go in order to maintain the simple definition rather than use the blackbox of a calculator

 

The whole purpose of the exercise was to calculate pi using circumscribed polygons.

 

Using a calculator for the tan(x) function makes it a little easier.

 

I'm tired of getting negative feedback from you people!

Don't you think I deserve a little praise for my mathematical efforts?

Share this post


Link to post
Share on other sites

I'm tired of getting negative feedback from you people!

Don't you think I deserve a little praise for my mathematical efforts?

 

Easy there big fella. I don't think that there is a single thing in this thread that is negative. Just discussing things.

 

Maybe there hasn't been a great deal of 'huzzahs' simply because this isn't exactly brand new.

 

Consider the Dutchman Ludolph van Ceulen who spent most of his life computing pi based on a million million million sided polygon. He reported the value of pi to 35 digits based on that calculation in 1610. So, your calculation isn't exactly new. People have been doing it for literally hundreds of years now.

Share this post


Link to post
Share on other sites

Some interesting historical values for pi

 

The Rhind Papyrus (1650BC)

 

 

[math]{\left( {\frac{{16}}{9}} \right)^2} = 3.1604[/math]

 

The Bible

 

3

 

Archimedes (250BC)

 

 

[math]3\frac{{10}}{{71}} < \pi < 3\frac{{10}}{{70}}[/math]

 

 

Tsu Chung Chich (AD 450)

 

 

[math]\frac{{355}}{{113}} = 3.1415929[/math]

Edited by studiot

Share this post


Link to post
Share on other sites

Imatfaaal, could I trouble you to define the bit in your equation that says "Bernoulli" please?

Share this post


Link to post
Share on other sites

Imatfaal is using Bernoulli numbers and their connection to pi through series expansions.

 

http://mathworld.wol...ulliNumber.html

 

Other useful numbers are Euler's numbers and Stirlings formula

 

go well

 

Edit

 

In this case we have

 

The bernoulli numbers Bn are the coeffiecients of the series

 

 

[math]\frac{z}{{{e^z} - 1}} + \frac{z}{2} = \sum\limits_0^\infty {{B_{2m}}} \frac{{{z^{2m}}}}{{\left( {2m} \right)!}}[/math]

 

for even indices, with B1 = -1/2 and with all other odd terms zero.

 

This evaluates even values of the zeta function

 

 

[math]\zeta (2m) = {\left( { - 1} \right)^{m + 1}}{B_{2m}}\frac{{{{\left( {2\pi } \right)}^{2m}}}}{{2.\left( {2m} \right)!}}[/math]

 

leading to

 

 

[math]\zeta (6) = \frac{{{\pi ^6}}}{{945}}[/math]

Edited by studiot

Share this post


Link to post
Share on other sites

JC - I wasn't quite sure what the accepted short form for the Bernoulli Numbers (or more accurately the even-index - ie non-zero - Bernoullis) was - so I put it in full as Studiot correctly explained. The accepted form is B2m for the even-index

 

I was just reading up the Wikipage on them and read the following trivia that is pretty cool

 

Ada Lovelace's note G on the analytical engine from 1842 describes an algorithm for generating Bernoulli numbers with Babbage's machine.[3] As a result, the Bernoulli numbers have the distinction of being the subject of the first computer program.

 

The wikipage has some good stuff - both the various definitions and some interesting commentary

http://en.wikipedia.org/wiki/Bernoulli_number

Share this post


Link to post
Share on other sites

This is something I got out of Freshman Calculus, p. 255

 

An=delta x(f(x0)+f(x1)+f(xn-1))

Let delta x=(b-a)/n, x0=a, x1=a+delta x, xk=a+k delta x for k=1,2,...,n

 

I will be using the formula for a circle, x2+y2=1, or y=sqrt(1-x2), evaluated between 0 and 1, so it will be a quarter of a circle.

Let a=0, b=1, n=10

delta x = (b-a)/n=(1-0)/10=1/10=0.1

x0=a=0, x1=a+delta x=0+0.1=0.1, x2=a+k delta x=0+2(0.1)=0.2,...

 

Using a calculator:

An=0.1(f(0)+f(1)+f(2)+...+f(9))

=0.1(sqrt(1-02)+sqrt(1-0.12)+sqrt(1-0.22)+sqrt(1-0.32)+sqrt(1-0.42)+sqrt(1-0.52)+sqrt(1-0.62)+sqrt(1-0.72)+sqrt(1-0.82)+sqrt(1-0.92))

=0.1(1+0.99499+0.9798+0.95394+0.9165+0.8660+0.8+0.71414+0.6+0.43589)

=0.1(8.26126)

=0.826126

x4 = 3.30

which is close to pi, but not very close

Share this post


Link to post
Share on other sites

So, rather than summing an infinite series to get pi , you sum an infinite series to get e

then plug that into the infinite series to get the Bernoulli number,

then you use that to calculate another infinite series to get tan(x).

It seems a lot of trouble to go to.

Share this post


Link to post
Share on other sites

The whole OP struck me as deliberately difficult - so I saw no reason not to pile on the complexity.

Share this post


Link to post
Share on other sites

Another fun formula (due to Wallis) is

 

 

[math]\mathop {\lim }\limits_{m \to \infty } \frac{{2.4.6.8.\left( {2m - 2} \right)}}{{3.5.7.9.\left( {2m - 1} \right)}}\sqrt {2m} = \sqrt {\frac{\pi }{2}} [/math]

Share this post


Link to post
Share on other sites

which is close to pi, but not very close

 

Sure. The more rectangles you use, the better. Also, you can use trapezoids, and polynomials, and .... lots of choices. Numerical integration is still an active area of research to maximize accuracy with the minimum number of function evaluations. If you can save even a few % over the current methods, you will get significant attention, considering how many function calls those large supercomputers do every second.

Edited by Bignose

Share this post


Link to post
Share on other sites

Another fun formula (due to Wallis) is

 

 

[math]\mathop {\lim }\limits_{m \to \infty } \frac{{2.4.6.8.\left( {2m - 2} \right)}}{{3.5.7.9.\left( {2m - 1} \right)}}\sqrt {2m} = \sqrt {\frac{\pi }{2}} [/math]

 

That is an interesting formula.

 

I'm trying to figure out how to insert special scientific symbols such as square root, right arrow, infinity symbol, etc.

 

I can see the notation you used in your post, but it looks sort of like a programming language, and I'm not familiar with that language.

Is there a list of commands that I could get so I could type up a post using that notation?

 

Marlon S.

Share this post


Link to post
Share on other sites

Hi Marlon

 

It's called Latex - there is a tutorial here.

http://www.scienceforums.net/topic/3751-quick-latex-tutorial/

 

Best way to learn is to click on someone else post and you will see the code you need to use.

 

you need to surround the formula with the tags [math] formula here [/math]

 

There are also loads of sites on the web that will help

Share this post


Link to post
Share on other sites

Hello Marlon,

 

Yes it is written in LaTex, I think.

 

From my point of view I use a (paid for) program called MathType which allows direct typing of mathematical formulae.

 

I then copy and paste into the reply window and the program does the rest.

 

When I started here a couple of weeks ago it didn't work and I had to change the tags from [tex] to [math] manually but something has been tweaked and it now happens automatically.

 

This procedure works with many forums.

 

Unfortunately similar actions in MathCad or Microsoft Equation editor do not have the desired effect.

Share this post


Link to post
Share on other sites

Here is a sneaky method of estimating pi:

 

Draw a circle, with a radius of 1, let a be a small angle, and let x be the opposite side inscribed in the circle.

 

sin a = x, and pi is approximately (360 sin a)/(2a), or pi=(180 sin a)/a, as a gets small. Angle a is measured in degrees.

 

Try the formula on a few values of a, using a calculator:

 

a............................pi

.01.........................3.14154029392740

.0001......................3.14159264835381

.000001...................3.14159265358927

 

Question: Why is the formula so accurate?

 

Answer: My calculator converts the angle to radians, then uses several terms of an infinite series to estimate the sin. Here is the equation in radians:

 

pi=(pi sin a)/a. We are using pi to estimate pi. Pi=3.14159265358979 is hard coded into my calculator.

 

We are using pi with 15 digits of accuracy to estimate pi to 13 digits of accuracy.

 

At least it works!

Share this post


Link to post
Share on other sites

sin x = x - (x^3)/6 + (x^5)/120 - ....

 

 

You see that for the values of a you were using the error term for sina = a gets very small.

Share this post


Link to post
Share on other sites

I have tried to use integrals to compute pi:<br><br>[math]\mathop A(n) \rightarrow{\int_a^b} f(x) dx[/math] as [math] n\mathop\rightarrow \infty[/math]<br>[math] = 2{\int\limits_{-1}^{1}}\sqrt{1-x^2}dx[/math]<br>From p. 209 of Freshman Calculus:<br><br>[math]\mathop{\int}\sqrt{a^2-x^2}dx = \frac{a^2}{2}\arcsin{\frac{x}{a}}+\frac{x}{2}\sqrt{a^2-x^2}+C [/math]<br>a=1: [math]=\frac{1}{2}\arcsin{x}+\frac{x}{2}\sqrt{1-x^2}[/math]<br>[math] = \left. 2 \bigg(\right|_{-1}^{1}\bigg) \frac{1}{2}\arcsin x + \frac{x}{2}\sqrt{1-x^2}[/math]<br>[math] = 2 \bigg[\bigg(\frac{1}{2}\arcsin1+\frac{1}{2}\sqrt{1-1}\bigg)-\bigg(\frac{1}{2}\arcsin-1-\frac{1}{2}\sqrt{1-1}\bigg)\bigg] [/math]<br>[math] = 2 [((\frac{1}{2})(\frac{\pi}{2})+\frac{1}{2}(0))-((\frac{1}{2})(\frac{-\pi}{2})-(\frac{1}{2})(0))] [/math]<br><br>

Edited by IsaacAsimov

Share this post


Link to post
Share on other sites
I have tried to use integrals to compute pi:

 

 

So what happened?

 

I remember reading a short story by your best friend Arthur C Clark.

 

The story was about a monastery in Tibet where the monks had been working for thousands of years to enumerate all the names of God.

 

Then they bought a computer and it was able to complete the task in hours.

 

Then......

 

But that would be telling!

 

Are you trying for the same thing with pi?

Edited by studiot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.