# $\sqrt{11}$ as rational number within $10^{-4}$?

Use continued fractions to find a rational number which approximates $$\sqrt{11}$$ to within $$10^{−4}$$.

I know how to solve for continued fractions like this: $$\sqrt{11}=3+x$$ $$11=9+6x+x^2$$ $$11=9+(6+x)x$$ $$2=x(6+x)$$ $$x=\frac{2}{6+x}=\frac{1}{3+\frac{x}2}=\frac{1}{3+\frac{1}{6+x}}$$

therefore, $$\sqrt{11}=[3;\overline{3,6}]$$

How do I find out where to terminate the fraction so as to obtain close value with error less than the mentioned limit

• Look for a convergent with denominator $>100$. May 28 '19 at 6:30
• You could just try terminating it as various places until you find one that works. Don't worry, it won't take too long. May 28 '19 at 7:21

It's a fact that if $$m/n$$ is a convergent in the continued fraction expansion of $$x$$, and $$m$$ and $$n$$ are relatively prime, then $$| x - m/n | < 1/n^2$$. This allows you to bound the error in your approximation.
Theorem: Let $$p_k/q_k$$ is the $$k$$-th convergent of a positive real $$x$$ then
$$\Bigg|x - \frac{p_k}{q_k}\Bigg| \le \frac{1}{q_k q_{k+1}} < \frac{1}{q_k^2}$$
So to approximate within $$10^{-4}$$, $$q_k > 100$$ sufficient not always necessary because in general you can get the same accuracy with a smaller denominator if $$q_k q_{k+1} > 10^4$$.