This post originated from an RSS feed registered with .NET Buzz
by Eric Gunnerson.
Original Post: Floating Point Arithmetic
Feed Title: Eric Gunnerson's C# Compendium
Feed URL: /msdnerror.htm?aspxerrorpath=/ericgu/Rss.aspx
Feed Description: Eric comments on C#, programming and dotnet in general, and the aerodynamic characteristics of the red-nosed flying squirrel of the Lesser Antilles
Waaaaaay back in college, I spent some time on queueing theory (you know, Poissan
distributions and all that). The most surprising part for me was that a random distribution
of arrivals pretty much ensures that you will have clusters that are very busy, and
times when you are totally idle. Once you work on the math a bit, you understand why,
but our commonplace notion is that "random" should be "smooth".
Incidentally, this also explains why it's so hard to determine whether environmental
factors are causing health issues. You can't just look at a cluster of cancer cases
(for example) and surmise that there is something causing it, since a random distribution
will give you clusters. So you have to do some fairly sophisticated mathematics to
determine whether the cluster is due to random chance or whether there is something
else going on.
If the average person understood this - and they could with some very simple experiments
- it would help science understanding immeasurably. Humans are programmed to extract
patterns from data, and it's not surprising that we see patterns that are really just
random chance.
So, once again, I've digressed a bit, but I assure you that this really does have
something to do with floating point arithmetic. The
point of the journey is not to arrive...
I was talking about clustering, which brings us to the topic of newsgroup questions.
It's not uncommon to not get a specific question for 6 months, and then
get the same question 3 times in a week. The question for this week is "I'm doing
something mathematical, and the answers are wrong."
The problem usually has to do with the fact that the person asking the question doesn't
understand that floating point is an imprecise representation. I got this drummed
into me long ago in my numerical analysis class, where I learned (and promptly forgot)
all about poorly conditioned matrices and the like.