sicp-ex-2.16


We have observed in SICP Exercise 2.14 and 2.15 that equivalent algebraic expressions may lead to different answers. I think it is because an interval that appears multiple times in an expression will behave independently though they should behave exactly the same way.

Can we devise an interval-arithmetic package that does not have this shortcoming? The authors of SICP warned us of the difficulty of this problem. But talk is cheap. So I will still try to say something.

We should take Eva Lu Ator’s suggestion (SICP Exercise 2.15) to avoid repeated appearance of intervals. Remember the Taylor expansion: f(x,y) \approx f(x_0,y_0) + \frac{\partial f}{\partial x} \Delta x + \frac{\partial f}{\partial y} \Delta y. Maybe we could design a system which utilizes the Taylor expansion, assuming that percentage tolerances are small. To compute the resulting center of an expression, we perform normal arithmetics on the centers of argument intervals. Then we compute the partial derivatives by varying the value of one interval while keeping the others fixed. Finally we combine the partial derivatives and percentage tolerances together to obtain the resulting percentage tolerance. For really complicated systems, we could also perform Monte carlo simulations to get an answer that is good enough.

Clav

Also, wikipedia's article on interval arithmetic is very iluminating. It explains why we obtain different tolerances mapping the equations to a multidimensional space, and showing how the maximum and minimum of x² + x and x² + y are not the same.


Ergomaniac

This page shouldn't exist, for the full discussion of 2.14-2.16, see http://community.schemewiki.org/?sicp-ex-2.14-2.15-2.16