2

I was messing around with my calculator the other day when I saw something interesting happen. Whenever I repetitively took the cosine of any number, it always ended up on a particular number (Dottie's number). It wasn't difficult to figure out why it would be so, but what was difficult was how many steps a number takes to reach there. Since my calculator can only accurately calculate upto 9 digits, I can't say much, but I think it should take infinite steps.
So, excluding the case of Dottie's number itself,
$$\text{if } A \in \mathbb{R} \ \text{and} \ \underbrace{\cos \cos \ldots \cos}_{\text{n times}}\ (A)=0.739085\ldots$$
Prove that
$$n=\infty$$
EDIT: I wrote a simple program to show the iteration graphically. The result gives a nice spiral as expected. This one is for $0.3$
enter image description here

AvZ
  • 1,721
  • 1
    What if $A$ is the Dottie number? Then $n=1$ by definition. – Hayden Jan 09 '15 at 19:23
  • 2
    @Hayden, even more generally: suppose $x=A+n\pi$. Then, $\cos(x)=(-1)^n A$; for $n$ even with we have 1 iteration, for $n$ odd we have $\cos(\cos(x))=A$ (2 iterations). – Jason Jan 09 '15 at 19:35

4 Answers4

3

It will either require $0$, $1$, $2$, or infinitely many steps. Here's why. Denote the Dottie number by $x$, and the initial point of our iteration by $y$.

If $y=x$ then we are already at the Dottie number after $0$ iterations.

Define

$$A=\{ y : \cos(y) = x \text{ and } y \neq x \} = \{ x + 2 \pi k : k \in \mathbb{Z} \setminus \{ 0 \} \} \cup \{ -x + 2 \pi k : k \in \mathbb{Z} \}.$$

If $y \in A$, then we'll have $\cos(y)=x$ and we'll be at the Dottie number in $1$ iteration.

If $y \not \in A \cup \{ x \}$, then $\cos(y) \neq x$, and so after $1$ iteration we have $\cos(y) \in [-1,1]$. If $\cos(y)=-x$, then $\cos(\cos(y))=\cos(-x)=\cos(x)=x$, and so we'll be at the Dottie number in $2$ iterations.

Otherwise, we now have $\cos(\cos(y)) \in [0,1]$. $\cos$ is an injective function from $[0,1]$ to $[0,1]$, so if $z \in [0,1]$ then $\cos(z)=x$ if and only if $z=x$. So in this case we will not hit the Dottie number in any finite number of steps.

This last point can be proven by induction. Suppose $\cos^{(2)}(y) \neq x$; this is the base case. Take as the inductive hypothesis that $\cos^{(n)}(y) \neq x$, where $n \geq 2$. Since $n \geq 2$, $\cos^{(n)}(y) \in [0,1]$, on which $\cos$ is injective. Using the inductive hypothesis and the injectivity we conclude that $\cos^{(n+1)}(y)=\cos(\cos^{(n)}(y)) \neq \cos(x)=x$. So $\cos^{(n+1)}(y) \neq x$. By induction $\cos^{(n)}(y) \neq x$ for all $n \geq 2$.

Ian
  • 104,572
1

The question of exact iterations has been settled. Let us look at it from a numerical standpoint.

Assuming that the current iterate is $\epsilon$ away from Dottie's number,

$$D+\epsilon'=cos(D+\epsilon)=\cos D\cos\epsilon-\sin D\sin\epsilon\approx\cos D-\frac{\epsilon^2}2\cos D-\epsilon\sin D\approx D-\epsilon\sin D.$$

The $\epsilon^2$ term quickly becoming neglectible, and we see that the error follows a geometric law of ratio $-\sin D$.

$$\epsilon^{(k)}\approx(-\sin D)^k\epsilon.$$

This shows that one iteration brings $\log_{10}\sin D\approx0.1716$ decimal per iteration, i.e. about $53$ iterations to get $9$ correct decimals.


By contrast, Newton iterates are $$A'=A-\frac{A-\cos A}{1+\sin A},$$ giving $$ 0\\ 1\\ 0.75036386784\cdots\\ 0.739112890911\cdots\\ 0.739085133385\cdots\\ 0.739085133215\cdots\\ 0.739085133215\cdots\\ 0.739085133215\cdots\\ $$ The error is governed by $$D+\epsilon'=D+\epsilon-\frac{D+\epsilon-\cos(D+\epsilon)}{1+\sin(D+\epsilon)}\approx D+\epsilon-\frac{D+\epsilon-\left(1-\frac{\epsilon^2}2\right)\cos D+\epsilon\sin D}{1+\sin D}\\\approx D+\epsilon^2\frac{D}{2(1+\sin D)}.$$ More generally, $$\epsilon^{(k)}\approx\epsilon^{2^k}\left(\frac{D}{2(1+\sin D)}\right)^{2^k-1}.$$

0

In exact arithmetic it would never get there, but because there is roundoff error in your calculator you end up after finitely many steps with some approximation of the correct number.

Robert Israel
  • 470,583
  • What if there is some number out there that can reach there in finite steps? Can this be disproved mathematically? – AvZ Jan 09 '15 at 19:29
  • @AvZ, $x=A+\pi$. Then, $\cos(x)=-\cos(A)=-A \implies \cos(\cos(x)) = \cos(-A)=\cos(A)=A$. – Jason Jan 09 '15 at 19:36
  • @Jason, Ah, I forgot about that. But excluding these solutions, Are there any solutions which reach there in finite steps? – AvZ Jan 09 '15 at 19:40
0

I think if you proceed by contradiction, you can figure it out: let's say $n$ is finite: so we can write $\cos^{(n)}(A) = d$ (taking the cosine $n$ times) where $d$ is Dottie number, i.e. $d = cos(d)$. So, what we're saying is $\cos^{(n)}(A) = cos(d)$. One solution of that is $\cos^{(n-1)}(A) = d$. So, if you can reach $d$ is $n$ steps, then you can reach it in $n-1$; and so on. This is obviously a contradiction unless $n$ is infinity.

Moe
  • 273