Physics Forums

## From what I understand, there s some sort of computer calculating pi...

... and for a long time, I took this for granted, but now I'm starting to wonder how it is doing this. From my knowledge, the only way one could calculate pi is to measure the diameter and radius of a circle, and find the ratio, but to calculate an irrational decimal as thoroughly as we have would require an unrealistically accurate measurement. There may be some sort of equation that can be used to calculate pi, but I have no idea what it is.

So, how are mathematicians managing to calculate pi?

You mean arclength right?   Other ways to calculate pi is to use infinite series that we know converge to pi. One example, though not the best, is the arctan(1) series. Also called leibniz series.  Edit: You may understand this provided you have taken at least calculus 2 or learned it prior.

But from what I understand, pi is needed in order to calculate arctan...   I may be wrong.  I really don't know much about this.

Recognitions:
Gold Member

## From what I understand, there s some sort of computer calculating pi...

Not quite.

There are lots of nice formulas for calculating pi, most of them fall under the category of infinite series, meaning there are ways to represent pi as the sum of an infinite amount of numbers (with each successive number being added becoming smaller so it approaches pi as the amount of numbers in the series you add up goes to infinity - something mathematicians call convergence).

This is one of many ways to calculate pi:
http://en.wikipedia.org/wiki/Leibniz_formula_for_π
(This is actually not a very efficient method, but it looks nice :)

All a computer does is, using formulas like these, add up millions and billions of fractions to get more and more accurate values.

Recognitions:      Homework  Help  I like $$\frac{1}{\pi}=\frac{2\sqrt{2}}{9801} \sum_{n=0}^\infty \frac{(4n)!}{(n!)^4} \cdot \frac{1103+26390n}{396^{4n}}$$  but there are many ways see http://mathworld.wolfram.com/PiFormulas.html http://www.numberworld.org/misc_runs/pi-5t/details.html http://en.wikipedia.org/wiki/Pi http://en.wikipedia.org/wiki/Machin-like_formula http://mathworld.wolfram.com/Machin-LikeFormulas.html  for Arctan use a series for Arctan and pi/4=Actan(1) along with a Machin-like formula such as Arctan(1)=4Arctan(1/5)-Arctan(1/239) to speed things up

Special mention goes to the BBP formula, which allows one to calculate the nth hexadecimal digit of ∏ without calculating the first (n-1)th digits.

Recognitions:
Homework Help

Quote by lurflurf 					 				 				Arctan(1)=4Arctan(1/5)-Arctan(1/239)
Note arctan(1) = π/4

another formula, note that dividing by (1/8)^2 can be done with a right shift of 6 bits:

arctan(1) = 6 arctan(1/8) + 2 arctan(1/57) + arctan(1/239)

a bunch of arctan formulas here:

http://www.jjj.de/arctan/arctanpage.html

Programs like pifast:

pifast.html

and the pi demo program for apfloat:

http://apfloat.org

use highly optimized extended precision math and normally use the Chudnovsky formula mentioned on the wiki page linked to above (other methods are offered as options). Since division is relatively slow. it's my understanding that the denominator is generated by multiplication into a huge number then only a single division is done, usually by inverting the denominator and multiplying.

All of this is way beyond anything practical in terms of physics, other than sub-sets of a large value for pi or e could be used for random numbers.

Thread Tools

|                                                                                              |                                              |         |
|----------------------------------------------------------------------------------------------|----------------------------------------------|---------|
| Similar Threads for: From what I understand, there s some sort of computer calculating pi... |                                              |         |
| Thread                                                                                       | Forum                                        | Replies |
|                                                                                              | Academic Guidance                            | 4       |
|                                                                                              | Introductory Physics Homework                | 2       |
|                                                                                              | Engineering, Comp Sci, & Technology Homework | 1       |
|                                                                                              | Academic Guidance                            | 3       |
|                                                                                              | Quantum Physics                              | 2       |
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9035828709602356, "perplexity_flag": "middle"}