How to Calculate Pi without a Calculator?

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

How to Calculate Pi without a Calculator?

Postby liberonscien » Thu Aug 18, 2016 5:27 pm UTC

How does one calculate Pi without an electronic device?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
Zohar
COMMANDER PORN
Posts: 7503
Joined: Fri Apr 27, 2007 8:45 pm UTC
Location: Denver

Re: How to Calculate Pi without a Calculator?

Postby Zohar » Thu Aug 18, 2016 5:35 pm UTC

You choose one of the many methods described here.
Mighty Jalapeno: "See, Zohar agrees, and he's nice to people."
SecondTalon: "Still better looking than Jesus."

Not how I say my name

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Thu Aug 18, 2016 6:44 pm UTC

Zohar wrote:You choose one of the many methods described here.

I've seen that page before.
Which one is the simplest?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
Zohar
COMMANDER PORN
Posts: 7503
Joined: Fri Apr 27, 2007 8:45 pm UTC
Location: Denver

Re: How to Calculate Pi without a Calculator?

Postby Zohar » Thu Aug 18, 2016 6:55 pm UTC

The one that's easiest for you to do? Manually calculating 22/7 gives you reasonable accuracy for most practical purposes, or I suppose you can start calculating sums and such.
Mighty Jalapeno: "See, Zohar agrees, and he's nice to people."
SecondTalon: "Still better looking than Jesus."

Not how I say my name

commodorejohn
Posts: 958
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: How to Calculate Pi without a Calculator?

Postby commodorejohn » Thu Aug 18, 2016 6:58 pm UTC

1. Find a circle.
2. Measure its circumference.
3. Measure its diameter.
4. Divide the circumference by the diameter.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

User avatar
doogly
Dr. The Juggernaut of Touching Himself
Posts: 5212
Joined: Mon Oct 23, 2006 2:31 am UTC
Location: Somerville, MA
Contact:

Re: How to Calculate Pi without a Calculator?

Postby doogly » Thu Aug 18, 2016 7:03 pm UTC

I like the buffon needle experimental method.
LE4dGOLEM: What's a Doug?
Noc: A larval Doogly. They grow the tail and stinger upon reaching adulthood.

Keep waggling your butt brows Brothers.
Or; Is that your eye butthairs?

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Thu Aug 18, 2016 7:06 pm UTC

Zohar wrote:The one that's easiest for you to do? Manually calculating 22/7 gives you reasonable accuracy for most practical purposes, or I suppose you can start calculating sums and such.

I need something more accurate. 22/7 results in a repeating decimal, I believe.
What do you mean when you say calculating sums?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
Zohar
COMMANDER PORN
Posts: 7503
Joined: Fri Apr 27, 2007 8:45 pm UTC
Location: Denver

Re: How to Calculate Pi without a Calculator?

Postby Zohar » Thu Aug 18, 2016 7:16 pm UTC

You'll never be able to get perfect accuracy, and with most calculations you'll either end up with a repeating decimal, or just stop at some point.

What do you need this for?
Mighty Jalapeno: "See, Zohar agrees, and he's nice to people."
SecondTalon: "Still better looking than Jesus."

Not how I say my name

DR6
Posts: 171
Joined: Thu Nov 01, 2012 1:44 pm UTC

Re: How to Calculate Pi without a Calculator?

Postby DR6 » Thu Aug 18, 2016 7:22 pm UTC

liberonscien wrote:I need something more accurate. 22/7 results in a repeating decimal, I believe.
What do you mean when you say calculating sums?

He means something like this: in the Wikipedia article linked before there are a lot of options, and this one has some more that may be usable. It may be worth it to look at digit extraction methods, as they can be made to require very little memory, which is probably very helpful if you want to calculate it by hand.

Why do you want this?

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: How to Calculate Pi without a Calculator?

Postby lorb » Fri Aug 19, 2016 8:20 am UTC

liberonscien wrote:
Zohar wrote:You choose one of the many methods described here.

I've seen that page before.
Which one is the simplest?
liberonscien wrote:How does one calculate Pi without an electronic device?


Continued fractions are doable by hand and yield good approximations without being too hard. Also you don't really need many digits. Even NASA uses only 16 digits for the program that controls and stabilizes spacecraft during missions. And that includes some extra digits just to be on the safe side.
Please be gracious in judging my english. (I am not a native speaker/writer.)
http://decodedarfur.org/

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Fri Aug 19, 2016 11:20 am UTC

lorb wrote:Also you don't really need many digits. Even NASA uses only 16 digits for the program that controls and stabilizes spacecraft during missions. And that includes some extra digits just to be on the safe side.


Somehow I doubt the OP is asking this for any practical purpose.

If you want "practical", just memorize the number of digits you need in advance. Of-course this answer sucks all the fun out the challenge, but you can't deny that it works.
Image

User avatar
Zohar
COMMANDER PORN
Posts: 7503
Joined: Fri Apr 27, 2007 8:45 pm UTC
Location: Denver

Re: How to Calculate Pi without a Calculator?

Postby Zohar » Fri Aug 19, 2016 1:07 pm UTC

PsiCubed wrote:If you want "practical", just memorize the number of digits you need in advance. Of-course this answer sucks all the fun out the challenge, but you can't deny that it works.

I suppose there's one of those triangle diagrams things with "Easy to perform" in one corner, "Converges quickly" in another corner, and "Fun to do" in a third corner.
Memorizing is easy, and provides a sufficiently good result, but is not fun.
Ramanujan's method converges very quickly, may be fun to do, but is probably not very easy manually.
The Leibniz formula is easy, probably more fun than Ramanujan's, but converges very slowly.

If the purpose is "I want to do something while I'm bored in class", I would probably go with the third option.
Mighty Jalapeno: "See, Zohar agrees, and he's nice to people."
SecondTalon: "Still better looking than Jesus."

Not how I say my name

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 1:10 pm UTC

PsiCubed wrote:
lorb wrote:Also you don't really need many digits. Even NASA uses only 16 digits for the program that controls and stabilizes spacecraft during missions. And that includes some extra digits just to be on the safe side.


Somehow I doubt the OP is asking this for any practical purpose.

If you want "practical", just memorize the number of digits you need in advance. Of-course this answer sucks all the fun out the challenge, but you can't deny that it works.

You are correct.
I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.
I am trying to learn some higher math.
I think it would be interesting to see how far I can get.
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 1:12 pm UTC

Zohar wrote:
PsiCubed wrote:If you want "practical", just memorize the number of digits you need in advance. Of-course this answer sucks all the fun out the challenge, but you can't deny that it works.

I suppose there's one of those triangle diagrams things with "Easy to perform" in one corner, "Converges quickly" in another corner, and "Fun to do" in a third corner.
Memorizing is easy, and provides a sufficiently good result, but is not fun.
Ramanujan's method converges very quickly, may be fun to do, but is probably not very easy manually.
The Leibniz formula is easy, probably more fun than Ramanujan's, but converges very slowly.

If the purpose is "I want to do something while I'm bored in class", I would probably go with the third option.

Thank you.
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: How to Calculate Pi without a Calculator?

Postby lorb » Fri Aug 19, 2016 1:53 pm UTC

Zohar wrote:[...]
The Leibniz formula is easy, probably more fun than Ramanujan's, but converges very slowly.

If the purpose is "I want to do something while I'm bored in class", I would probably go with the third option.


Totally agree that the Leibniz formula would be an easy and somewhat fun way to spend boring classes on, but it converges so slow there is practically no visible progress after about 3 or 4 digits, and even getting there can take really really long. (Hours to get 4 accurate digits assuming it takes between 1 and 10 seconds for each term you add to the total. Can't get past 10 digits even if you do it your whole life.)
Please be gracious in judging my english. (I am not a native speaker/writer.)
http://decodedarfur.org/

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Fri Aug 19, 2016 2:14 pm UTC

liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.


For that purpose, manually calculating pi is a terribly inefficient method.

If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper. Otherwise, memorizing a bulk of digits (either from pi or a simple book of random numbers) would be the way to go.

Also, while the digits of pi are probably random in the long run, the first few dozen digits do exhibit curious patterns. So if you want to use pi as a random digit generator, it is better to start at some distant position (say, the 5892th digit) and memorize from there.

I am trying to learn some higher math.
I think it would be interesting to see how far I can get.


For these two, the formulas based on the Taylor series of arctg(x) seems like the best bet. They are simple enough to work by hand, yet converge fast enough for you to see actual progress (usually a digit or two per step).

Wikipedia has tons of these. Pick one, and start crunching :)

Oh, and stay away from the Leibniz formula. It converges so slowly, that it sucks all the fun from the process. Definitely not the way to go, if you're interested in "seeing how far I can get".
Image

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 2:22 pm UTC

PsiCubed wrote:
liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.


For that purpose, manually calculating pi is a terribly inefficient method.

If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper. Otherwise, memorizing a bulk of digits (either from pi or a simple book of random numbers) would be the way to go.

