Wednesday, May 5, 2010

2.13

Pardon the lazy formatting(time spent writing blog = time not spent figuring stuff out!)

I've been using Ken's answers to check mine but unfortunately it turned out his answer for 2.13 was wrong(upon checking against real numbers). 
The resultant tolerance of two intervals is going to be

tab=(ta+tb)/(1+ta*tb)


Edit: as it turns out, the question is "Assuming small tolerances". Which means that ta*tb is close to 0 or negligible, which would of course mean that
tab = ta + tb

I still think the way I figured it should be easier to follow so I'm going to leave this up

You can check it by just making a couple of intervals using the procedure from exercise 2.12, multiplying them and getting the percent:
> (define a (make-center-percent 10 20))
> (define b (make-center-percent 25 5)
> a
(8 . 12)
> b
(23 3/4 . 26 1/4)
> (define ab (mul-interval a b))
> ab
(190 . 315)
> (percent ab)
24 76/101

so we have 20 and 5 -> 24 76/101

(0.2+0.5)/(1+0.2*0.05)
->0.24752475247524752475247524752475


Here's what I figured for exercise 2.13:

So long as percentage not over 100% All numbers stay +

int1 * int2
Result is:

lower: a-min * b-min
upper: a-max * b-max

tolerance1 = (a-max - a-min)/2 / (a-max - (a-max-a-min)/2)
lets call (a-max - a-min)/2 the "variance"

tolerance = variance/(int-max - variance)

in resultant interval ab the interval is

(a-min * b-min , a-max * b-max)

the variance is thus
(a-max*b-max - a-min*b-min)/2

and tolerance is
((a-max*b-max - a-min*b-min)/2) / (a-max*b-max - ((a-max*b-max - a-min*b-min)/2)))


We can also say
a-max = center-a * (1+tolerance-a)
a-min = center-b * (1-tolerance-a)


So tolerance a*b is:

calling tolerance-a=ta and tolerance-b=tb for simplicity

(removing center-a*center-b as everything shares it
((1+tolerance-a) * (1+tb) - (1-ta) * (1-tb) / 2) /
(1+ta) * (1+tb) - ((1+ta) * (1+tb) - (1-ta) * (1-tb) / 2))

just analyzing the top pert we get:

((1+ta) * (1+tb) - (1-ta) * (1-tb) / 2)

=> ((1 - 1) + (ta*tb - ta*tb) + ta + tb + ta + tb) /2
=> ta + tb

substituting back to full equation:

ta+tb / ((1+ta+tb+ta*tb) - (ta+tb))

=> ta+tb / (1+ta*tb)

No comments: