Most Unreliable Technique in the World to compute pi

  • Thread starter John Creighto
  • Start date
  • Tags
    Pi
In summary, Jerzy Karczmarczuk has developed functions for computing pi lazily in Haskell. The conversation discusses the limitations of computers dealing with exact real numbers and the potential utility of symbolic computation. The idea of using lazy evaluation to compute pi and the BBP formula for pi is mentioned. It is suggested that a combination of arbitrary precision and symbolic computation can be used to optimize the computation of pi. The implementation of computable real arithmetic is also brought up as a way to deal with infinite precision.
  • #1
John Creighto
495
2
In "http://users.info.unicaen.fr/~karczma/arpap/lazypi.ps.gz " Jerzy Karczmarczuk develops some functions for computing pi lazily.
http://www.haskell.org/haskellwiki/Libraries_and_tools/Mathematics

This thread is motivated by the following response by Hurkly
Computers can only deal with approximations to real numbers.
:confused:

Therefore, when one talks about "real number" in a colloquial sense, I assume they mean "approximate real number" in my sense of the word.
(moderator hat on) This is unacceptable. You'll note that this is a math subforum. Also, one of the primary goals of physicsforums.com is to promote education in science and math -- this cannot happen if you fill readers' heads with errors and misinformation. To be sure, the theory of computation is a very interesting subject, but you do the reader a great disservice to masquerade it as if you were actually talking about the real numbers. Hijacking threads is similarly problematic.

Maybe I should have taken some action earlier to split the computability stuff into a separate topic. *shrug* Nobody's complained, though; I think unless someone does, I'll let things continue. (moderator hat off)
in the thread:
https://www.physicsforums.com/showthread.php?t=294420&page=4

I looked at csprof2000 claim that computers can only deal with approximations to rational numbers and thought about Hurkly's answer. My first thought was what about symbolic computation such as those done in maple and mathematics.

However, I wondered in such symbolic computations why we might need to represent numbers in decimal form and about the utility of these symbolic results whose complexity would grow with the complexity of the calculation. I wondered do we eventually need the number in decimal form for them to be useful for us and if so what utility a complex symbolic result might yield us.

Wondering what alternatives their might be to straight symbolic calculations two things about Haskel struck me as possibly relevant to the above questions. First Haskel uses something called Lazy evaluation. This means that results are only computed if needed. Knowing this and that Haskel uses infinite precession I wondered how pi may be represented in Haskel with infinite precession.

It turns out that infinite precession is not really infinite precession but an unfortunate word used sometimes in computer science for arbatray precession. However, I did not give up my search because I thought that lazy evaluation may still be relevant.

It turns out that we can use lazy evaluation to compute pi. Moreover, it turns out that by using the BBP formula for PI you can compute any diget of pi without needing any information about the previous digits. This means that in symbolic terms we can separate the digits we compute from the digits we don't compute and only go into further precession as needed for the desired accuracy.

Say we had some function in the form:

digitsAfter(pi,100)

Then we can represent the first 100 digts we need for our calculations using arbitrary precession, and if at a later time we needed further accuracy we can evaluate to precession without having to repeat the steps required to compute the first 100 digits and with much smaller memory requirements then the memory that would be required to store the number to the precession already computed.

Thus the basic idea is to break up the computation into two parts, an arbitrary precession part and a symbolic precision part where the arbitrary precision is used to compute results to needed accuracy and the symbolic part is used to represent the air in such a way that we can always refine the precession without having to repeat computation. And consume large amounts of memory.

Now there seems to be some draw back to this technique in terms of reliability and how well things are defined. After further reading I'll comment more.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
It turns out that infinite precession is not really infinite precession but an unfortunate word used sometimes in computer science for arbatray precession.
You can make an infinite precision representation - but you need an inconveniently large universe to store the memory chips in.
 
  • #3
mgb_phys said:
You can make an infinite precision representation - but you need an inconveniently large universe to store the memory chips in.

Either that or one without such inconvenient limitations such as quantum mechanics. Is the interval from zero to one inconveniently large?
 
  • #4
You may find http://www.brics.dk/~barnie/RealLib/ interesting; it is a full implementation of computable real arithmetic, limited only by your hardware*.



Incidentally, one shouldn't forget that an (infinitely-long) decimal numeral is (in a typical formulation) quite literally just a function whose domain is the integers and whose image is the set {0,1,2,3,4,5,6,7,8,9}. (For the numeral to represent a real number, we also impose that on the left, it is eventually all zeroes)





*: Okay, that's probably not strictly true; there are probably some limitations in the actual implementation, if you push it to ridiculous (and probably impossible with current technology) extremes.
 
Last edited by a moderator:
  • #5
Hurkyl said:
You may find http://www.brics.dk/~barnie/RealLib/ interesting; it is a full implementation of computable real arithmetic, limited only by your hardware*.

I'm looking at it a bit now. I like this statement

"In the cases where machine precision is sufficient, exact real computations can be executed at a speed comparable to the speed of double precision arithmetic, sometimes even running on par with it. "
 
Last edited by a moderator:

1. What is the Most Unreliable Technique in the World to compute pi?

The Most Unreliable Technique in the World to compute pi is a method used to approximate the value of pi, also known as the ratio of a circle's circumference to its diameter. It is considered unreliable because it relies on random numbers and is not a precise calculation method.

2. Why is it considered unreliable?

This technique is considered unreliable because it uses random numbers to approximate the value of pi. As a result, the calculation may be inaccurate and not consistent, making it an unreliable method for precise scientific calculations.

3. How does this technique work?

The Most Unreliable Technique in the World to compute pi involves randomly throwing darts at a square that contains a circle. The ratio of the number of darts that land inside the circle to the total number of darts thrown is used to approximate the value of pi.

4. Is this technique used in scientific research?

No, this technique is not commonly used in scientific research due to its unreliable nature. It is often used as a fun and educational way to demonstrate the concept of probability and the approximation of pi.

5. Can this technique be improved upon?

While this technique may not be reliable for precise calculations, it can be improved upon by increasing the number of darts thrown and using more advanced statistical methods to improve the accuracy of the approximation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
273
  • Linear and Abstract Algebra
Replies
1
Views
916
Replies
4
Views
920
  • Quantum Physics
Replies
5
Views
713
Replies
4
Views
402
  • Programming and Computer Science
Replies
7
Views
455
  • Introductory Physics Homework Help
Replies
28
Views
363
  • Programming and Computer Science
Replies
32
Views
1K
  • General Discussion
Replies
10
Views
1K
  • Programming and Computer Science
Replies
29
Views
3K
Back
Top