Repeated Square Roots and LogarithmsDate: 04/05/2005 at 17:49:35 From: Dave Subject: What is the relationship of repeated square roots to logs I have known of a calculator trick for many years, but never found a good explanation of it: Enter a number 'a'. Repeatedly hit the SQRT key, say N=10-12 times. The result for a positive a>1 will be 1.00000xx. Subtract 1. (=0.00000xx) Multiply by a number 'b'. (=0.0000yyy) Add 1. (=1.0000yyy) Hit the SQUARE key, N times. (Or TIMES and EQUAL) Result will be very close to y=a^b. Try more or fewer 'N'. It appears that reducing the number, including the calculator's roundoff error, to a very small fraction greater than 1 is similar to computing its logarithm to some very small base. Is this well known? Is there a sound explanation? Of course, this also works for numbers <1, but easier to describe as above! For example, using Windows Calculator: 1.02^12 = 1.268241794562545318301696 [Sqrt(1.02)]>>12 = 1.0000048346374915535449341686622 (X-1)*12+1 = 1.0000580156498986425392100239459 [X^2]>>12 = 1.2682337812107872388044137853369 error = -6.3e-4 percent Date: 04/05/2005 at 23:33:54 From: Doctor Peterson Subject: Re: What is the relationship of repeated square roots to logs Hi, Dave. Your insight is excellent! This actually lies at the root (sorry about the pun) of the method used to calculate the first logarithm table. I don't have a full reference available, but these pages answer some questions about that, and give some idea of the method: Briggs on Logarithms http://mathforum.org/library/drmath/view/55600.html Briggs Logarithms http://mathforum.org/library/drmath/view/51432.html Your calculation looks like this: [[a^(1/(2^n)) - 1] * b + 1]^(2^n) What's happening is that, for x VERY CLOSE to 1, x - 1 =~ ln(x) and x + 1 =~ e^x Since the result of your many roots is very close to 1, we can approximate what you've done as [e^(ln[a^(1/(2^n)) * b)]^(2^n) which of course is equal to [e^ln[a^(b/(2^n))]^(2^n) = [a^(b/(2^n))]^(2^n) = a^b So it's not really the fact that you took square roots specifically, but the fact that you did something to transform a to a number close to 1, then approximated a power by using logs, and reversed the transformation. It's a very nice trick, and might be a good way to introduce logs to some students! If you have any further questions, feel free to write back. - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/ Date: 04/06/2005 at 00:58:38 From: Dave Subject: What is the relationship of repeated square roots to logs First off, thank you, Doctor Peterson, for the great explanation and references! I had never followed up on the early development of log tables, so never saw the similarity. I was certain there was a relationship, and have actually used the method a number of times over the years, but it always bothered me. There's another trick there, in raising x to a large integer power. Decompose the exponent to its binary representation. Repeated squarings give x^(2^i). With a memory or RPN calculator, it's easy to accumulate the partial products. x^20 = x^4 * x^16, so x SQR SQR STOR SQR SQR RCL MULT... The effect of x-1 =~ ln(x) reminds one of the near equality of sin() and tan() to small angles expressed in radians. Any other such approximations? Are they possibly even related? Date: 04/06/2005 at 10:01:17 From: Doctor Peterson Subject: Re: What is the relationship of repeated square roots to logs Hi, Dave. Yes, this method is discussed here: Binary Exponentiation http://mathforum.org/library/drmath/view/55603.html I've never worked out a detailed method for doing this on a calculator, perhaps because I usually have one that can do powers, and one that can even display huge numbers can generally calculate them too. But it's of interest to some people, I'm sure! >The effect of x-1 =~ ln(x) reminds one of the near equality of sin() >and tan() to small angles expressed in radians. Any other such >approximations? Are they possibly even related? Yes, in all these cases the idea is that the slope of the function (e^x, ln, sin, tan) is 1 where it crosses an axis, so we can approximate it by a line of slope 1 through that point. In fact, this is one big reason why we use e as a base of logs and radians as a unit for trig: that's what makes the slopes 1! - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/ Date: 04/12/2005 at 18:16:50 From: Dave Subject: What is the relationship of repeated square roots to logs Thanks again--it all makes sense now. I finally returned to the question today, and it can all be clearly defined: Taking the square root of 'x' 'N' times, then subtracting 1 produces the logarithm of x to the base 2^N. Adding 1 and squaring N times produces the antilog to the same base, or y^(2^N). The only remaining point of interest is that there is a "best" value of N, for any given calculator, related to its internal truncation. Date: 04/12/2005 at 22:21:30 From: Doctor Peterson Subject: Re: What is the relationship of repeated square roots to logs Hi, Dave. That last point is certainly true, though I haven't put any thought into how one would determine the best N for a particular x. You would want to repeat the root enough times so that the approximation of the log would be good, yet not so many times that accumulated errors would make the approximation worse. As for your summary of the process, it could be read as meaning something incorrect, so I'd want to clarify. The result of the first half is a logarithm, but not the logarithm of the number we started with, as you appear to be saying. Rather, we started with some number "a" and took the root N times, resulting in a number "x" that is close to 1; subtracting 1 from x then approximates the natural log of x (not of the number we started with); after multiplying to get y = b*x, adding 1 approximates e^y, undoing the log, and squaring N times takes us back to the original domain, so that the result is a^b. The role of the roots and the squaring is to move the problem, reversibly, to a domain close to 1, so that we can _then_ work with logs. - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/ Date: 04/13/2005 at 00:40:11 From: Dave Subject: Thank you (What is the relationship of repeated square roots to logs) D'oh! Sorry, that came of posting in haste, after a rough calculation. I left out a key step! I started with the formula for changing base: LOGb(x) = LN(x) / LN(b) LOGb(2) = 0.000677131-, for x=2, after 10 roots and subtracting 1. 0.000677131- = LN(2) / LN(b) LN(b) = 0.693147+ / 0.000677131- = 1023+ So, the base of the pseudo-log is e^(2^N), not 2^N as I said. Does that sound better? And that's the other error, in my original question. The result is a log to a very *large* base, not a very small one. Date: 04/13/2005 at 15:04:25 From: Doctor Peterson Subject: Re: Thank you (What is the relationship of repeated square roots to logs) Hi, Dave. I'd never seen it from this perspective, thinking of the whole process as taking a log to some different base; I was satisfied just seeing it "in the small", so I missed your point of view, and didn't even notice that you mentioned a particular base, right or wrong! Here is how I would demonstrate that we are indeed taking such a log: The process (before you multiplied and then reversed the process) can be represented as a^(1/(2^n)) - 1 which is approximately ln[a^(1/(2^n)] Expanding this, it is 1/(2^n) * ln(a) = ln(a)/ln[e^(2^n)] = log_[e^(2^n)](a) That's what you're saying, and I see it now! - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2015 The Math Forum
http://mathforum.org/dr.math/