10.07.2015 Views

Plane Geometry - Bruce E. Shapiro

Plane Geometry - Bruce E. Shapiro

Plane Geometry - Bruce E. Shapiro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

248 SECTION 44. ESTIMATING πnums = hexit/@Range[0,11];dens = (16.^#)&/@Range[1,12];Plus@@(nums/dens)which returns the valueπ − 3 ≈ 0.14159265358979312Buffon’s NeedleThis method calculates π experimentally via a Monte-Carlo simulation; itwas invented in 1777 by GL Leclerc de Buffon (1707-1788). The idea isto drop an object of length L on a surface that contains parallel lines adistance S units apart, where S > L (Buffon used needles). If the object isdropped n times and x times it falls crossing a line, thenπ ≈ 2nLxSThis approximation is technically only correct in the limint as n → ∞, andis derived from a calculation of the probability of hitting the line. 6 Theproblem with this method is that it takes a very long time to get veryfar; calculating every 3 digits accurately requires over a million throws,and the number of throws required increases exponentially with the numberof digits. One mischievous implementation describes this technique as“calculating pi by throwing frozen hot dogs.” 7Modern ComputationsMost modern computer languages have some approximate value implementedfor π. In most cases the value is a preset constant that is limited tomachine accuracy, typically to around 16 digits. To obtain more digits onemust implement some algorithm to actually calculate π. A few computerlanguages have such an algorithm built it.For example you can compute π to n digits in Mathematica with N[Pi,n]; for example, N[Pi,10^6] will compute the first one-million digits inapproximately 3.7 seconds (on a 2.4 GHz core 2 quad processor). Printingit will take a bit longer; assuming you can fit 80 digits per line and 50lines per page it will fill up 150 pages. Mathematica uses the Chudnuvsky6 See the Mathworld article at http://mathworld.wolfram.com/BuffonsNeedleProblem.html for a derivation.7 http://www.wikihow.com/Calculate-Pi-by-Throwing-Frozen-Hot-Dogs« CC BY-NC-ND 3.0. Revised: 18 Nov 2012

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!