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

Home > Algorithms
Root Route (Posted on 2004-06-29) Difficulty: 3 of 5
Develop an efficient algorithm to find the square root of a positive real number.

No Solution Yet Submitted by Gamer    
Rating: 2.2000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Infinite methods | Comment 6 of 7 |
Take (x+1) to any natural power; say, (x+1)^6= x^6 +6x^5 +15x^4 +20x^3 +15x^2 +6x^1 +x^0.

Now take odd positions (x^6 +15x^4 +15x^2 +x^0) and even positions (6x^5 +20x^3 +6x^1). Add powers of n, as follows: x^6 +15x^4n^1 +15x^2n^2 +x^0n^3 and 6x^5 +20x^3n^1 +6x^1n^2. (a^bc^d means a^b times c^d.)

Now, if you start with x=n, and then iterate letting x become (x^6 +15x^4n^1 +15x^2n^2 +x^0n^3)/(6x^5 +20x^3n^1 +6x^1n^2), the iteration will converge to √n.
Edited on July 2, 2004, 2:07 pm
  Posted by Federico Kereki on 2004-07-02 14:00:14

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 (0)
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