ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: Feature: Calculating Pi

Feature: Calculating Pi
Posted by Nick on 14 March 2000, 03:57 GMT

I hope everyone is having a very happy Pi Day! In case you don't know, today (March 14) is Pi Day. In honor of this, this week's feature will be in homage of our favorite irrational number. Andy Selle has written us a feature regarding pi and its origins.

Check out the updated version instead. It is available in PDF or HTML


Calculating pi: an explorative tour

Andrew Selle (aselle@ticalc.org)


Abstract:

A look at calculating pi with a TI graphing calculator. This article goes through a variety of methods for finding the ever closer decimal approximation of our favorite trancendental number.



Introduction

pi is a very interesting number. We are first introduced to it early in our grade-schooling as a component of the formulas A=pi*r^2and C=2*pi*r. It seems odd to us that we need to use this number. Where did it come from? How did we ever figure it out? These our questions that I hope to address and perhaps answer. However, the major point of this article is to explore methods of calculating pi using a Texas Instruments graphing calculator (and perhaps a few computers).


History

The history of pi is a long one. The first significant advancement in the understanding of pi was the Ancient Greeks. They came up with the concept of inscribing a polygon inside a circle. As you added more sides to the polygon, the polygon became closer and closer to a circle. By taking the ratio between the polygon's area to the circle's area, you could find pi Thus, the first method of calculating pi was born.
During the middle ages, time for calculating pi was not readily available. Even when it was, the polygon inscribing method was very slow and painstaking. It was eventually discovered that an infinite series approximating arctan was a good means to calculate pi. Once the computer was invented, pi was quickly calculated to many places.

This history is in no way complete, but it covers the major ideas.


Math

Obviously, a lot of math is involved in calculating pi. I will derive all my mathematics as completely as possible, but don't be afraid to skip the derivations if you are not interested. I will highlight the important results found to make this easy.

Monte Carlo Method

Derivation

One of my favorite methods, and one of the simplest to understand is the Monte Carlo method. I first ran into this method when I was learning BASIC for my Apple II. One sets up a square that is 2 by 2. One then inscribes a circle inside the square. Random points are then plotted repeatedly. For each point we add one to the variable n, and if the point is within the circle we add one to the variable i. Then to calculate we simply put together what we know. area(circle)=pi*r^2,areasquare = 4. Now, we can setup the proportion 4/pi=i/n. Thus, pi=(4i)/n

Implementation

This program can be easily implemented in 8x TI-BASIC as:

:0 --> N0 --> D
:While 1
:rand*2-1 --> X
:rand*2-1 --> Y
:If sqrt(x^2+y^2)=< 1
:N+1 --> N
:End
:D+1 --> D
:Disp (N/D*4)
:End

Bibliography

1) Dara Hazeghi: Dara's Pi Page http://www.geocities.com/EnchantedForest/5815/,
Accessed 3/4/2000
2) JOC/EFR: Pi Through the Ages http://www-groups.dcs.st-and.ac.uk/


If you don't yet know how to celebrate Pi Day, here's a few tips:

  • Watch the movie Pi. It was written rather recently, and it's a bit artsy, but I love it. I'm planning on watching it with friends during the evening.
  • Serve pie to your classes, or if you don't have enough pie, have it for dinner!
  • Be psychotic like me and memorize sixty digits of pi. :)

Best wishes to you during this Pi Day season.

 


The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.


Re: Feature: Calculating Pi
MicroLITH Account Info

Is someone with a Pi face someone with an incalculable number of wrinkles?

Happy Pi day.

>|

     14 March 2000, 04:11 GMT

Re: Feature: Calculating Pi
natefanaro  Account Info
(Web Page)

I have seen the movie Pi and I thought it was interesting, though I would have liked to see it in color. I saw it a while ago so I kins of forgot how Pi had something to do with predicting the stock market. Well, maybe a sequel will come around. As for an unrelated, yet related, issue. My birthday is on Pi day. I didn't realize it untill last year though. I think I might try to get a pie that says happy birthday on it.

     14 March 2000, 04:24 GMT


Re: Re: Feature: Calculating Pi
Nick Disabato  Account Info
(Web Page)

IMHO, the monochrome nature of the movie made it much more interesting. Kinda like Blair Witch Project. :P

Also, I doubt there'll be a sequel given what happens to the protagonist in the first one :)

Your birthday is Pi Day?! Happy Birthday! I wish my birthday was on Pi Day/Mole Day.. :\ too bad I got stuck with Groundhog Eve. Oh well.

--BlueCalx

     14 March 2000, 04:28 GMT

Re: Re: Re: Feature: Calculating Pi
Axycer Account Info

Do you still want your B-day present? I mean, you haven't requested it yet, just wanted to know if you were still interested. Just let me know. ;)

     15 March 2000, 13:30 GMT


Re: Re: Re: Feature: Calculating Pi
Erich Oelschlegel  Account Info
(Web Page)

Yeah, except that Blair Witch Project sucked. :)

~ferich

     25 March 2000, 19:58 GMT

Re: Feature: Calculating Pi
Mike Knapp  Account Info
(Web Page)

Nowhere in this article did i actually see the decimal approximation of pi, so without further hesitation, I give you the first 50 decimal places of pi (recited from memory):
3.1415926535 8979323846 2643383279 5028841971 6939937501

     14 March 2000, 04:32 GMT

Re: Re: Feature: Calculating Pi
WhySanity  Account Info

Well... since pre-calc is so boring.. I memorized a humble 86 digits... here _they_ are (from memory)...

3.14159265358979323846264338327 9502884197169399375105820974944 59230781640628620899862803

if anyone has a guiness book... could they look up the record for length... i thought i heard like 1000 digits or something...

     14 March 2000, 04:44 GMT

Re: Re: Re: Feature: Calculating Pi
Gohan Account Info
(Web Page)

Geez thats amazing though, the way you guys can remember that (if you are serious about it).
I heard that the human brain can only remember a like up to 15 digit number.

     14 March 2000, 05:21 GMT

Re: Re: Re: Re: Feature: Calculating Pi
brentes
(Web Page)

A Japanese guy recited the first 42,000 digits of pi from memory in just over 9 hours.

     14 March 2000, 05:27 GMT


Re: Re: Re: Re: Feature: Calculating Pi
Kirk Meyer  Account Info
(Web Page)

That's not true. Because, well... I made this 20-digit code up when I was like 7 or something and I still remember it. I'd guess that most people max out at about 100 unless they try really really hard.

     14 March 2000, 05:31 GMT


Re: Re: Re: Re: Re: Feature: Calculating Pi
Flymaster Account Info

Short term memory maxes out at about 7 distinct things....of course, if you can memorize stuff in chunks, like 314, 159, 26, etc...you can hold more than 7 digits...theoretically, if you can make big enough chunks, you could go forever.

     14 March 2000, 16:05 GMT


Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Axycer Account Info

7 things, plus or minus two. That is average on what our short-term memory is able to handle.

     15 March 2000, 13:27 GMT

Re: Re: Re: Feature: Calculating Pi
AuroraBoriales  Account Info

Well, I "recited" the first 1001 digits of Pi "from memory" (That is i do not believe you people)
3.

1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679
8214808651 3282306647 0938446095 5058223172 5359408128
4811174502 8410270193 8521105559 6446229489 5493038196
4428810975 6659334461 2847564823 3786783165 2712019091
4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436
7892590360 0113305305 4882046652 1384146951 9415116094
3305727036 5759591953 0921861173 8193261179 3105118548
0744623799 6274956735 1885752724 8912279381 8301194912
9833673362 4406566430 8602139494 6395224737 1907021798
6094370277 0539217176 2931767523 8467481846 7669405132
0005681271 4526356082 7785771342 7577896091 7363717872
1468440901 2249534301 4654958537 1050792279 6892589235
4201995611 2129021960 8640344181 5981362977 4771309960
5187072113 4999999837 2978049951 0597317328 1609631859
5024459455 3469083026 4252230825 3344685035 2619311881
7101000313 7838752886 5875332083 8142061717 7669147303
5982534904 2875546873 1159562863 8823537875 9375195778
1857780532 1712268066 1300192787 6611195909 2164201989


     14 March 2000, 17:21 GMT

Re: Re: Re: Re: Feature: Calculating Pi
AuroraBoriales  Account Info

By "memory" of course, i am refering to memory retained by integrated circuits accessed via the cut and paste commands on the console.
And yes, i can "recite" from "memory", the first 100,000 digits of pi, but that would be really overdoing it.

     14 March 2000, 20:29 GMT

Re: Re: Re: Re: Re: Feature: Calculating Pi
CircaX  Account Info
(Web Page)

Last year one of my friends printed out 60 pages of pi.

     14 March 2000, 20:46 GMT


Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Ciaran McCreesh  Account Info
(Web Page)

Someone printed out the first hundred (ish) pages of pi on our school computers before it was stopped, otherwise it would have gone on for several thousand. Strangely no-one could find out who did it. Must have been a genius hacker...

I have the first million digits next to my computer screen :P

Ciaran

     14 March 2000, 21:40 GMT


Re: Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Native

Hey-

Where did you guys find these huge numbers of pie? A web site or something-share some address's,I'd like to see the gogolith digit of pie.

=)

     15 March 2000, 04:21 GMT

Re: Re: Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Ciaran McCreesh  Account Info
(Web Page)

ftp.uiarchive.cso.uiuc. edu/pub/etext/gutenberg/ etext93/pimil10.zip (remove the spaces)

     15 March 2000, 19:45 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Erich Oelschlegel  Account Info
(Web Page)

Mmm, I like pie. I, too, would like to find out where these gigantic numbers of pie are found. I imagine that I could eat about 6 whole pies right now. I'm starving..

~ferich

     25 March 2000, 20:01 GMT


Re: Re: Re: Re: Re: Feature: Calculating Pi
Nick Chaves  Account Info
(Web Page)

Sorry, but you're pretty ignorant. I memorized the first 60 digits, it's not that hard. I have a pretty good memory (not amazing like the people who memorized 42,000 digits, and yes, something like that is the world record. It took the guy several hours to repeat it. What a waste of time) and anyway, all I did was memorize the first few digits in patterns, and then in groups of 5s it's not that hard. 60, 70, 80 digits, whatever, is not inconveivable. It starts to get hard to believe when you talk 100s, 1000s and 10s of thousands of digits.

Nick

P.S. I admit, you cannot believe that someone "recited" those digits of pi onto a message board, therefore I am not going to. But 50+ digits is not impossible, believe me.

     15 March 2000, 07:04 GMT

Re: Re: Re: Re: Feature: Calculating Pi
Chris Heit  Account Info
(Web Page)

And just to show you people up, here is the square root of pi: 1.772453 8509055 160272 981674 8334115..

     15 March 2000, 01:43 GMT


Re: Re: Re: Re: Feature: Calculating Pi
Mono Account Info

oh ya look at this!!3.


1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164 0628620899 8628034825 3421170679
8214808651 3282306647 0938446095 5058223172 5359408128 4811174502 8410270193 8521105559 6446229489 5493038196
4428810975 6659334461 2847564823 3786783165 2712019091 4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436 7892590360 0113305305 4882046652 1384146951 9415116094
3305727036 5759591953 0921861173 8193261179 3105118548 0744623799 6274956735 1885752724 8912279381 8301194912
9833673362 4406566430 8602139494 6395224737 1907021798 6094370277 0539217176 2931767523 8467481846 7669405132
0005681271 4526356082 7785771342 7577896091 7363717872 1468440901 2249534301 4654958537 1050792279 6892589235
4201995611 2129021960 8640344181 5981362977 4771309960 5187072113 4999999837 2978049951 0597317328 1609631859
5024459455 3469083026 4252230825 3344685035 2619311881 7101000313 7838752886 5875332083 8142061717 7669147303
5982534904 2875546873 1159562863 8823537875 9375195778 1857780532 1712268066 1300192787 6611195909 2164201989

3809525720 1065485863 2788659361 5338182796 8230301952 0353018529 6899577362 2599413891 2497217752 8347913151
5574857242 4541506959 5082953311 6861727855 8890750983 8175463746 4939319255 0604009277 0167113900 9848824012
8583616035 6370766010 4710181942 9555961989 4676783744 9448255379 7747268471 0404753464 6208046684 2590694912
9331367702 8989152104 7521620569 6602405803 8150193511 2533824300 3558764024 7496473263 9141992726 0426992279
6782354781 6360093417 2164121992 4586315030 2861829745 5570674983 8505494588 5869269956 9092721079 7509302955
3211653449 8720275596 0236480665 4991198818 3479775356 6369807426 5425278625 5181841757 4672890977 7727938000
8164706001 6145249192 1732172147 7235014144 1973568548 1613611573 5255213347 5741849468 4385233239 0739414333
4547762416 8625189835 6948556209 9219222184 2725502542 5688767179 0494601653 4668049886 2723279178 6085784383
8279679766 8145410095 3883786360 9506800642 2512520511 7392984896 0841284886 2694560424 1965285022 2106611863
0674427862 2039194945 0471237137 8696095636 4371917287 4677646575 7396241389 0865832645 9958133904 7802759009

9465764078 9512694683 9835259570 9825822620 5224894077 2671947826 8482601476 9909026401 3639443745 5305068203
4962524517 4939965143 1429809190 6592509372 2169646151 5709858387 4105978859 5977297549 8930161753 9284681382
6868386894 2774155991 8559252459 5395943104 9972524680 8459872736 4469584865 3836736222 6260991246 0805124388
4390451244 1365497627 8079771569 1435997700 1296160894 4169486855 5848406353 4220722258 2848864815 8456028506
0168427394 5226746767 8895252138 5225499546 6672782398 6456596116 3548862305 7745649803 5593634568 1743241125
1507606947 9451096596 0940252288 7971089314 5669136867 2287489405 6010150330 8617928680 9208747609 1782493858
9009714909 6759852613 6554978189 3129784821 6829989487 2265880485 7564014270 4775551323 7964145152 3746234364
5428584447 9526586782 1051141354 7357395231 1342716610 2135969536 2314429524 8493718711 0145765403 5902799344
0374200731 0578539062 1983874478 0847848968 3321445713 8687519435 0643021845 3191048481 0053706146 8067491927
8191197939 9520614196 6342875444 0643745123 7181921799 9839101591 9561814675 1426912397 4894090718 6494231961

5679452080 9514655022 5231603881 9301420937 6213785595 6638937787 0830390697 9207734672 2182562599 6615014215
0306803844 7734549202 6054146659 2520149744 2850732518 6660021324 3408819071 0486331734 6496514539 0579626856
1005508106 6587969981 6357473638 4052571459 1028970641 4011097120 6280439039 7595156771 5770042033 7869936007
2305587631 7635942187 3125147120 5329281918 2618612586 7321579198 4148488291 6447060957 5270695722 0917567116
7229109816 9091528017 3506712748 5832228718 3520935396 5725121083 5791513698 8209144421 0067510334 6711031412
6711136990 8658516398 3150197016 5151168517 1437657618 3515565088 4909989859 9823873455 2833163550 7647918535
8932261854 8963213293 3089857064 2046752590 7091548141 6549859461 6371802709 8199430992 4488957571 2828905923
2332609729 9712084433 5732654893 8239119325 9746366730 5836041428 1388303203 8249037589 8524374417 0291327656
1809377344 4030707469 2112019130 2033038019 7621101100 4492932151 6084244485 9637669838 9522868478 3123552658
2131449576 8572624334 4189303968 6426243410 7732269780 2807318915 4411010446 8232527162 0105265227 2111660396

6655730925 4711055785 3763466820 6531098965 2691862056 4769312570 5863566201 8558100729 3606598764 8611791045
3348850346 1136576867 5324944166 8039626579 7877185560 8455296541 2665408530 6143444318 5867697514 5661406800
7002378776 5913440171 2749470420 5622305389 9456131407 1127000407 8547332699 3908145466 4645880797 2708266830
6343285878 5698305235 8089330657 5740679545 7163775254 2021149557 6158140025 0126228594 1302164715 5097925923
0990796547 3761255176 5675135751 7829666454 7791745011 2996148903 0463994713 2962107340 4375189573 5961458901
9389713111 7904297828 5647503203 1986915140 2870808599 0480109412 1472213179 4764777262 2414254854 5403321571
8530614228 8137585043 0633217518 2979866223 7172159160 7716692547 4873898665 4949450114 6540628433 6639379003
9769265672 1463853067 3609657120 9180763832 7166416274 8888007869 2560290228 4721040317 2118608204 1900042296
6171196377 9213375751 1495950156 6049631862 9472654736 4252308177 0367515906 7350235072 8354056704 0386743513

     16 May 2000, 02:49 GMT


Re: Re: Re: Feature: Calculating Pi
The_Professor  Account Info
(Web Page)

