4

This is from my attempt to show $\frac{22}{7}$ is the best approximation of $\pi$ with denominator not more than $50$.
My attempt as follows:
Suppose there is a better rational approximation, $\frac pq$: $\left|\pi-\frac pq\right|<\frac{22}{7}-\pi$ $$\pi-\frac{22}{7}<\pi-\frac pq<\frac{22}{7}-\pi$$ $$-\frac{22}{7}<-\frac pq<\frac{22}{7}-2\pi$$ $$\frac{22}{7}>\frac pq>-\frac{22}{7}+2\pi$$ $$\frac{22}{7}-3>\frac {p-3q}q>-\frac{22}{7}-3+2\pi$$ $$\frac{1}{7}>\frac {p-3q}q>\frac{14\pi-43}{7}$$ $$7<\frac q{p-3q}<\frac{7}{14\pi-43}$$ $$0<\frac {22q-7p}{p-3q}<\frac{308-98\pi}{14\pi-43}$$ $$\frac {p-3q}{22q-7p}>\frac{14\pi-43}{308-98\pi}>7$$ Then, in order not to re-arrange terms by hand, I fed the latter inequality to wolframalpha, obtaining $$(50 p - 157 q) (7 p - 22 q)<0$$ $$\frac{157}{50}<\frac{p}{q}<\frac{22}{7}\tag{1}$$ and along with this one more thing, with Reduce[(p - 3 q)/(-7 p + 22 q) > 7, {p, q}, Integers]: $$p = 157 n_1 + 22 n_2 + 179,\, q = 50 n_1 + 7 n_2 + 57,\, n_1, n_2 \in \mathbb{Z}_{+}\tag{2}$$ which solves the original problem (as $q\ge 57$).

However, I do not know any explanation on how is it derived, I'm feeling that I'm missing something well-known. The first idea I can think of is like we solve $$0<\frac{p}{q}-\frac{157}{50}<\frac{22}{7}-\frac{157}{50}$$ $$0<\frac{50p-157q}{50q}<\frac{1}{350}$$ $$0<7(50p-157q)<q$$ ... we solve Diophantine equation $7(50p-157q)=k$ for every $0<k<q$, but it doesn't seem to produce such a neat result. So the question is: how does (1)$\Rightarrow$(2)? References where I can read a more general case may be even better (if available for free).

Thanks.

Batominovski
  • 49,629

3 Answers3

4

Proposition. Let $a$, $b$, $c$, and $d$ be integers such that $b>0$, $d>0$, and $\delta:=ad-bc>0$. Then, any rational number $r$ such that $$\frac{a}{b}>r>\frac{c}{d}$$ is of the form $$r=\frac{an+cm}{bn+dm}$$ for some positive integers $m$ and $n$.

Suppose that $p$ and $q$ are integers such that $q>0$ and $r=\dfrac{p}{q}$. Then, we have $$\frac{a}{b}>\dfrac{p}{q}>\frac{c}{d}\,,$$ whence $$aq-bp=m\text{ and }dp-cq=n$$ for some positive integers $m$ and $n$. That is, $$\delta p=(ad-bc)p=a(dp-cq)+c(aq-bp)=an+cm$$ and $$\delta q=(ad-bc)q=b(dp-cq)+d(aq-bp)=bn+dm\,.$$ Hence, $$p=\frac{an+cm}{\delta}\text{ and }q=\frac{bn+dm}{\delta}\,.$$ This shows that $$r=\frac{p}{q}=\frac{\left(\frac{an+cm}{\delta}\right)}{\left(\frac{bn+dm}{\delta}\right)}=\frac{an+cm}{bn+dm}\,.$$

Corollary. Let $a$, $b$, $c$, and $d$ be integers such that $b>0$, $d>0$, and $ad-bc=1$. Then, if $p$ and $q$ are integers such that $q>0$ and $$\frac{a}{b}>\dfrac{p}{q}>\frac{c}{d}\,,$$ then $$p=an+cm\text{ and }q=bn+dm$$ for some positive integers $m$ and $n$.

In particular, when $a=22$, $b=7$, $c=157$, and $d=50$, we have $\delta=1$. Thus, the corollary applies: for all positive integers $p$ and $q$ such that $$\frac{22}{7}>\frac{p}{q}>\frac{157}{50}\,,$$ there exist positive integers $m$ and $n$ for which $$p=22n+157m\text{ and }q=7n+50m\,.$$ By setting $m':=m-1$ and $n':=n-1$ (so $m'$ and $n'$ are nonnegative integers), we get $$p=22n'+157m'+179\text{ and } q=7n'+50m'+57\,.$$

Remark. The corollary is false if $\delta=ad-bc>1$. For example, when $a=1$, $b=1$, $c=1$, and $d=\delta+1$, we can take $p=1$ and $q=\delta$, which do not satisfy the conclusion of the corollary.

