All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Eleven Square Roots in a Logarithm (Posted on 2006-09-05) Difficulty: 2 of 5
Presto the Mathematical Magician says, quite correctly, that ln(x), the natural logarithm (to the base e=2.718...) of x, is magically well-approximated by 2047(x1/2048 - 1). Hence logarithms can be calculated with fair accuracy using a primitive calculator that only does square roots along with basic arithmetic.

What is behind Presto's magic?

By the same token, log(x), the common (base 10) logarithm of x, may be approximated by the similar formula K(x1/2048 - 1) for a suitable value of K. For values of x between 1 and 10, explore the accuracy of this approximation, and that of similar formulas of the type K(x1/N-1) where N=2n, under the assumption that a 10-digit calculator is being used to compute the repeated square roots. What values for K and n would you recommend when a 10-digit calculator is being used?

  Submitted by Richard    
Rating: 3.3333 (3 votes)
Solution: (Hide)
Both ln(x) and its approximation are zero when x=1. The derivative of ln(x) is 1/x and that of the approximation is 1/x times the factor (2047/2048)x1/2048 which is nearly unity. So ln(x) and the approximation are the integral from 1 to x of nearly equal integrands. Another way to look at this is to consider y=N(x1/N-1) and solve for x, which gives x=(1+y/N)N which for large N is close to exp(y).

K(x1/2048 - 1) approximates the common log well when K=889. Using the appropriate K and a higher power of 2 instead of 211=2048 would give a more accurate result theoretically, but with a limited-precision calculator, the accuracy of the computed value of the quantity x1/N - 1 would eventually suffer when N=2n increases too far, because the difference of values that are becoming nearly equal is being taken. On a 10-digit calculator, 101/N computes as exactly 1 when N=233, so we can't let n get anywhere near as large as 33. Based on numerical experiments, K=889 and n=11 are good choices when a 10-digit calculator is being used -- for x between 1 and 10, the maximum error is about .0001 in absolute value. Charlie showed in his post that the best results are obtained (five accurate digits) by using 17 square roots and K a little less than 217/ln(10).

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Puzzle AnswerK Sengupta2024-01-21 00:06:15
re(2): Not quite a spoilerJLo2006-09-24 15:25:53
Solutionre: Not quite a spoilervswitchs2006-09-24 04:49:53
Some ThoughtsFew other thoughtsJLo2006-09-10 13:51:06
some thoughtsArt M2006-09-06 17:30:49
For the second part.Charlie2006-09-05 15:55:38
Not quite a spoilervswitchs2006-09-05 14:52:28
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information