The record is somewhere around 2,260,321,336 digits

     16 March 2000, 23:00 GMT


Re: Re: Re: Re: Feature: Calculating Pi
Daniel Bishop  Account Info

Impressive. But do you know of any real world situation that would require more than 15 digits?

     17 April 2000, 05:23 GMT

Re: Re: Feature: Calculating Pi
Nick Disabato  Account Info
(Web Page)

Here are the first sixty digits, recited from memory.
And the world record is over 10,000, so I've heard.

3.1415926535 8979 3238 4626 4338 3279 50288 41971 69399 37510 58209 74944
I memorized them in groups of four (or five). That's the pattern in which I memorized it.

The first million digits of pi are in my web page link.
Go to http://www.pithemovie.com/ for information about the movie "Pi."

--BlueCalx

     14 March 2000, 05:12 GMT

Re: Re: Re: Feature: Calculating Pi
Amalfi Marini  Account Info

ok!!!! but , in wich part of this world a teacher gives as homework to learn PI number by memory ? did you learn it because you wanted?was it a homework....? ....OK , you won , maybe I'm out of this world
-hey! that's a game, eh-

     14 March 2000, 06:04 GMT

Re: Re: Re: Re: Feature: Calculating Pi
Nick Disabato  Account Info
(Web Page)

(real story here)
In calculus class, we have pi to seventy-five digits in giant numbers across the blackboard. Rather than pay attention in class (like I'm supposed to), I spend my time memorizing pi.
And it works! :)

--BlueCalx

     14 March 2000, 13:33 GMT

Re: Re: Re: Re: Feature: Calculating Pi
parasyte Account Info

Well, actually I had a math teacher that used to allow people to not receive any homework for the rest of the year if they were able to recite the hundred digits of pi that was posted on his wall. He offered this every year until a girl finally took him up on it, and did it. Now he doesn't offer that anymore :( Otherwise I'd do it.

     14 March 2000, 19:13 GMT


Re: Re: Re: Re: Re: Feature: Calculating Pi
TheWog Account Info
(Web Page)

Man, I would have done it about the second week. If you spent 30 minutes a day working on it, 100 digits wouldn't be too bad. Memorize them as phone numbers or zip codes.

     15 March 2000, 17:59 GMT


Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Lother  Account Info
(Web Page)

30 minutes a day for a week?? That would make 2 hours!

I mean, hey, it took me about half an hour to memorize the first 100 digits. And even
if you're really slow, I do believe you would remember them after the first day.

Used to remember nearly 300 at my best, but since I haven't read them through in
ages, I'm down to 99. I memorized the numbers in chunks of nine.

     16 March 2000, 21:29 GMT


Re: Re: Re: Re: Feature: Calculating Pi
gship

Wow, memorizing Pi in calculus class must be more common than I imagined. Back in '77, senior year in high school, I already understood a topic the class was going over again so I memorized Pi to 100 places. It was on the wall around the classroom. I told my friend I had and she blabbed it to the class and I had to prove it. Now I only remember the first seven digits.

peace

     14 March 2000, 21:11 GMT

Re: Re: Re: Feature: Calculating Pi
JEI  Account Info
(Web Page)

My pre-calc teacher offered varying amounts of extra credit for memorizing pi. The most we could get was 11 points for 30+ digits, so I learned 30. Those 11 points are essentially added on to any one grade. Wow, isn't that absurd.

JEI

     15 March 2000, 02:36 GMT

Re: Re: Re: Feature: Calculating Pi
Steve Whittaker  Account Info
(Web Page)

I'm sorry, but I must say that I own you.
3.141592 65358 979323846 26433832795028 8419716939 937510582 0974944592

63 digits!@#!$%!

     15 March 2000, 02:53 GMT


Re: Re: Re: Feature: Calculating Pi
Nick Chaves  Account Info
(Web Page)

The way you divided it above, is the exact way I memorized it too. It's pretty easy that way (exactly same number of digits too :) )

     15 March 2000, 07:14 GMT


Re: Re: Feature: Calculating Pi
Grant Elliott  Account Info
(Web Page)

I've got a friend who knows 165 digits. He memorized them during lunch one day. (He's almost as geeky as us.)

     14 March 2000, 20:56 GMT

1  2  3  4  5  6  7  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer