Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Saturday, September 19, 2009

Well, It Didn't Just Happen ...

Probability is one of those things that people are just not very good at unless trained. There are probably some good reasons why evolution didn't help us come with the intrinsic Calculators of Large Numbers we would need to not be misled so easily.

Psychologically, we seem to be much more attuned to the false positives in our data gathering than to the false negatives. Of course, interpreting a rustle in the grass as a possible snake and taking action is much more prudent (in terms of survival) than to dismiss the rustle of a snake as just the wind. Combining this tendency with inadequate number-crunching skills leads us down many a garden path (or blind alley.)

Coincidences fool us all the time. The Gambler's Fallacy helps drain bank accounts every day. Lucky numbers become signposts on our journeys. Superstitions are usually born from misunderstood coincidences.

The folk over at QualiaSoup have addressed this issue with another fine video that begins with one of my favorite examples, the Birthday Paradox. The Birthday Paradox, of course, isn't really a paradox but just something that is counter-intuitive — which just shows how our intuitions about probability aren't very good.

Friday, February 20, 2009

For Most Purposes, 355/113 Is Close Enough

Do you have problems remembering the value of pi beyond 3.14?  Or is your calculator lacking the pi key?

Just remember the fraction 355/113 -- it gives the value of pi accurately to 7 decimal places. 3.14159269... The second 9 is where it breaks down, it should be a 5 as you can see in the following truncated 'true' value:

3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510

But how close is that? Is it close enough?

Obviously, closeness depends upon what you are calculating.  Let's work with the size of the earth. According to About.com, the diameter of the earth is 7,926.28 miles at the equator. (We won't worry about the irritating fact that the earth is not a true sphere but one slightly squashed at the poles.)

Using the above fraction and the value returned by the Excel pi() function, we get values of 24901.1451327434 and 24901.1430182957 for the distance in miles around the equator ( C = pi * D ).  The difference between the two is about 0.00211 miles or about 11.16 feet too long using the 355/113 method.  Or about 0.000008% off.  Sounds like 355/113 is close enough for government work.

Note 1: When doing calculations with mixed multiplications and division -- such as 7926.28 * 355 / 113, make sure you do all the multiplications before you do any divisions.  This will minimize the effects of accumulating round-off errors.

Note 2: When writing the Handyman program for the Color Computer which had no floating point math hardware, I used this method in calculating circular areas such as windows and rugs.  Handyman was an early do-it-yourself home calculator program figuring paint, wallpaper, flooring, etc. needs.

Note 3: 355/113 is the most accurate rational approximation with a denominator less than 10,000.

Note 4: According to Wikipedia, a value of pi "... a value truncated to 11 decimal places is accurate enough to calculate the circumference of the earth with a precision of a millimeter, and one truncated to 39 decimal places is sufficient to compute the circumference of any circle that fits in the observable universe to a precision comparable to the size of a hydrogen atom."  Use the 50-place value given above if you need more accuracy in your work.

The Out Campaign: Scarlet Letter of Atheism
free debate