2011-09-25

SICP Exercise 2.13: Tolerance is Simple

Show that under the assumption of small percentage tolerances there is a simple formula for the approximate percentage tolerance of the product of two intervals in terms of the tolerances of the factors. You may simplify the problem by assuming that all numbers are positive.

Okay, so let's assume we have two intervals, a and b, with centers ca and cb and percentage tolerances ta and tb. We can then say that the widths of a and b are given by:
wa = cata / 100
wb = cbtb / 100
...and so we can express the bounds of our intervals, a and b, as:
a = [la, ua] = [ca - wa, ca + wa]
b = [lb, ub] = [cb - wb, cb + wb]
If we further assume that a and b are non-negative integers (as we defined in the exercise 2.11) then we know that the bounds of the product of the two intervals, ab, are:
  ab
= [lalb, uaub]
= [(ca - wa)(cb - wb), (ca + wa)(cb + wb)]
= [cacb - cawb - wacb + wawb, cacb + cawb + wacb + wawb]
Now as ta and tb are small, we know that wawb will also be small. Let's assume that wawb is close to zero, or at least negligible with respect to the other terms in the lower and upper bounds, and so discard it to give:
  ab
= [cacb - cawb - wacb + wawb, cacb + cawb + wacb + wawb]
≈ [cacb - cawb - wacb, cacb + cawb + wacb]
= [cacb - (cawb + wacb), cacb + (cawb + wacb)]
Note that these bounds take the same form as that of the bounds of an interval expressed in terms of its center point and widths. So we can say that:
cabcacb
wabcawb + wacb
...and so we can express the percentage tolerance as:
  tab
= 100wa/ca
≈ 100(cawb + wacb)/cacb
= 100(cawb)/cacb + 100(wacb)/cacb
= 100wb/cb + 100wa/ca
= tb + ta

No comments:

Post a Comment