[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: ruby-math and "why is ** not abelian?"
From: "Josef 'Jupp' SCHUGT" <jupp () gmx ! de>
Date: 2004-01-29 20:58:33
Message-ID: 20040129161208.GC2208 () jupp%gmx ! de
[Download RAW message or body]
Hi!
* Van Jacques:
> Why is " Neither (Float, +) nor (Float, *)" a group?
The associative law is violated. Using machine numbers
(a + b) + c = a + (b + c)
does not hold for all machine numbers a, b, c. Proof is by
counterexample.
Simply Assume a = 1.0 and b, c = 0.6 * eps where eps is the smallest
number that added to 1.0 results in something different from 1.0.
(a + b) results in 1.0 because b is smaller than eps and so (a + b) +
c results in 1.0 as well.
(b + c) results in a number larger than eps so a + (b + c) is larger
than 1.0.
Similar holds for multiplication (it is more complicated so I only
sketch the proof): If a is a huge number and b and c are tiny numbers
the product of b and c can be zero so that a * (b * c) is zero as
well while a * b can still be a number that multiplied by c does not
result in zero.
To put it that way: The most challenging tasks in numerical
mathematics is providing an error estimate. Unfortunately it is one
of the most important as well.
It is often important to know how precisely a value is known. What
happens if one falsely assumes a precision that is not present shows
the Mars Polar Impactor.
Josef 'Jupp' SCHUGT
--
http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby-FAQ
http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Germany 2004: To boldly spy where no GESTAPO / STASI has spied before
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic