Incremental weight in beef, turkey, tofu, and/or other vegan substitutes? And height; penny-farthing or tiny clown cycles?
Consider this iterative equation...
x2 = (x1 + N / x1) / 2
N = number whose root is to be found
x1 = initial estimate of root
x2 = improved estimate of root
We make a guess of the root, x1, plug it into this equation and get an improved estimate, x2. If this estimate isn't good enough for out purposes, we set x1 = x2 and repeat the process to get an even better estimate. This iterative procedure is repeated until x2 squared is close enough to N to satisfy our requirements.
An example will demonstrate. Let's find the square root of 6 (for reference, my calculator says 2.44949). Six is between 4 (2 squared) and 9 (3 squared) so a reasonable guess for x1 might be 2.5. Then
x2 = (2.5 + 6/2.5)/2 = 2.45 (squared = 6.00250)
Very close but let's do one more iteration...
x2 = (2.45 + 6/2.45)/2 = 2.44949 (squared = 6.00000026)
which would be good enough for most purposes.
I can hear you saying, "Yeah, but you picked an initial guess that was very close to the actual value!" A valid objection so let's try it with an initial guess that's downright silly, 7. Remember, 7 squared is 49, and that's far enough from 6 that even a schoolkid would know it's not a good choice. In addition, the square root of a number can never be greater than the number so, since 7 is greater than 6, choosing it as a first guess is particularly dumb.
x2 = (7 + 6/7)/2 = 3.9286
x2 = (3.9286 +6/3.9286)/2 = 2.7279
x2 = (2.7279 + 6/2.7279)/2 = 2.4637
x2 = (2.4637 + 6/2.4637)/2 = 2.4495
which, squared, is 6.0002..., close enough for the work I do. So, even with a laughable initial guess we got five significant figures in only four iterations. Clearly, one doesn't need to be a genius mathematician to make useful guesses.
Of course, today most four-banger calculators have square root keys. My question is, why ? The average four-banger user wouldn't know a square root from a rutabaga.
FEM2008 (Aug 17, 2020)
That's the fack Jack.
I cut corners these days too and just look it up to acceptable precision on my slide rule (the batteries have never failed). In nearly all cases you're working with an error band of 10% or more in the source data so solving to analytic precision is usually a pointless exercise. For that matter I still use 22/7 for pi but Newton's method is new to me and I see that it works well.
I'm still pondering over furlongs per fortnight.
If you can't make it precise make it adjustable.
toeless joe (Aug 17, 2020)
Karl_H (Aug 17, 2020)
(where ist horizontal calibration is precisely scaled in "fortnights per furlong"):
"A precision, laboratory oscilloscope, calibrated directly in practical English units of measure,
has been announced by Tektronix-Guernsey, is claimed to be the first and only oscilloscope using English measure units exclusively."
Disclaimer: -This pamphlet is for informative/ recreational purposes only -
and SHOULD NOT be used instrumentally in health-critial applications.
If you use rational fraction approximations for pi, the Tsu Chi form, 355/113, is far more accurate than 22/7. There are other approximations that are even more accurate as this extract from my notes shows...
APPROXIMATING PI = 3.1415926535898
Biblical approximation: 3 (4.5%)
"And he [Hiram] made a molten sea, ten cubits from the one rim to the other it was round all about, and...a line of thirty cubits did compass it round about....And it was an hand breadth thick...." — First Kings, chapter 7, verses 23 and 26
22 / 7 = 3.142857142857 (0.04 %)
22 / 7.0028 = 3.141600502656 (0.00025 %)
Tsu Chung Chi approximation: 355 / 113 = 3.141592920354 (0.0000085 %)
Euler: 103993 / 33102 = 3.141592653012 (-0.000000018 %)
Ramanujan's improvement to Chi: (355 / 113) * (1 - 0.0003 / 3533) = 3.14159265359 (below calculator range)
Ramanujan's first term in fast series for pi: 9801 / [1103 * sqrt(8)] = 3.141592730013 (0.0000024 %)
Ramanujan: (63 / 25) * [(17 + 15 * sqrt(5)) / (7 + 15 * sqrt(5))] = 3.141592653806 (0.000000007 %)
Fourth root: (2143 / 22)^(1/4) = 3.14159265258 (-0.000000032 %)
Four bangers, despite having a square root key, usually lack the far more useful pi key, so knowing some easy approximations is a good thing.
Newton's technique of iterating to find other roots can easily be generalized. For the nth root of N, the equation is:
x2 = [(n - 1)*x1 + N/x1^(n-1)]/n
which, for n = 2, reduces to the equation shown in my previous post.
The convergence is at least quadratic in a neighborhood of the zero, which intuitively means that the number of correct digits roughly doubles in every step. For faster convergence, one can use Halley's method which exhibits cubic convergence.
I learned doing sq.roots the old fashioned way and have since purged it out if my memory as well. However, my son showed me how to do it using Newton's method at age 12. So, they're not all getting dumber! But then, he's a lot smarter than I ever was; has won 35 awards and 2 international tournaments in robotics, 5 science olympiad awards, and was in Forbes magazine by age 13 !!
There are currently 1 users browsing this thread. (0 members and 1 guests)