**Exercise 2.9: ** The *width *of an interval is half of the difference between its upper and lower bounds. The width is a measure of the uncertainty of the number specified by the interval. For some arithmetic operations the width of the result of combining two intervals is a function only of the widths of the argument intervals, whereas for others the width of the combination is not a function of the widths of the argument intervals. Show that the width of the sum (or difference) of two intervals is a function only of the widths of the intervals being added (or subtracted). Give examples to show that this is not true for multiplication or division.

Addition:

Subtraction:

Multiplication:

If any of the four intervals expressions are used as interval endpoints their width formula will not give the tidy results of addition/subtraction.

Division:

Examples:

w_{1}=0.68

w_{2}=0.235

w_{total}=0.915

> (print (add-interval (make-interval 6.12 7.48) (make-interval 4.465 4.935)))

*[10.585,12.415]*

w_{actual}=0.915

w_{1}=0.68

w_{2}=0.235

w_{total}=0.915

> (print (sub-interval (make-interval 6.12 7.48) (make-interval 4.465 4.935)))

*[1.1850000000000005,3.0150000000000006]*

w_{actual}=0.915 (ignoring the floating point number errors)

w_{1}=0.68

w_{2}=0.235

w_{naive_total}=0.15980

Of course this doesn’t make sense since accuracy cannot be magically gained by multiplying two interval together. More on this in the division example.

> (print (mul-interval (make-interval 6.12 7.48) (make-interval 4.465 4.935)))

*[1.1850000000000005,3.0150000000000006]*

w_{actual}=4.794

w_{1}=0.68

w_{2}=0.235

w_{naive_total}=2.89361702127659574468

> (print (div-interval (make-interval 6.12 7.48) (make-interval 4.465 4.935)))

*[1.2401215805471126,1.6752519596864504]*

w_{actual}=.2175651895696689

How is it that w_{actual} is smaller than each w_{1}, w_{2}? w_{naive_total} is just plain wrong and should be discarded.

The answer is that w_{actual} isn’t smaller. It’s actually larger. The percentage of error that w_{actual} represents, for it’s interval, is actually greater than either w_{1}=10% and w_{2}=5%. w_{actual} = 14.9%.

As expected the error is actually higher even though the aggregate number for w_{actual} looks smaller.