Let’s demonstrate the method with an example. Consider computing the square root of n=33. We start by finding a number that forms a perfect square that is close to 33. Here, let’s pick g=6, since 62=36. Then we compute a second number, b=n/g. In practice, computing b in your head may require an approximation. Here, we can compute it exactly as 33/6=5.5. Then our final guess is the average of these two numbers or
n≈2g+b,(1)
which in our example is
33=5.74456264654…≈26+5.5=5.75.(2)
That is pretty good. The relative error is less than 0.1%! And furthermore, this is pretty straightforward to do in your head when n isn’t too large.
Estimating Square Roots in Your Head
from Gregory Gundersen
Filed under:
Same Source
Related Notes
- The student who overcomes this problem might learn the following us...from plover.com
- Hashing, crypto-safe (64 bytes) 500 ns 200 MiB/s [[Napkin Math fr...from sirupsen
- Random Memory R/W (64 bytes) 50 ns 1 GiB/s [[Napkin Math from sir...from sirupsen
- As we think about it this way, we realize that the closer ⍴ gets to...from brooker.co.za