You can approximate irrational square roots with rational numbers using linear interpolation between the integers as follows:
√1 = 1
√2 ≈ 4/3
√3 ≈ 5/3
√4 = 2
√5 ≈ 11/5
√6 ≈ 12/5
√7 ≈ 13/5
√8 ≈ 14/5
√9 = 3
etc...
How good an approximation is this?
For large numbers, might the previous or next fraction be a better approximation?
Interesting problem.
Let y be an integer between (x-1)^2 and x^2, say (x^2-n)
Then y^(1/2)≈x-n/(2x-1).
The gap between x^2 and (x-1)^2 = 2x-1, and the function is most inaccurate at mid range, say n=x.
However:
(x^2-x)^(1/2)-(x-x/(2x-1)), x=10^n, is only out by around 1 part in 10^(n+1)
x=10: 0.0131 (y between 82 and 100)
x=100: 0.00125 (y between 9802 and 10000)
x=1000: 0.000125 (y between 998002 and 1000000)
etc.
Hence, the function becomes very accurate for large y.
Edited on February 17, 2015, 9:12 pm
|
Posted by broll
on 2015-02-17 21:01:15 |