7

Is it possible to put some sort of bounds on the smallest difference between elements for a limited range of integers $\mod 2\pi$?

$$ A =\bigl\{n\pmod{2\pi} : n \in \{\ 0, 1, 2, ... 2^x\ \} \bigl\} $$ (or similarly $ A = \bigl\{n\cdot \frac{1}{2\pi} \bmod 1 : n \in \{\ 0, 1, 2, ... 2^x\ \}\} $)

Where the smallest difference is defined as:

$$d_{min} = \min(\ \{\ |a - b|\ :\ a,b\in \ A,\ a \ne b\}\ )$$

Can I show that some sort of bounds exist for $d_{min}$ such as (intuitively/pessimistically via Dirichlet approximation theorem): $$ 2^{-2x} < d_{min} < 2^{-x} $$

If not, what are the tightest bounds we can place on $d_{min}$?

I'm comfortable with the answer here that shows $\{n\pmod{2 \pi}: n\in\Bbb N\}$ is dense in $[0,{2 \pi}]$ since $\pi$ is irrational, but the proof depends on arbitrarily large $n$.

In my concrete (software) case, I need to represent 44-bit integers as an angle in radians i.e. $(x=44)$, and would like to know the smallest number of fixed point precision bits that would be needed to uniquely represent these values $\pmod{2 \pi}$ to ensure no collisions.

It's easy to show that some of the smallest distances where $ b = 0$ are likely to occur for values of $a$ that are numerators in convergents of continued fraction approximations of $2\pi$, e.g. for:

$$a = 44 ,\ b = 0,\ \ (2\pi \approx \frac{2\times22}{7})$$

or $$a = 710,\ b = 0,\ \ (2\pi \approx \frac{2\times355}{113})$$

or even the semiconvergents - the sum of numerators/denominators such that the denominator becomes even, e.g. $$a = 377,\ b = 0, \ \ (2\pi \approx \frac{355+22}{\frac{113+7}{2}})$$

So one might suppose that the smallest distances occur with numerators of the most accurate continued fraction approximations of $2\pi$, but pairs like $$a = 103993, \ b = 0, \ \ (2\pi \approx \frac{103993}{\frac{33102}{2}}) $$ (ostensibly $\pi$ accurate to 9.2 decimal places) produce smaller gaps than the next (more accurate) approximation of $\pi$ (9.5 decimal places)

$$a = 208696,\ b = 0, \ \ (2\pi \approx \frac{2\times104348}{33215} \approx \frac{208341 + 355}{\frac{66317 + 113}{2}})$$

