Square root without a calculator algorithm

160 Views Asked by At

Out of curiosity I'm trying to find an effective algorithm to find the value of a square root of a number(a) without a calculator. I'm trying to find a solution without searching it up. What I have so far: $$ \sqrt{a} = a^{1/2} $$ $$ a^2 = a.a $$ $$ a^3 = a.a.a $$ $$ a^n = a x .\cdots .n $$ All I need to know is what will $a^{1/2}$ equal to?

I tried: $$ a^{1/2} = a . \frac{a}{2} $$ $$ a^{1/2} = (a.a)/a $$

But these are definitely wrong

5

There are 5 best solutions below

1
On BEST ANSWER

Use the Newton_Raphson Method $$x=\sqrt{a}\rightarrow x^2-a=0$$ or $$y=x^2-a$$ $$x_{i+1}=x_i-\frac{y}{y'}$$ $$x_{i+1}=x_i-\frac{x_i^2-a}{2x_i}=\frac{x_i^2+a}{2x_i}$$

0
On

If you start with a somewhat good guess $y$ for$\sqrt a$, then $\frac{y+\frac ay}2$ will be a significantly better guess ...

0
On

you can see that $x=\sqrt{a}$ is a solution of $x^2-a=0$, so you could apply the bissection method on the function $f(x) = x^2-a$, like

$a = 2\\ a_1 = 1, a_2 = 4\\ f(a_1)=1^2-2=-1\\ f(a_2)=4^2-2=16-2=14\\ x = \frac{a_1 + a_2}{2}=\frac{1+4}{2}=2.5\\ f(\frac{5}{2})=4.25\\ a_1 = 1, a_2 = 2,5\\ ...$

so you repeat a similiar process acording the precision you wanting to get

0
On

Via the Babylonian method mentioned by Mefitico (input your initial guess as $1$ or $x$ for this):

$$\sqrt x =\lim_{n\to\infty}\biggr[\frac{\sum_{r=0}^{2^{n-1}}{\binom{2^n}{2r}x^r}}{\sum_{r=0}^{2^{n-1}-1}{\binom{2^n}{2r+1}x^r}}\biggr]$$

0
On

A square root can be quickly converted to small square roots:

Square Root of C = Square Root (C / (2^n)) * Square Root (2^(n-1) * 2)

with C >= 2^n and C < 2^(n+1) .

Also, Square Root (2^even_number) = 2^(even_number / 2) .