Re: Possreps and numeric types

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Tue, 27 Mar 2007 03:12:23 GMT
Message-ID: <rY%Nh.15850$PV3.163542_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:
> On Mar 26, 1:40 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>

>>Try to keep in mind that computers are finite artifacts. As long as they
>>remain so, we will have to contend with largest representable numbers
>>and smallest representable differences.

>
> Sure.
>
> However it does not follow from that that it is impossible
> to represent *any* number precisely.

Basically, you are saying you want your rational number representation to be some fractal-like space with a finite number of valid but exact values swimming in an infinite sea of error conditions (after exhausting all resources.)

I don't see the utility. Can you justify what you are asking for?

I would expect that adding two numbers that are very near to 1 will result in an answer that is very near to 2. I find that a lot more useful than waiting for my computer to exhaust all available resources then tip over with an error message.

Computers are finite. Measurements have errors. We make do by arbitrarily choosing a convenient number in some small range of values to represent the entire range. What's the big deal?

> We are perhaps speaking across each other with regards
> to the issue of the set-of-all-rationals, and specific rationals.
>
> Let R(x) mean "x is exactly representable in a computer under
> a given model M."
> Let Q be the set of rational numbers.
>
> Proposition A - there is some rational number that is not
> representable:
> exists x in Q: not R(x)
>
> Proposition B - there are no rational numbers that are representable:
> not exists x in Q: R(x)
>
> Clearly B does not follow directly from A. B may be
> *true* but it is certainly not an implication of A.
>
> I accept A. Proof:
>
> { x | R(x) } is a finite set, because a computer has a finite
> number of states. Q is an infinite set. Therefore we can
> conclude proposition A because of the pigeonhole principle.
>
> I also claim proposition C - some rational numbers are representable:
> exists x in Q: R(x)
>
> Propositions A and C are consistent.
>
>
> An alternative perspective:
>
> Consider 32 bit numbers. Consider addition, subtraction,
> and multiplication defined over these numbers such that
> the result is the standard twos complement result, unless
> there is an overflow or underflow, in which case the result
> is a fault. (I believe that many CPUs support the necessary
> instructions to do this fairly cheaply, although few compilers
> take advantage of this fact.)
>
> Any set of operations under the above system will do
> one of two things:
>
> 1) exactly model the behavior of the Integers
> 2) fault
>
> Not every Integer is representable under the above
> system. But that's a necessary condition; there is
> *no* system possible which will represent
> all possible Integers.

A world of difference exists between a system that faults at the extremes of some large range and a system that faults arbitrarily and unpredictably throughout every range of interest.

> Now, it is possible that one might attempt to solve
> some complex formula, and get a fault. If you get
> a fault, all bets are off, you really can't say anything
> about what happened. However, if you *don't* get
> a fault, you have a valid, precise result that faithfully
> models the arithmetic of the Integers.
>
> This has some specific implications. For a simple
> example:
>
> for all x, y, z in Z, evaluating the below equation
>
> (x+y)+z = x+(y+z)
>
> will yield either true or fault. Under floating point
> arithmetic, that is not the case; associativity,
> perhaps the second simplest algebraic property
> in existence, does not hold.

When epsilon is proportional to N, as is the case with floating point representation, one loses associativity when some values are comparable to the epsilon of other values. However, this observation regarding floating point does not make epsilon vanish for rationals in any other representation.

> Marshall
>
> PS. In fact, even the above claim is too strong. Cosmic
> rays can cause CPUs to fail in ways they can't detect.
> So really no one ever knows anything absolutely. However
> I still feel that some systems are better than others.

I find utility, reproducibility and predictability important criteria for good systems. What criteria do you use? Received on Tue Mar 27 2007 - 05:12:23 CEST

Original text of this message