2

How can we find the nearest number to zero among $$\sin1, \sin2, \sin3, \ldots, \sin n$$ (where $n$ is a natural number, and the functions are based on radians)?

Blue
  • 75,673
Setareh
  • 21
  • I assume that you're excluding the trivial $\sin 0$? – Dan Jan 17 '24 at 15:11
  • @Dan The assumption is not necessary. The question is explicit with $1,2,3\dots n$ – Daniel Mathias Jan 17 '24 at 15:16
  • 1
    What about $n=314159265358979323846$? (In case you don't get it, it's $\pi \times 10^{\text{much}}$ :-) ) – Dominique Jan 17 '24 at 15:23
  • Well, you could specify any $\epsilon > 0$ and it will get that close eventually. So, there is no closest for all of the natural numbers. I think that the question is for a specific finite range. This allows the simple boring solution of just checking the whole lot. – badjohn Jan 17 '24 at 15:26
  • 4
    multiples of numerator of convergents of $\pi$. eg. $3,22,333,355,103993,104348,\ldots$. If you make a $xy$-plot for $( n, |\log|\sin n||) $, you will see a bunch of peaks at multiples of those $n$. – achille hui Jan 17 '24 at 15:31
  • Sin0 is not our answer. Zero is not a natural number. Sin is periodic number – Setareh Jan 17 '24 at 15:53
  • 2
    Are you asking about a finite $n$, or the whole set of natural numbers? – Daigaku no Baku Jan 17 '24 at 16:04
  • Dont mention that n is finit or not, it in the question. I – Setareh Jan 17 '24 at 20:05

1 Answers1

1

Recall that $\forall k \in \mathbb{Z}: \sin(\pi k) = 0$. And it can be shown with the standard trig identities that $|\sin(\pi k + \epsilon) - \sin(\pi k)| = |\sin(\epsilon)| \le \epsilon$. So, your question is equivalent to asking for the best rational approximation of $\pi$.

If you're considering the domain $1 \le n \le 100$, then the optimum is $\sin 22 \approx -0.008851$, which is related to the familiar approximation $\pi \approx \frac{22}{7}$.

For $1 \le n \le 10^{6}$, the optimum is $\sin 833719 \approx 2.31\times10^{-6}$, related to the approximation $\pi \approx \frac{833719}{265381}$.

For any finite set of natural numbers $1 \le n \le N$, the optimum $n$ is the numerator of a continued fraction convergent to $\pi$. (Thanks to @RobertIsrael for the OEIS link.)

For the infinite set of natural numbers, there is no unique “nearest number to zero”, because for any rational approximation of $\pi$, there's always a better approximation with a higher numerator and denominator. Thus, the sine function is dense in $[-1, 1]$.

Dan
  • 14,978
  • 1
    More specifically, it's asking for best approximations of the second kind. and these are the convergents of the continued fraction. The numerators of the convergents of the continued fraction for $\pi$ are OEIS sequence A002485. – Robert Israel Jan 17 '24 at 17:57