Why do these seemingly identical calculations give different answers?

88 Views Asked by At

Consider the two equations:

$\dfrac{3}{2}\sqrt 2\approx \dfrac{543}{256}$ and $\dfrac{3}{\sqrt 2} \approx \dfrac{543}{256}$

The left-hand sides of both are equivalent so it seems like they should yield the same value when approximating $\sqrt 2$.

For the first equation: $$\sqrt 2 \approx \dfrac{543}{256} \cdot \dfrac{2}{3} = \dfrac{181}{128}$$

For the second equation: $\sqrt 2 \approx 3 \cdot \dfrac{256}{543}= \dfrac{256}{181}$

The results are close in value but not the same.

Why do these methods give different results?

2

There are 2 best solutions below

0
On

Think of this problem from a perspective of error propagation. We can formulate two equations

$$f(\varepsilon)=\sqrt{2} = \dfrac{2}{3} \dfrac{543}{256} + \varepsilon$$ $$g(\varepsilon)=\sqrt{2} = \dfrac{3}{\dfrac{543}{256} + \varepsilon}$$

The sensitivity of with respect to changes in $\varepsilon$ is given by

$$\Delta f \approx \Delta\varepsilon$$ $$\Delta g \approx \dfrac{3}{\left[\dfrac{543}{256} + \varepsilon\right]^2}\Delta \varepsilon.$$

As you can see the first expression scales linearly with $\Delta \varepsilon$. The second equation does not scale linearly. Hence, we have different behaviors.

0
On

Why should they be the same?

$\frac {543}{256}$ was an approximation then the results should be approximations, not exact values.

Let's suppose that $\frac 32\sqrt2 = \frac 3{\sqrt 2} = w$ exactly but $\frac 32\sqrt2 = \frac 3{\sqrt 2}\approx a$ is an approximation. Now let's suppose the approximation is off by $\epsilon$ so that:

$\frac 32\sqrt2 = \frac 3{\sqrt 2} = a + \epsilon$.

Okay... so

By $\frac 32\sqrt 2 = a + \epsilon$ we get $\sqrt 2 = (a +\epsilon)\frac 23 = \frac 23a + \frac 23 \epsilon$. So $\frac 23a$ is (apparently) a close approximation of $\sqrt 2$.

And by $\frac 3{\sqrt 2} = a + \epsilon$ we get $\sqrt 2 = \frac 3{a+\epsilon}=\frac {3\frac aa + 3\frac {\epsilon}a- 3\frac {\epsilon}a}{a+\epsilon} = \frac 3a - \frac {3\epsilon}{a(a+\epsilon)}$. So $\frac 3a$ is also (apparently) also a close approximation.

However one is off by $\frac 23\epsilon$ and the other is off by $- \frac {3\epsilon}{a(a+\epsilon)}$. Apparently these are small amounts to be off by. But the are not equal amounts to be off by.

====

FWIW

$w$ to about 25 or so decimals is $2.1213203435596425732025330863145$ and $a$ is $2.12109375$, so $\epsilon =0.0002265935596425732025330863145$ to 25 or so decimals.

So the error $\frac 23 \epsilon$ is about $1.5106237309504880168872420966667e-4$ and the error $-\frac {3\epsilon}{a(a+\epsilon)}$ is about $-1.5107851088285175079746363557438e-4$. Both errors are close. But they aren't the same.