$\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$?
$\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$?
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$$
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 $$
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:
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$$
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.