Explain, in general, why equivalent algebraic expressions may lead to different answers. Can you devise an interval-arithmetic package that does not have this shortcoming, or is this task impossible? (Warning: This problem is very difficult.)
Identifying equivalent expressions requires some notion of reflexivity:
Our interval arithmetic implementation lacks a concept of identity that would enable it to return (1 . 1)
for operations such as (div-interval a a)
.
Including an id
field in make-interval
would fix basic calculations but not the problem that Lem found.
For that, expressions would have to be syntactically refactored upon submission, or analyzed by a parser to track variable use across an expression.
Another option would be using Monte Carlo methods to simulate many draws from a uniform distribution to calculate a statistic (sample mean) of the distribution of the resulting random variable.