Batominovski
  • 49,629
  • Can you please elaborate more on the pair of equations after "$r=\frac pq$. Then". Are you already assuming that $r$ is in the form $\frac{an+bm}{cn+dm}$, equating the numerators and denominators and solve the linear equation system $a\cdot n+b\cdot m=p,, c\cdot n+d\cdot m=q$? Or what's happening? Thanks. – Alexey Burdin Jul 09 '20 at 02:47
  • 1
    No, I didn't assume that (otherwise, it would be circular logic). What is happening is $\dfrac{a}b>\dfrac{p}q$ means $aq-bp$ is a positive integer, which I call $m$. The other equality is similar. – Batominovski Jul 09 '20 at 02:49
  • Thank you, now it all makes sense. Mentioning the forms of actual $m,,n$ shall be very useful for practical purposes if we are to find them. – Alexey Burdin Jul 09 '20 at 03:23
  • 1
    @AlexeyBurdin suggest you also look up https://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree and those references. – Will Jagy Jul 09 '20 at 16:35
1

It is true that, for any positive integers $u,v$ $$ \frac{157}{50} < \frac{157u + 22v}{50u + 7v} < \frac{22}{7} $$ However, take $u,v$ fairly large, you can alter the numerator a little bit (say by $\pm 1$) and still have that inequality

Will Jagy
  • 139,541
  • However, it doesn't derive a contradiction, we may have ended up with lower $u,v$ after cancelling to lowest terms. And this doesn't answer on how (1)$\Rightarrow$(2) ( (2)$\Rightarrow$(1) seems to be more easy, thus not asked). In other words, I'm missing the point. – Alexey Burdin Jul 08 '20 at 23:41
  • @AlexeyBurdin suggest you do some simple computer tests...let's see, $u=1, v=3$ gives prime 71 in the denominator, numerator 223. Too small, switch to $u=10, v=30.$ then $2230/710$ is still between, but so is $2231/710.$ – Will Jagy Jul 08 '20 at 23:49
  • Then $u=3,, v=80$, no contradiction. What is the point I'm missing? Thanks. – Alexey Burdin Jul 08 '20 at 23:53
  • @WillJagy, $157/50$ and $22/7$ are consecutive Farey fractions, so won't everything between them necessarily be of the given integer linear combination form? – Barry Cipra Jul 08 '20 at 23:58
  • @BarryCipra can you please explain, maybe in a separate answer, maybe in short one, how is it so obvious? Thanks. P.S. I did read the article you linked. – Alexey Burdin Jul 09 '20 at 00:02
  • @AlexeyBurdin I see your 3,80 comment. Maybe you and Barry are right, the whole business comes out of Farey series. – Will Jagy Jul 09 '20 at 00:05
  • @BarryCipra, maybe a bit of an answer by you would help. I've never really paid any attention to Farey series. Plus Alexey seems to have disposed of my example – Will Jagy Jul 09 '20 at 00:07
  • Not me, only Barry) I haven't been taught these things even a bit. But I'm starting to see the point now. There in the wiki mediant of $\frac ab,,\frac cd$ is defined as $\frac{a+c}{b+d}$. Seems the point is that everything in between $\frac{157}{50}$ and $\frac{22}{7}$ can be obtained via mediant of the latter two and their mediants... And sorry for chatting below your answer) – Alexey Burdin Jul 09 '20 at 00:14
  • @AlexeyBurdin right. Because of continued fractions, I am familiar with a special case, with a new "digit" $k$ an intermediate fraction is the next convergent, $\frac{a + kc}{b + kc}.$ I have some books on diophantine approximation, they do not address your question directly. – Will Jagy Jul 09 '20 at 00:23
  • 1
    @AlexeyBurdin, sorry for the delay in responding. I didn't mean to suggest that it's all obvious, just that the theory of Farey sequences should provide an answer. The basic idea, as I recall (from several decades ago), is that starting from $0=0/1$ and $1=1/1$ (or any two consecutive integers, with $1$ as denominator), you can arrive at any fraction $p/q$ by a process of inserting mediants (I'd actually forgotten that was the term for $(a+c)/(b+d)$, so thanks for the reminder!). – Barry Cipra Jul 09 '20 at 11:45
  • @BarryCipra there is now a correct answer to the original question, by Batominovski. Probably worth adding to the wikipedia article on Farey sequences, as it shows that the relevant structure really is automatic. Probably proved in some of the references for https://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree – Will Jagy Jul 09 '20 at 16:30
1

I suppose it's nearly an answer.
It's claimed or even somehow proven or obvious that every rational number ($\frac pq$, in lowest terms) between $\frac{157}{50}$ and $\frac{22}{7}$ will be in a Farey sequence, namely in the Farey sequence of order $q$.

Every number in a Farey sequence is the mediant of its neighbours (mediant of $\frac ab,\,\frac cd$ is defined to be $\frac{a+c}{b+d}$). And "climbing up" from every number that is not $\frac{157}{50}$ or $\frac{22}{7}$ to its neighbours we will eventually reach the ends of the interval $\left[\frac{157}{50},\frac{22}{7}\right]$ (although it's not so obvious that we can't get out of the interval, but it's likely believed), then performing "climbing down" through the same numbers by which we did "climb up" we can go nowhere from the form $\frac{157u+22v}{50u+7v}$, QED.
It's like adding vectors, when we have $(157,50)$ and $(22,7)$ and the only permitted operation $a,\,b\to (a+b)$ we can nowhere escape from the form of $(157u+22v,50u+7v)$. Suppose it's rigorous enough.)
Many thanks to @Barry Cipra and @Will Jagy (and the anonymous upvoter of the question's comment) for carrying this out to me.