$10^9 \times \sqrt{3}$ what are first two digits after the decimal point?

408 Views Asked by At

Because of floating point error, my computer basically says $10^9 \sqrt{3} \approx 1.73205 \times 10^9$ so that if we ignore the numbers before the decimal point, the fractional part is: $$\{ 10^9 \sqrt{3} \} = 0$$

That's obviously wrong. As the algorithm progresses, the program keeps losing accuracy, effectively getting the error I just described. if I type it directly we get the correct answer:

$$ 10^9 \sqrt{3} = 1732050807.\color{#00D000}{56}88772$$

but the computer doesn't store all these digits forever. I could like to know how to get the first two decimal places without a calculator.

4

There are 4 best solutions below

0
On BEST ANSWER

The actual error $997489097* \sqrt 3 = 1727701796.0$ Nothing after the decimal point. Kid you not.

You have found a "good" rational approximation for $\sqrt 3$ and in this case that's not really surprising to get a string of $0$s after the decimal point about as long as the integer coefficients.

For example, look at the numbers

$x_n = (2+\sqrt 3)^n(1+\sqrt 3)$ and $y_n = (2-\sqrt 3)^n(1-\sqrt 3)$

$x_ny_n = -2$, so while $x_n$ gets very large, $y_n$ gets very small.

Expanding $x_n$ you get $x_n = a_n + b_n\sqrt 3$ where $a_n$ and $b_n$ are some positive integers.

Then $b_n\sqrt 3 = a_n - (a_n - b_n \sqrt 3) = a_n - y_n$.

For example with $n=15$, you get

$299303201\sqrt 3 = 518408351 - y_{15} = 518408351.00000000192898\ldots$


Your example is obtained with $x = (8+15\sqrt 3)(2+\sqrt 3)^{14} = 1727701796+997489097 \sqrt 3$

so that $997489097 \sqrt 3 = 1727701796 - (8-15\sqrt 3)(2-\sqrt 3)^{14} = 1727701796.000000176824\ldots$

which is less "impressive" because $(8+15\sqrt 3)$ has norm $-611$ while $(1+\sqrt 3)$ has norm $-2$.

1
On
0
On

One approximation can start from the square of a sum formula:

$(a+b)^2\approx a^2+2ab$ when $ a >>> b$

That gives you:

$b \approx ((a+b)^2 - a^2)/2a$

So, if you have an estimate good to some number of places (say $n$), the approximation above should give you the next $(n-1)$ digits.

0
On

You want the two digits before the decimal point of $10^{11} \sqrt{3} = \sqrt{3 \times 10^{22}}$. Let's see if we can get a good rational approximation of that. Let $A = 3 \times 10^{22}$. The Newton's method iteration for $\sqrt{A}$ is $x \to (x + A/x)/2$. If we start with $x_0 = 2 \times 10^{11}$ and apply this iteration, rounding each result to the nearest integer, we get $$ \eqalign{x_1 &= 175000000000\cr x_2 &= 173214285714\cr x_3 &= 173205081001\cr x_4 &= 173205080757\cr x_5 = x_4 &= 173205080757\cr}$$ Check that $x_4^2 > A$, so what we want is $x_4 - 1 = 173205080756$, and its lowest two digits are the answer: $56$.