Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating Pi?

  1. Feb 19, 2004 #1


    User Avatar
    Science Advisor
    Homework Helper

    I've seen before that Pi supposedly takes a lot of processing power to approximate because of its infinite series [tex]4\sum_{r=1}^\infty \frac{-1^{r+1}}{2r-1}[/tex]

    However would it not be far quicker to use the infinite series to approximate [tex]arcsin{\frac{1}{\sqrt{2}}}[/tex] and then multiple the answer by 4? It seems to calculate Pi far faster to the small amount of terms I have done so far.

    Preemptive thanks for an answer
    Last edited: Feb 19, 2004
  2. jcsd
  3. Feb 19, 2004 #2


    User Avatar
    Science Advisor
    Homework Helper

    There are many different algorithms for pi. A friend of mine once wrote a program he called emupa (even more useless pi algorithm) that calculated pi by using the property that the chance that two numbers have a common factor is [tex]\frac{\pi}{6}[/tex] or something like that. It took several hours of computer time to generate a few digits of pi.

    Using [tex]\arcsin(\sqrt{2})[/tex] has the disadvantage that you need to calculate the digits of [tex]\sqrt{2}[/tex] in most number systems in order to use it.
    So, [tex]\arctan{1}=\frac{\pi}{4}[/tex] is a better option, and is typically used.

    There are series that generate more digits per term, but any of them generate n digits of pi in O(n) time, so there's not really a big difference for most applications.
  4. Feb 19, 2004 #3


    User Avatar
    Science Advisor
    Homework Helper

    Oh right, that makes sense thanks :smile:
  5. Feb 24, 2004 #4
    speed test

    Also the reason they all use that algorithm for solving for pi is because it is something standard that can be used to compare processing speeds of something like computers. They are not actually going for the values of pi, but instead the focus is on how fast the processors is. It is a speed test.
  6. Feb 25, 2004 #5
    I wrote a JavaScript program that calculates pi using that power series, check it out it you want.
  7. Feb 28, 2004 #6
    Just a thought - do we REALLY need to know the exact value for pi??? Coz the values we got now kinda do everything we need it to do.
  8. Feb 28, 2004 #7
    We "know" it in the sense that we know how to calculate it, given an infinite amount of time. But, since we obviously don't have an infinite amount of time (or ink and paper), we can't write all of the digits of pi.

  9. Feb 28, 2004 #8


    User Avatar
    Science Advisor
    Homework Helper

    Really, we know the exact value of π the same way that we know the exact value of 2.5. For real life applications, the limitation is the measuring equipment. In mathematics there is no need for error.

    It's possible to write numbers base π so that 1 is a non-repeating decimal, and π is easy to write.
  10. Feb 28, 2004 #9
    pi - another way

    I am a bit rusty on this stuff so please be patient.

    Let Th (theta) be the angle enscribed at the apex of a triangle made by two radii and the secant at the circurmference., where the secant is not greater than one radius., and the apex is at the center of the circle.

    * means , times or mutiply

    sin Th * 360 / Th .

    However I began with R , the radius and not D the diameter - so I must divide the resulting expression by 2


    (sin Th * 360 / Th ) / 2 = Pi

    When Th is very small - eg 1/360^n then the first 10 or so digits in the result remain identical...
    Last edited: Feb 28, 2004
  11. Feb 28, 2004 #10
    This seems to be mixing up the idea of "knowing" a number with our ability to produce a decimal representation of said number.

    Decimal representation has a lot of practical uses. But mathematically it's just another way of writing a number. The ability to write down a finite decimal representation for a number doesn't make that number more "knowable".
  12. Feb 28, 2004 #11
    Perhaps there is no unique value that is exactly 'pi', IOW it cannot be. I once provided a proof for 'root 2' to my mathamatician friend which he tore to shreds with squiggles ...leaving me with a headache.

    it goes like this.

    Numbers must be separated to be distinct. What separates these is the dull stuff that holds on to the 'value' of Root 2, pi etc .. Which helps explain how it is ARITHMETICALLY possible to calculate AROUND them for ever, though never ever being able to hit the bullseye -because there isn't one.

    When once an intellligent mathamatician began to understand this oddity he found a hole in the thought-world where a new dimension began and another ended. That mathamatician went mad.

    OC one cannot 'know' a number, only that there is a number ...eg 4 or something like that. I don't know 4 any more than I know you. I can't get personal with 4 because it is not that sort of thing. Like 'myself and 4 went to the bar for a beer' Yeah ... that is mad.

    OTOH we can know that x IS so many or so big, a number. We know that x is equal to 4.

    Numbers provide exactitude to quantity statements. It is not that there are more apples in my desk than yours which permits me to say 'I have more than you'; rather, it is the fact there are 4 apples in my desk but 3 in yours that shows it.

    In some realms there are exactitudes. Between these lie the work of a higher power which we cannot measure.
    Last edited: Feb 28, 2004
  13. Feb 28, 2004 #12
    In that case, I guess we'd need to more properly define how to "know" a number. Or perhaps that's the wrong question. How about this one, "What exactly do you want to know about [itex]\pi[/itex]?"

  14. Feb 29, 2004 #13


    User Avatar
    Science Advisor
    Homework Helper

    This deals with one of the more subtle properties of real numbers -- completeness.

    Completeness means that any set of real numbers that has an upper bound has a least upper bound, and that least upper bound is a real number.

    Now for numbers like [tex]\sqrt{2}[/tex] it's easy to show that there is an upper bound for the set of real numbers such that [tex]x^2 \leq 2[/tex]. This means that the set has a suprememum, and that suprememum is [tex]\sqrt{2}[/tex]. A similar approach can be used with [tex]\pi[/tex] and several of the trig functions.
  15. Feb 29, 2004 #14
    I am certain these sorts of explanations
    comfort many a wandering soul, good! For the rest of us what we understand by the word 'number' is a thing which enables us to count things.

    We don't need to know anything about 'sets' or 'number lines' or any of that to be able to do it
    Last edited: Mar 1, 2004
  16. Mar 1, 2004 #15


    User Avatar
    Staff Emeritus
    Gold Member
    Dearly Missed

    Not if you just accept the numbers (including pi) as "given". But you were theorizing about the numbers and as soon as you do that you have to pay attention to the basic definitions, including sets, completeness, transcendence, and all kinds of stuff. You wanna play with the big boys you gotta spec up.
  17. Mar 1, 2004 #16
    Last edited: Mar 3, 2004
  18. Mar 1, 2004 #17
    Ahhh (if I may don the venerable robe of the Socratic for a moment)... What are we counting when we say 3/4?
  19. Mar 1, 2004 #18


    User Avatar
    Science Advisor
    Homework Helper

    In that case you would be counting quarters. A quarter is one of four interchangable parts that make up a whole. For example, a horse is a quarter of a four-horse team, or 25 cents is a quarter of a dollar.
  20. Mar 1, 2004 #19
    (still wearing the white robes-- robes which upon closer inspection appear a bit dirty around the edges)...

    May we then (after fixing a standard length) use numbers to measure the length of objects-- saying that an object has a length of 3/4 when our standard of measurement may be subdivided into 4 equal sized pieces, one of which fits precisely 3 times without overlap or gap atop the object whose length we deemed to be 3/4?
  21. Mar 2, 2004 #20


    User Avatar
    Science Advisor
    Homework Helper

    There is a fundemental difference between counting and measuring. Numbers can be used to measure lengths, but completenes is needed in order to make geometry with measure work. For non ideal objects, there is sufficient fudging that completeness is not necessary. It's not difficult to come up with geometric constructions that contain lines with measure which is not rational. An alternative view is that you need a minimal granularity in order for counting to function, but (the standard notion of) measure does not allow for that.

    Rational numbers are a effectively a counting system with 'variable granularity', but it is possible to show that there are pairs of meausurements that do not have a whole ratio relationship.

    Here's a rather fun construction of one of them:
    On a decimal ruler, each unit is divided into tenths, each of those tenths is divided into tenths, and each tenth of a tenth is divided, and so on.

    Now, it's easy to see that on this ruler, [tex]\frac{1}{9}[/tex] is not on any of the marks. It's always possible to get closer to it, but dividing one more time, and going to the next notch.

    Now let's say I have a ruler which denotes a length of one unit. Then I can subdivide the section between each mark with a smaller mark, so now the ruler counts halves. Then i divide each half into three sixths, each of the sixths into four twenty-fourths, and so on.

    This new ruler has the rather nifty property that every rational number, that is, that every number which can be expressed as a fraction, is exactly on some mark. To prove this, simply consider that if the number can be written as [tex]\frac{a}{b}[/tex] then the number of segments on the ruler will be divisible by [tex]b[/tex] after at most [tex]b[/tex] steps and so, some notch will be at [tex]\frac{a}{b}[/tex].

    Now, you need to ask whether a location that never falls exactly on a notch is possible on this ruler, and the answer is yes. For example, you can take the location analagous to [tex]\frac{1}{9}[/tex] - the answer is always closer to the next smaller notch. This location, by the way, corresponds to [tex]e-2[/tex]
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook