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
Bengt Werstén  Account Info
(Web Page)

Oh my god, Pi Day
Can´t wait for "e Day"
____,,,^..^,,,______
--

     14 March 2000, 08:24 GMT

Re: Re: Feature: Calculating Pi
meingts Account Info

First (personal) comment of the day: ...Wow.

Second comment: Considering e is about 2.81828 (something liket that)...there is no 81st day in a month. Even if there were an e day, it probably would have been missed :)

     14 March 2000, 09:39 GMT

Re: Re: Re: Feature: Calculating Pi
darkness  Account Info

NO, but you could do 2/8/18 at 00:28 GMT or something like that....

Glen

     14 March 2000, 15:27 GMT


Re: Re: Re: Feature: Calculating Pi
James Marshall  Account Info
(Web Page)

First, e is approximately 2.718281828459045. :) Second, I've already thought about possibilities for e-day and posted my thoughts on my website. In case you don't want to look :) my suggestions were: February 7 or July 2, depending on how you like to notate dates (ie., 2/7 as M/D or D/M). If you add a few more digits and let them represent a time, you could make the time 18:28 = 6:28 PM on the chosen day or perhaps use January 27 at 8:28 (27/1, 8:28) instead. On the topic of extra digits as a time, Pi Day becomes March 14 at 1:59.
I think it's commonly taken as PM just because most people wouldn't want to celebrate Pi Day at 2 in the morning. ;) Don't forget about Pi Approximation Day -- 22/7 is the commonly used fraction approximation of pi, so that day is celebrated on July 22. And of course every day has a Pi Time -- 3:14! :) Happy Pi Day all!

     14 March 2000, 17:00 GMT

Re: Re: Feature: Calculating Pi
AuroraBoriales  Account Info

Well, If there WAS actually an e day, it would be in my opinion, April 13(This year it would have been April 12 because of leap day). This is because e is somewhat equal to 2.72, and there only 28 days(usually)
in Feburary and then it would be March the 44th and there are 31 days in March, so it would be April the 13th, and yes, i agree it dosen't make any sense. But if anyone has a better way to figure out the "e" day, i would like to hear it.(Besides saying there is no E day because i know that)

     14 March 2000, 17:31 GMT


Re: Re: Re: Feature: Calculating Pi
pooze  Account Info

What about a e day on 27.09? (day nr. 271 in the year)
I think I liked my idea. :)

     15 March 2000, 17:53 GMT

What about the other special days?
grinik  Account Info

What are we going to do for Thursday? It will be sqrt(10) Day!
And what about the 31st and April 12th and 24th and May 9th and 19th and 29th and June 8th and 16th and 24th and July 7th and 14th and 21st and August 6th and 12th and 18th and 24th and 30th and September 5th and 11th and 16th and 21st and 27th and October 4th and 9th and 14th and 19th and 24th and 29th and November 4th and 9th and 13th and 18th and 22nd and 26th and December 4th and 8th and 12th and 16th and 20th and 24th and 28th and February 23rd?

     14 March 2000, 22:27 GMT

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

Actually I'd rather see "i day"

     15 March 2000, 01:50 GMT

Re: Re: Re: Feature: Calculating Pi
Tim Dorr  Account Info
(Web Page)

And I'm waiting for my "i"'th birthday. It's on the "i"'th day of Apr"i"l. (and I wonder why people look at me funny?)

     15 March 2000, 21:50 GMT


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

Actually, you'd have to "imagine" the day ever took place.


Okay, that was not funny either.

     16 March 2000, 02:11 GMT


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

Good idea. Let's celebrate it on February 30.

     16 April 2000, 04:22 GMT


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

How about "psi time" on June 18 at 3:39 PM?

(1/psi = psi-1 = .6180339...)

     16 April 2000, 04:48 GMT

Re: Feature: Calculating Pi
Chris Fazio  Account Info

<lame>
You programmed that on your Apple? I guess you could call it "apple pi" :)
</lame>
happy pi day everyone!

-chris

     14 March 2000, 15:44 GMT

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

Someone shoot this guy.

     14 March 2000, 20:06 GMT


Re: Re: Re: Feature: Calculating Pi
Robert Mohr  Account Info
(Web Page)

done

     6 April 2000, 02:52 GMT


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

rimshot!

muted laughter

     14 March 2000, 21:04 GMT

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

Hey, you know, that was really intellectually stimulating. I just made Pythag. its an animation for the TI-83 + BASIC, really neat. and then to refesh my noodle with pi, and e...you guys are awesome. probably no one will read this, because its at the bottom. I usually stop it before its done laoding to. thanks for the article...
Steve
http://www.megahelp.org (not running yet)
mystic_calx@yahoo.com

     14 March 2000, 17:43 GMT

Re: Feature: Calculating Pi
jmg

According to the Old Testament of the bible, pi=3. :-)

     14 March 2000, 17:50 GMT

Re: Re: Feature: Calculating Pi
Scott Noveck  Account Info
(Web Page)

Not that I believe any of the bible stuff, but that story is due to people misinterpreting the text. It talks about a round wheel with a think border, then gives the INNER diameter followed by the OUTER circumference.

And the story about some state nearly making pi=3 is false, although another state DID nearly make pi=3.2 in the 1980s due to some people not realizing that the proposed bill was a joke. It's in the book Pi =)

     15 March 2000, 03:20 GMT


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

From the 1995 guinness book of records, page 179:
"Most inaccurate version of pi: In 1897 the general Assembly of Indiana enacted Bill No. 246, station that pi was de jure 4"

     16 March 2000, 23:13 GMT


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

Yes, 1 Kings 7:23 does appear to say that pi=3. However, it is interesting to note that, in the Hebrew text, the word for "circumference" is spelled with an extra letter.

The Jews used each of the letters of their alphabet to represent numbers. The numerical value of the normal Hebrew spelling for "circumference" is 106 and that of the unusual spelling in 1 Kings 7:23 is 111.

This "misspelling" gives us a very good approximation for pi: 3 x 111 / 106 = 3.14150943..., an error of less than .0003 percent!

Of course, I didn't figure this out on my own. Some Israeli scientists and rabbis did. I'ts mentioned in Grant Jeffrey's book The Handwriting of God.

     16 April 2000, 04:37 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