Also, while the digits of pi are probably random in the long run, the first few dozen digits do exhibit curious patterns. So if you want to use pi as a random digit generator, it is better to start at some distant position (say, the 5892th digit) and memorize from there.

I am trying to learn some higher math.
I think it would be interesting to see how far I can get.


For these two, the formulas based on the Taylor series of arctg(x) seems like the best bet. They are simple enough to work by hand, yet converge fast enough for you to see actual progress (usually a digit or two per step).

Wikipedia has tons of these. Pick one, and start crunching :)

Oh, and stay away from the Leibniz formula. It converges so slowly, that it sucks all the fun from the process. Definitely not the way to go, if you're interested in "seeing how far I can get".

What is "arctg(x)"?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
jaap
Posts: 2072
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby jaap » Fri Aug 19, 2016 2:23 pm UTC

lorb wrote:
Zohar wrote:[...]
The Leibniz formula is easy, probably more fun than Ramanujan's, but converges very slowly.

If the purpose is "I want to do something while I'm bored in class", I would probably go with the third option.


Totally agree that the Leibniz formula would be an easy and somewhat fun way to spend boring classes on, but it converges so slow there is practically no visible progress after about 3 or 4 digits, and even getting there can take really really long. (Hours to get 4 accurate digits assuming it takes between 1 and 10 seconds for each term you add to the total. Can't get past 10 digits even if you do it your whole life.)


Indeed: https://www.youtube.com/watch?v=HrRMnzANHHs

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 2:42 pm UTC

liberonscien wrote:
PsiCubed wrote:
liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.


For that purpose, manually calculating pi is a terribly inefficient method.

If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper. Otherwise, memorizing a bulk of digits (either from pi or a simple book of random numbers) would be the way to go.

Also, while the digits of pi are probably random in the long run, the first few dozen digits do exhibit curious patterns. So if you want to use pi as a random digit generator, it is better to start at some distant position (say, the 5892th digit) and memorize from there.

I am trying to learn some higher math.
I think it would be interesting to see how far I can get.


For these two, the formulas based on the Taylor series of arctg(x) seems like the best bet. They are simple enough to work by hand, yet converge fast enough for you to see actual progress (usually a digit or two per step).

Wikipedia has tons of these. Pick one, and start crunching :)

Oh, and stay away from the Leibniz formula. It converges so slowly, that it sucks all the fun from the process. Definitely not the way to go, if you're interested in "seeing how far I can get".

What is "arctg(x)"?

I believe this wasn't seen.
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
Xanthir
My HERO!!!
Posts: 5215
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: How to Calculate Pi without a Calculator?

Postby Xanthir » Fri Aug 19, 2016 2:46 pm UTC

They meant to say "arctan()". Which is a fun and simple Taylor series, being "arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 - ...".
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 3:03 pm UTC

Xanthir wrote:They meant to say "arctan()". Which is a fun and simple Taylor series, being "arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 - ...".

This is the order of operations, correct:? "arctan(x) = x - ((x^3)/3) + ((x^5)/5) - ((x^7)/7) + ((x^9)/9) - ...".
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Fri Aug 19, 2016 3:18 pm UTC

Yup.

Just stay away from x=1 :)
Image

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 3:36 pm UTC

PsiCubed wrote:Yup.

Just stay away from x=1 :)

I am having difficulties determining the purpose of your emoticon.
Is it there because you are being sarcastic, or is it there because you are saying it is too difficult?
I am baffled.
Edit:
Is it there because x=1 in this equation is basically pointless?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Fri Aug 19, 2016 3:48 pm UTC

x=1 gives you the Leibniz Formula:

arctan(1) = 1-1/3+1/5-1/7... = pi/4

And I've already given my opinion about that one.

For x<1, the progress is much quicker because the series x,x^3,x^5,x^7 goes to zero fairly rapidly.
Image

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 3:59 pm UTC

PsiCubed wrote:x=1 gives you the Leibniz Formula:

arctan(1) = 1-1/3+1/5-1/7... = pi/4

And I've already given my opinion about that one.

For x<1, the progress is much quicker because the series x,x^3,x^5,x^7 goes to zero fairly rapidly.

Ah. I was going to go in the X>1 direction, now I won't.
How does one do decimal or fractional exponents?
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Fri Aug 19, 2016 4:04 pm UTC

x>1 doesn't give you an answer at all, because the numbers just get bigger and bigger.

And exponents are simply repeated multiplication, which is just as easy to do with fractions:

(1/2)^3 = (1/2)*(1/2)*(1/2) = 1/8
Image

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 4:10 pm UTC

