Basics Archives Community Services Programming
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 : an explorative tour

Andrew Selle (aselle@ticalc.org)

Abstract:

A look at calculating 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

is a very interesting number. We are first introduced to it early in our grade-schooling as a component of the formulas and . 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 using a Texas Instruments graphing calculator (and perhaps a few computers).

History

The history of is a long one. The first significant advancement in the understanding of 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 Thus, the first method of calculating was born.
During the middle ages, time for calculating 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 was a good means to calculate . Once the computer was invented, 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 . 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. ,areasquare = 4. Now, we can setup the proportion . Thus,

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
amicek
(Web Page)

Man these people are smart - I feel like I can't do anything in BASIC compared to them - cool article, man!

amicek

14 March 2000, 04:08 GMT

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

did you know that http://www.tinews.net practically stole your whole design?

15 March 2000, 02:31 GMT

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

My design? Or ticalc.org's?

amicek

15 March 2000, 04:44 GMT

Memory
Curt Churn
(Web Page)

HELP HELP!!! I want more memory so i can hold more of peoples' programs! There are sooooooo many programs I want to try and it takes way to long to download all of them and try them all. I want more memory so I can try out more games and learn alot more! So if anyone has made more memory or knows where I can get some, PLEASE TELL ME!!!!! REPLY TO THE COMMENT!!!

16 March 2000, 03:27 GMT

Re: Memory
Robert Snyder

Try Ti's Virtual Ti...it works wonders... just load your rom onto your computer, run the program, and your set.. than you can try all the programs you want.. if you dont have a rom..there is one site that i found..that i'm not going to put up on here, that youcan find it..it's a frech site..so that helps a little bit..but it's easy to find it on there.. just looks for ti-roms... and it has a few on there..soyou'll have to look for it..it took me forever to find it.. which was pointless cause a week later i got a link, and than loaded all my roms on there.. oh well.. :(

7 April 2000, 02:42 GMT

Re: Memory
Daniel Bishop

You don't need all those programs at once, do you? Why not delete the ones you aren't using right, or copy them to your computer?

17 April 2000, 05:21 GMT

Re: Feature: Calculating Pi
Dave Stroup
(Web Page)

Gotta love Pi, especially the movie, that was so cool. However, the Fibonacci sequence is also facintating, but then there is the Lucas sequence... but most of all Phi (The Golden Ratio) woo that is some cool stuff. Don't make fun of my intrest in Number Theory.

- Dave
#pi@DALnet

14 March 2000, 04:10 GMT

Re: Re: Feature: Calculating Pi
VoidVector

got to love e the natural log, too, you know

14 March 2000, 04:17 GMT

Re: Re: Re: Feature: Calculating Pi
Native

"got to love e the natural log"

Ohh-yeah
Had more fun deriving it then pi=)

e=(h+1)^(1/h) as h approaches zero
e=infinitysummation of 1/n! starting at n=0

ln(a)=(a^h-1)/h as h approaches zero

logbase b of a =(a^h-1)/(b^h-1) as h approaches zero

Puts a tear in my eye just knowing why e is e.

=)

14 March 2000, 07:31 GMT

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

A *much* more interesting way of finding e is the limit as n approaches infinity of

1/(0!)+1/(1!)+...+1/(n!)

14 March 2000, 21:12 GMT

Re: Re: Re: Re: Re: Feature: Calculating Pi
EvanMath

e=infinitysummation of 1/n! starting at n=0 IS
1/0! + 1/1! ...

14 March 2000, 23:05 GMT

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

Woops, I didn't see that on his post. My bad.

15 March 2000, 02:42 GMT

Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
Jake B
(Web Page)

15 March 2000, 07:16 GMT

Re: Re: Re: Re: Re: Re: Re: Feature: Calculating Pi
KPStuff

you and me both

15 March 2000, 21:58 GMT

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

I love the Fibonacci Sequence.
I also love the song by BT called "Fibonacci Sequence."
Coincidence? I THINK NOT.

And I love number theory too, so you aren't alone ;)

--BlueCalx

14 March 2000, 04:26 GMT

Phi, Psi, and Fibonacci
Grant Elliott
(Web Page)

For those of you who don't know, the nth Fibonacci number is:

(phi^n - psi^n) / (sqrt(5))

Phi = (1 + sqrt(5)) / 2
Psi = (1 - sqrt(5)) / 2

This concludes Grant's excursion into useless number theory. : )

14 March 2000, 20:54 GMT

Re: Feature: Calculating Pi
Hieu-Trung Le
(Web Page)

Wow. I was always wondering how the heck did the people get the number PI from. Now I know. That was a very informative article. Thanks.

btw, sorry this isn't relating to this article, but does anyone of you know how to transfer the file Gfxruins.89z from SMA to your TI89? I can't send it over, when I do, it said that there is an error or something. But sending other files work fine. I know I have lots of memory left. Please help me.

btw, first comment

14 March 2000, 04:10 GMT

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

You know I think the people at ticalc.org change the order of comments so that the person who says "first comment" doesn't get it... A little something to think about.

amicek

14 March 2000, 04:17 GMT

Re: Re: Re: Feature: Calculating Pi
Hieu-Trung Le
(Web Page)

Fine fine I won't put First Comment anymore on my message. =)

14 March 2000, 21:24 GMT

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

use w32trans8x, one of the top downloaded programs on this site. it will enable you to send the file gfxruins.89s - i was having the same problem as well.

14 March 2000, 04:18 GMT

Re: Re: Re: Feature: Calculating Pi
JaggedFlame

i've heard so much about it... is it a good program?

14 March 2000, 23:18 GMT

Re: Re: Re: Feature: Calculating Pi
JaggedFlame

I've heard so much about it... is it a good program? What makes it better than graphlink? :-)

14 March 2000, 23:18 GMT

Re: Re: Re: Re: Feature: Calculating Pi
Seth Peelle
(Web Page)

Ummm... the fact that it can send gfxruins.89z and Graphlink can't? (j/k) ;P

14 March 2000, 23:48 GMT

1  2  3  4  5  6  7

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