0
$\begingroup$

Given a range of the rational numbers, $x$, between $0$ and $2\pi$\, what is the set of rational numbers $ y = \cos(x) $?

I was inspired by the stackoverflow question Can $\cos(a)$ ever equal $0$ in floating point? (The irrational number $\frac{\pi}{2}$ does not translate well into a computer representation.)

I looked for rational cosines, and came up with the likes of $ 0, \frac{\pi}{3},\frac{\pi}{2}, \pi, \frac{3\pi}{2}$ Following this rabbit hole, I wondered if there were any rational (Floating Point) numbers (besides $0$) that yielded rational cosines.

One respondent opened a different question, on english.stackexchange.com, What is the upper bound on “several”? which involves the size of the set in question.

  • 0
    @rajah9: You are welcome!2011-08-04

3 Answers 3

6

The only cases where $x/\pi$ and $\cos(x)$ are both rational are the obvious ones, where $2\cos(x)$ is an integer. The slick way to show this uses the following facts:

1) when $r$ is rational, $e^{\pm i r \pi}$ are algebraic integers

2) the sum of algebraic integers is an algebraic integer

3) the only algebraic integers that are rational numbers are (ordinary) integers.

  • 0
    Thanks, the reference to Lindemann's theorem and your proof were what I was looking for.2011-08-04
2

Robert Israel has already answered your specific question. For some deeper issues related to your question, see the following web pages:

http://www.uni-math.gwdg.de/jahnel/Preprints/cos.pdf

http://www.mathpages.com/home/kmath460/kmath460.htm

http://groups.google.com/group/sci.math/msg/9a4a0e0fe9e2f8e6

http://www.oberlin.edu/faculty/jcalcut/tanpap.pdf

0

Given the rationals are dense and $\cos$ is continuous, you can say that $\{y=\cos{x}\mid x\in \mathbb{Q} \cap [0,2\pi]\}$ is dense in $[-1,1]$ and countable.

  • 0
    @Willie Wong: thanks. I think Robert Israel's answer is squarely on point for the new question. I think I would leave this up, but could be convinced to delete it.2011-08-03