PsiCubed wrote:x>1 doesn't give you an answer at all, because the numbers just get bigger and bigger.

And exponents are simply repeated multiplication, which is just as easy to do with fractions:

(1/2)^3 = (1/2)*(1/2)*(1/2) = 1/8

Ah.
...
I misread something. I somehow confused ((x^3)/3) for ((3^x)/x). I was wondering how one would go about solving something like ((3^0.5)/0.5).
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

User avatar
gmalivuk
GNU Terry Pratchett
Posts: 25789
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

Re: How to Calculate Pi without a Calculator?

Postby gmalivuk » Fri Aug 19, 2016 4:51 pm UTC

liberonscien wrote:
liberonscien wrote:
PsiCubed wrote:
liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.


For that purpose, manually calculating pi is a terribly inefficient method.

If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper. Otherwise, memorizing a bulk of digits (either from pi or a simple book of random numbers) would be the way to go.

Also, while the digits of pi are probably random in the long run, the first few dozen digits do exhibit curious patterns. So if you want to use pi as a random digit generator, it is better to start at some distant position (say, the 5892th digit) and memorize from there.

I am trying to learn some higher math.
I think it would be interesting to see how far I can get.


For these two, the formulas based on the Taylor series of arctg(x) seems like the best bet. They are simple enough to work by hand, yet converge fast enough for you to see actual progress (usually a digit or two per step).

Wikipedia has tons of these. Pick one, and start crunching :)

Oh, and stay away from the Leibniz formula. It converges so slowly, that it sucks all the fun from the process. Definitely not the way to go, if you're interested in "seeing how far I can get".

What is "arctg(x)"?

I believe this wasn't seen.

In the future, please wait more than 20 minutes before deciding people must not have seen the post you just made.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Fri Aug 19, 2016 5:15 pm UTC

gmalivuk wrote:
liberonscien wrote:
liberonscien wrote:
PsiCubed wrote:
liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.


For that purpose, manually calculating pi is a terribly inefficient method.

If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper. Otherwise, memorizing a bulk of digits (either from pi or a simple book of random numbers) would be the way to go.

Also, while the digits of pi are probably random in the long run, the first few dozen digits do exhibit curious patterns. So if you want to use pi as a random digit generator, it is better to start at some distant position (say, the 5892th digit) and memorize from there.

I am trying to learn some higher math.
I think it would be interesting to see how far I can get.


For these two, the formulas based on the Taylor series of arctg(x) seems like the best bet. They are simple enough to work by hand, yet converge fast enough for you to see actual progress (usually a digit or two per step).

Wikipedia has tons of these. Pick one, and start crunching :)

Oh, and stay away from the Leibniz formula. It converges so slowly, that it sucks all the fun from the process. Definitely not the way to go, if you're interested in "seeing how far I can get".

What is "arctg(x)"?

I believe this wasn't seen.

In the future, please wait more than 20 minutes before deciding people must not have seen the post you just made.

Yes, sir.
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: How to Calculate Pi without a Calculator?

Postby lorb » Fri Aug 19, 2016 5:59 pm UTC

liberonscien wrote:I was wondering how one would go about solving something like ((3^0.5)/0.5).


By using google or Wikipedia to learn about rational exponents.
Please be gracious in judging my english. (I am not a native speaker/writer.)
http://decodedarfur.org/

User avatar
Flumble
Yes Man
Posts: 1944
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: How to Calculate Pi without a Calculator?

Postby Flumble » Fri Aug 19, 2016 7:15 pm UTC

PsiCubed wrote:
liberonscien wrote:I want to calculate Pi for three reasons.
I need a predictable number sequence with no patterns.

...
If you must generate the digits on the fly (that is - you want to be surprised as you fetch them), there are nice pseudorandom algorithms which are easy to implement on paper.

Building on this: linear-feedback shift registers are an excellent tool for this. They've got advanced mathematics behind them, they're easy to perform by hand (it's only addition), they have a long stream of (random numbers for any starting value (except 0) and you can make them for any base. (2 for coin flips, 6 for dice rolls, 10 for whatever you need decimal random numbers for) The only trouble is finding the primitive polynomials (for base 2 and 3 you can find them easily), though you can find them yourself for added 'fun'. :P You can also just use any base-2 primitive and discard all values larger than your range when you draw a new set of bits.

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Sat Aug 20, 2016 9:57 pm UTC

By the way, there's a very simple way to estimate how close you are to pi with these sums:

If the signs alternate and the numbers get smaller and smaller, then the error is - at most - the last number you added.

So:

1-1/3+1/5-1/7 is within 1/7 of the correct value of pi/4
Image

User avatar
liberonscien
-ce
Posts: 121
Joined: Thu Jan 21, 2016 7:04 pm UTC
Contact:

Re: How to Calculate Pi without a Calculator?

Postby liberonscien » Sun Aug 21, 2016 5:35 am UTC

PsiCubed wrote:By the way, there's a very simple way to estimate how close you are to pi with these sums:

If the signs alternate and the numbers get smaller and smaller, then the error is - at most - the last number you added.

So:

1-1/3+1/5-1/7 is within 1/7 of the correct value of pi/4

Would one be correct if one said 1-(1/3)+(1/5)-(1/7) is the right order of operations?
If so, then would 1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11)+(1/13) be the proper extension?
Edit: Removed an extra "-" symbol.
Last edited by liberonscien on Sun Aug 21, 2016 7:10 pm UTC, edited 1 time in total.
Warning: This user is currently questioning its beliefs. This user offers its sincerest apologies if it accidentally offends another user. This user never offends others on purpose and may accidentally offend other users because it lacks knowledge regarding how to be a normal human.

PsiCubed
Posts: 96
Joined: Thu Mar 03, 2016 11:13 am UTC

Re: How to Calculate Pi without a Calculator?

Postby PsiCubed » Sun Aug 21, 2016 7:04 am UTC

Yup.
Image

User avatar
gmalivuk
GNU Terry Pratchett
Posts: 25789
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

Re: How to Calculate Pi without a Calculator?

Postby gmalivuk » Mon Aug 22, 2016 7:42 pm UTC

But remember, that formula is extremely slow and if what you want are lots of digits, none of the ways for calculating pi by hand are going to get you very far.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

User avatar
PM 2Ring
Posts: 3619
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Mid north coast, NSW, Australia

Re: How to Calculate Pi without a Calculator?

Postby PM 2Ring » Tue Aug 23, 2016 2:23 am UTC

A convenient way to calculate decimal digits of pi without a calculator is to use the Taylor series for arctangent with formula 24 on the Mathworld page of Machin-like formulas:

pi / 4 = 8 atan(1/10) - atan(1/239) - 4 atan(1/515)

This formula is nice to work with for manual calculation because of the powers of 10 in the denominators the slowest-converging term. FWIW, I used it a decade or two ago to calculate 10 or so decimal places of pi (totally by hand, of course).

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: How to Calculate Pi without a Calculator?

Postby lorb » Tue Aug 23, 2016 6:09 am UTC

gmalivuk wrote:[...] none of the ways for calculating pi by hand are going to get you very far.


Depending on what you define as "very far". William Shanks did 707 digits by hand. (Though he made an arithmetic error and his digits are only correct for the first 527) Those 707 (or 527) I would consider pretty far, especially compared to how many digits any real world application requires. Even calculating the circumference of the visible universe, with an accuracy equal to the diameter of an hydrogen atom requires just 40 digits.
Today we have even better/faster converging formulas that are doable with about equal amount of work, so about a 1000 digits seems possible if you are pretty dedicated. (But yeah, not with the Leibniz Formula, no amount of dedication and lifelong calculation will get you beyond about 12 digits on that one)
Please be gracious in judging my english. (I am not a native speaker/writer.)
http://decodedarfur.org/

User avatar
gmalivuk
GNU Terry Pratchett
Posts: 25789
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

Re: How to Calculate Pi without a Calculator?

Postby gmalivuk » Tue Aug 23, 2016 11:42 am UTC

If you want a source of "random" digits, 50 per year is not a very practical rate.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

lorb
Posts: 404
Joined: Wed Nov 10, 2010 10:34 am UTC
Location: Austria

Re: How to Calculate Pi without a Calculator?

Postby lorb » Tue Aug 23, 2016 2:06 pm UTC

True! It's also next to nothing compared to how many digits of pi are already known.
Please be gracious in judging my english. (I am not a native speaker/writer.)
http://decodedarfur.org/

User avatar
flicky1991
Like in Cinderella?
Posts: 619
Joined: Fri Feb 11, 2011 3:36 pm UTC
Location: London

Re: How to Calculate Pi without a Calculator?

Postby flicky1991 » Tue Aug 23, 2016 6:16 pm UTC

gmalivuk wrote:If you want a source of "random" digits, 50 per year is not a very practical rate.
We got approximately 250 binary digits per year in your game. (I didn't even realise that was started by you when I went to find the link!)
any pronouns
----
Discord for Forum Games posters
(Please let me know if the link doesn't work)


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 14 guests