(This is probably because the smaller numerator already has an even denominator, so there's no need to double the numerator, and thus double the error).

Edit: as Eric points out in his answer below, I should be looking at convergents of $2\pi$ directly, since I was using double the convergents of $\pi$, the above musing can be ignored

For the $b = 0$ case, is it sufficient to only look at numerators of convergents/semiconvergents which have an even denominator?

Would another approach to this be better?

Edit, having thought about it a bit more:

If distance is defined $$ d(m, n) = | (m\pmod{2\pi}) - (n\pmod{2\pi}) |\ \ \text{for}\ m,n \in \Bbb{N}$$

I think we can say that the distance $d(a + b, b) = d(a,0)$ for $b \in \Bbb N$, so all the minima from $a$ being a convergent numerator where $n = 0$ will be trivially replicated at $ m = a+b $ for $n = b$.

The same applies for $d(a, b - a) = d(0,b)$ for $a \in \Bbb N$, and due to the symmetry of $a$ and $b$, this allows the reduction of any pair of values into a single measure of accuracy of an approximation of $2\pi$.

Could there be other minima where $ n > 0 $ that don't correspond to a trivial $ m = a+b $ case, i.e. could there be a $b$ such that $d(a, b) < d(a,0)$?

I think all members of $A$ must be positive, and so finding a smaller minimum where $b > 0$ is a matter of looking for $n$ such that $n\pmod{2\pi}$ is as close as possible to but not equal to $ m\pmod{2\pi}$. In the case where

$$n\pmod{2\pi} < m\pmod{2\pi}$$ this is effectively trying to find a tighter approximation of ${2\pi}$, and can likely only happen with a "better" continued fraction convergent numerator.

In the case of $$(m\ \text{mod}\ {2\pi}) < (n\ \text{mod}\ {2\pi}) < 2(m\ \text{mod}\ {2\pi}) $$ due to the symmetry in the definition of distance, $m$ and $n$ can be swapped, and the problem again becomes one of trying to find a "better" continued fraction convergent numerator.

The relationship for a convergent $ \frac{p}{q}$ is: $$p\pmod{2\pi} = (2\pi - \frac{p}{q})\times q$$

Via the mediant inequality, I think we can always find a midpoint between 2 convergents by adding the numerators together (and denominators), and I think this applies whether the 2 convergents are overestimates or underestimates... If you have one overestimate and one underestimate, then the new estimate for $2\pi$ becomes better than either.

$$\frac{p}{q} < \frac{p+a}{q+b} < \frac{a}{b}$$

It follows that you can do this an arbitrary number of times to get successively closer distances between pairs of convergents, but how quickly does that grow the $d_{min}$?

This implies a sort of fractal scale which evenly distributes integer values across $[0,2\pi]$ at a granularity roughly the "scale" of the preceding convergent numerator, then as soon as the next convergent numerator is reached, the scale gets smaller, and so on, so the $d_{min}$ for any number $n$ can never be smaller than the value of the largest convergent numerator smaller than n $\pmod{2\pi}$.

So my question rearranges to

$$\log(p\pmod{2\pi}) = \log(\lvert2\pi - \frac{p}{q}\rvert) + \log(q)$$

Which is almost the same question as this

Does that mean $2^{−(x+\epsilon)}$ is enough, where $\epsilon$ is how much better the convergent is than the size of the denominator (the negation of the right hand term above)?

If so, does that mean for $\mu(\pi) =2$ that $\epsilon \leq x$?

EHS
  • 71
  • What does the notation $[0...2^x]$ mean? It seems like you are asking about the integers $0,1,2,...,2^x$. Is this correct? – QC_QAOA Jul 13 '23 at 18:24
  • Yeah that's what I mean, is there a clearer notation for this? I've edited to use ${\ 0, 1, 2, ... 2^x\ }$ instead – EHS Jul 13 '23 at 18:55
  • I would use the set notation. Personally, when I see $[$ and $]$ it implies to me a closed set over some interval. From context I was able to understand but just wanted to double check. – QC_QAOA Jul 13 '23 at 19:37
  • 2
    I would investigate https://mathworld.wolfram.com/IrrationalityMeasure.html . Just some quick back of the napkin math, but I would imagine that $d_{min}>2^{-90}$ is probably a good bound though – QC_QAOA Jul 14 '23 at 13:54
  • Yeah that's where my pessimistic $2^{-2x} < d_{min} < 2^{-x}$ bounds came from, but with $\pi$ having an irrationality measure upper bound of 7.10..., should it be $2^{-7.10...x} < d_{min} < 2^{-x}$ ? – EHS Jul 14 '23 at 13:57
  • 1
    Its possible... but its strongly suspected that $\pi$ has an irrationality measure of $2$. Thing is, even if you use the $7.1...$ bound, you still would only know that eventually $d_{min}>2^{-7.1... x}$ and it wouldn't tell you anything about behavior at your size of numbers. I said $90$ since $90=2*44+2$. The extra $2$ is to hopefully make that the 'eventually' already happened by $2^{44}$. – QC_QAOA Jul 14 '23 at 15:54
  • I’ve edited my question further, do you think I now have more information about how "eventually" looks at different scales of convergent? – EHS Jul 16 '23 at 10:06

1 Answers1

1

You’re running into issues because you’re multiplying convergents of $\pi$ by $2$. Those fractions have no reasons to have nice properties.

Instead, you should use convergents of $2\pi$ directly which can be calculated from its continued fraction.

From https://oeis.org/A058291, $[6; 3, 1, 1, 7, 2, 146, 3, 6, 1, 1, 2, 7, 5, 5, 1, 4, 1, 2, 42, 5, 31, 1, 1, 1, 6, 2, 2, 4,\dots]$

In particular, you can do the computation in Wolfram Alpha to give gives convergents which should suffice for any practical application: $6, 19/3, 25/4, 44/7, 333/53, 710/113, 103993/16551, 312689/49766, 1980127/315147, 2292816/364913, 4272943/680060, 10838702/1725033, 80143857/12755291, 411557987/65501488, 2137933792/340262731, 2549491779/405764219, 12335900908/1963319607, 14885392687/2369083826, 42106686282/6701487259, 1783366216531/283831548704, 8958937768937/1425859230779, 279510437053578/44485467702853, 288469374822515/45911326933632, 567979811876093/90396794636485, 856449186698608/136308121570117, 5706674932067741/908245524057187, 12269799050834090/1952799169684491, 30246273033735921/4813843863426169, 133254891185777774/21208174623389167, 430010946591069243/68438367733593670$

Eric
  • 8,378
  • Thanks, I’ve updated my question to reflect this, but I don’t think this is an answer to my original question – EHS Jul 16 '23 at 18:44
  • 2
    I agree that it doesn’t give the asymptotics, but it does let you compute the smallest distance for any given $2^x<10^{16}$ which seems to be what you need for your practical coding purpose. – Eric Jul 16 '23 at 19:20