2

$\frac{\sqrt{5}}{3} = 0.745355992$ to 9 decimal places.

If I had been given the number 0.745355992 to start with and was asked to write it in the form $\frac{\sqrt{a}}{b}$ is it possible to approximate values for $a$ and $b$?

Kantura
  • 2,787
  • 3
    The quantity $a = 0.745\ldots$ satisfies $a^2 \approx 0.\overline{5} = \frac{5}{9}$, so $a \approx \sqrt{\frac{5}{9}} = \frac{\sqrt 5}{3}$. – Travis Willse Feb 09 '17 at 12:46
  • 3
    Boring answer: you could always take the number after the decimal point, square it, and let that be $a$; then let $b$ be an appropriate power of 10. However, once you restrict yourself appropriately (i.e., given $n$ decimal digits, can I find $a,b$ with $a < f(n)$ for $f$ some function), the question again becomes deep and interesting. – Mees de Vries Feb 09 '17 at 12:48
  • 2
    Basically, this asks for a generalization of Continued fraction approximations, where instead of $a/b$, you seek $a/b^2$ – ThomasR Feb 09 '17 at 12:53

4 Answers4

8

The problem would have infinitely many solutions. If $\sqrt a/b$ is a solution, so it is $$\frac{\sqrt{10^{50}a+1}}{10^{25}b}$$

A good way to obtain a pair of relatively small values for $a$ and $b$ could be the following.

Let $x$ be areal number. We want to approximate it with an expression of the form $\sqrt a /b$

With continued fractions method, approximate $x^2\approx p/q$. Then $$x\approx \sqrt{\frac pq}=\frac{\sqrt {pq}}q$$

ajotatxe
  • 66,849
  • 1
    Can we prove that $p$ and $q$ provide optimal approximations foro $x$? (It is known for $x^2$) – ThomasR Feb 09 '17 at 12:56
6

There are many possibilities, of course, but we can find the (in one sense) simplest one:

We have that $\frac{a}{b^2}$ is between $0.745355992^2$ and $0.745355993^2$.

The continued fraction representations of these numbers are (courtesy of Wolfram Alpha): $$ \Bigl(\frac{745355992}{10^9}\Bigr)^2 = [0; 1, 1, 4, 16565788, 1, 5, 1, 1, 12, 3, 2, 2, 1, 5, 2, 2108] \\ \Bigl(\frac{745355993}{10^9}\Bigr)^2= [0; 1, 1, 3, 1, 16561143, 1, 4, 8, 1, 1, 2, 6, 1, 1, 3, 1, 2, 7, 6, 1, 16, 10, 1, 17] $$

The simplest rational between the two squares can be found by taking their shared prefix and appending one more than the smaller coefficient at the first point of difference: $$ [0;1,1,\min(4,3)+1] = [0;1,1,4] = \frac{5}{9} $$ Now we need to make the denominator of this a perfect square -- this is already the case but it were not, we could multiply the missing prime factors into both numerator and denominator. And so we get $$ 0.745355992 \le \frac{\sqrt 5}{3} \le 0.745355993 $$

4

Suppose you are given a positive real number $\alpha$, and you want to approximate it by $\sqrt a/b$. Here is a systematic approach to the problem:

  1. find the continued-fraction approximants $(p_1/q_1,p_2/q_2,\ldots)$ of $\alpha^2$ (this Wikipedia article tells you how);
  2. express each $p_i/q_i$ as $r_i/s_i^2$ by multiplying $p_i$ and $q_i$ by the square-free part of $q_i$;
  3. pick the element $r_i/s_i^2$ that best meets your requirements.

Part 3 is obviously not rigorous, but if $\alpha$ is close enough to a number of the form $\sqrt a/b$, then $a/b^2$ will show up in the sequence.

Worked example: here $\alpha=0.745355992$, so $\alpha^2=0.555555554810304064$. You can see instantly that $5/9$ is an excellent approximation, but let's go through the motions:

$0.555555554810304064$
Integral part is $0$: $\alpha^2=[0;\ldots]$

Subtract integral part and invert:
$1.8000000024146148358790915543479$
Integral part is $1$: $\alpha^2=[0;1,\ldots]$

Subtract integral part and invert:
$1.2499999962271643303263506729912$
Integral part is $1$: $\alpha^2=[0;1,1,\ldots]$

Subtract integral part and invert:
$4.000000060365371625772898363428$
Integral part is $4$: $\alpha^2=[0;1,1,4,\ldots]$

Subtract integral part and invert:
$16565788.846615028668956002524823$
Integral part is $16565788$: $\alpha^2=[0;1,1,4,16565788,\ldots]$

Such a huge integral part means $[0;1,1,4]$ is a very good aproximation to $\alpha^2$.

The continued-fraction approximants are:
$[0;1]=1$
$[0;1,1]=1/2$
$[0;1,1,4]=5/9$
$[0;1,1,4,16565788]=$ some complicated fraction very close to $5/9$

Expressing these approximants $(1,1/2,5/9)$ in the form $a/b^2$ gives $(1,2/4,5/9)$, so the candidates for $\alpha=\sqrt a/b$ are $1,\sqrt 2/2,$ and $\sqrt 5/3$. Now back-checking reveals that $\sqrt 5/3$ is indeed $0.745355992$ to nine significant figures, which is what you wanted.

Just for fun, you might like to try this slightly more challenging example:

$$\alpha=0.327515550754707171889380$$

TonyK
  • 68,059
3

You can use the LLL algorithm, Wikipedia explains how to use it well enough. This answer mentions the same idea.

You can use the Inverse Symbolic Calculator if you don't wish to implement it yourself.

i9Fn
  • 531