Today on Twitter John D. Cook, writing as @AlgebraFact, posted the following tweet:
In radians, sin(11) is very nearly -1.
(It happens to be -0.9999902…)
I thought that was awesome! So, I (@divbyzero) replied that cos(333) is approximately 1. (It is 0.999961…)
Then @michiexile chimed in, pointing out that cos(355) is closer to -1 than cos(333) is to 1. (It is -0.9999999995…)
Finally, I countered with cos(103993), which is 0.9999999998…
So what’s going on here?
All of this comes from the continued fraction for ,
.
It is well known that the convergents of a continued fraction (i.e., the fraction you obtain by truncating a continued fraction at some point) are the best rational approximations for the number. The first ten convergents of are
,
,
,
,
,
,
,
,
,
.
Notice that , so
. Thus
. This was John D. Cook’s observation.
Similarly, , so
, and
. The other two approximations come from the next two convergents.
After the conversation on Twitter, I started playing a little more.
First, I noticed that
.
()
This comes from the third convergent. Since implies that
,
.
Actually, we can do better than that:
.
()
The approximation, implies that
, so
.
Next, I noticed that
.
()
This comes from , which implies that
. Thus
Finally, I noticed that
.
()
In this case, gives
, and
. We obtain the result by substituting the previous approximation for
.
Of course, we also have
.
()






That’s great! You really ran with this.
One footnote: Good approximations to pi lead to great approximations to 1 when you take sines. Taylor series says sin(pi/2 + h) is approximately 1 – 0.5 h^2 for small h. So the error in the approximation for pi gets squared.
By: John on February 17, 2010
at 12:17 am
John,
Thanks for pointing that out. I did notice that some approximations were better than others, but hadn’t thought about why.
Dave
By: Dave Richeson on February 17, 2010
at 11:06 am
Reminds me of my favorite calculator trick.
Set your calculator to degrees mode (NOT radians).
Type in a bunch of 5′s: 555555, or whatever.
Press “1/x”.
Press “sin”.
Examine the mantissa of the result. Magic!
By: Nemo on February 17, 2010
at 3:27 pm
Excellent, I’d never seen that before! Good use of
and the radians-to-degrees conversion. I’ll have to show that to my students.
By: Dave Richeson on February 17, 2010
at 3:38 pm
[...] math behind a neat calculator trick I received an interesting comment on yesterday’s blog post from Nemo. It was a cool calculator trick that I’d never seen before. Nemo wrote: Reminds me [...]
By: The math behind a neat calculator trick « Division by Zero on February 17, 2010
at 9:50 pm
Found a small typo in your typesetting: the CF of pi is 3; 7, 15, 1, 292 – you forgot the 1 after the 15 in your nested fraction.
By: Walt on February 24, 2010
at 9:06 am
Wow, good eyes. Thank you for catching that. I updated the post.
By: Dave Richeson on February 24, 2010
at 9:51 am
[...] with continued fractions Posted on June 5, 2010 by amca01 In an excellent blog post earlier this year, Dave Richeson commented on the [...]
By: Approximations with continued fractions « Alasdair's musings on June 4, 2010
at 8:39 pm
Awesome.. You guys really doing some good approximation and bringing some fun to it. How I wish Twitter had been there in my school days.
By: Prasad Kulkarni on March 7, 2011
at 1:51 am