[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues

Oren Tirosh oren-py-d@hishome.net
Thu, 3 Oct 2002 12:56:02 -0400


On Thu, Oct 03, 2002 at 12:13:33PM -0400, Andrew Koenig wrote:
> Oren> On Thu, Oct 03, 2002 at 09:05:03AM -0400, Andrew Koenig wrote:
> Oren> Any calculation involving a floating point number should taint
> Oren> the result with inexactitude and yield a floating point result.
> >> 
> >> Even comparisons?
> 
> Oren> Comparisons could produce a third boolean value called 'Undetermined':
> 
> I wonder what would be the definition of sort in the presence
> of such comparisons?  Would it be possible to implement it
> efficiently?

That depends on the exact constraints of this lossy ordering. But let's
take it even further!  Let's define fuzzy booleans! an a completely
Undetermined result is 0.5, meaning the comparison yielded zero
information about the order of the two inputs but if their intervals of
uncertainty are only partially overlapping we could get an estimate of
the probability that A is greater than B. No, wait! to get better
probability estimates we can define each floating point number as a CDF.
This will give us information not only about the interval of uncertainty
but about the actual distribution of errors. Uniform intervals are, after
all, just a special case - we might want to represent numbers with
gaussian errors, etc. I know it will be very useful for me in signal
processing to add the gaussian noise, run the signal through a simulation
of the error correction algorithm, have each undetermined comparison 
explore both branches in simulated parallel universes and sum the 
results according to their probabilities.

I am a bit concerned about the performance or simple operations like
addition when they require arbitrary precision convolutions of
distribution functions, though. 

	Oren