I am using Mathematica 5.2 for Mac. My system is an iBook G4 with 640 MB memory and a 933 MHz processor. Update Feb. 2007: What a whooping change it made to upgrade to a Core 2 Duo, dual core 2.16 Ghz Intel processor!
Monte Carlo Simulation of Pi in Mathematica
Take a look at this notebook… Unfortunately I ran out of memory: 1 GB is not enouth to make a stochastic simulation with n = 100,000,000. I need to get some more RAM and then I’ll get back.
Until then – have a go for yourself – here.
Here you will find a handy list of keyboard shortcuts for Mathematica 5.2. The list covers both Macintosh, Windows and X systems. Print the page and use it for quick reference.
Why use hours on crazy Sudoku puzzles when you can just plug the number into Mathematica and have it solved?!
Here is the notebook from Wolfram.
Numerical Approximation to Pi
Recall that the `upper’ half of the unit-circle can be described by f(x) = Sqrt[1-x^2]. If we approximate the area of the part of this circle that is placed in the upper right part of the Cartesian coordinate system by 10 rectangles, and then multiply the area of these 10 rectangles by 4, we get an approximation to Pi of 2.90452. However, the approximation is not very good, so we need to increase the number of rectangles to, say, 500. Then the approximation is 3.13749. By increasing the number of rectangles to 50,000 the approximation gets closer 3.14155. The method does not seem very effective.
The method is crudely illustrated in the figure below.
If you want to try this yourself, the summing function is
(1/n) Sum[ f(i*(1/n) ]
with f(x) defined above. This sum forms two quations: one with i = 1 to n and one with i = 0 to (n – 1). The former is smaller than pi and the latter is larger than pi. Add the two sums and divide by 2. As n approaches infinity, the sum approaches pi/4.