Let the rational number $p/q$ be closest to but not equal to $22/7$ among all rational numbers with denominator $< 100$.

2.3k Views Asked by At

Let the rational number $p/q$ be closest to but not equal to $22/7$ among all rational numbers with denominator $< 100$. What is the value of $p − 3q$ ?

My approach: $22/7=3.14$, therefore, $p/q=314/100$ but according to the question p/q has a denominator that's less than $100$ satisfying which $p/q$ can be $157/50$. But the given closest value is $22/7$. Hence I concluded that $p/q=313/100$ which gave me the answer as $13$. However, the answer key says it's $14$. Where am I going wrong? Is it because I'm taking it up to $2$ decimal places?

2

There are 2 best solutions below

1
On BEST ANSWER

$$\left|\frac pq-\frac{22}7\right|=\left|\frac{7p-22q}{7q}\right|$$

The point is to solve the Diophantine equation $$7p-22q=\pm1$$ and get the greatest possible value for $q$.

It turns out that $7\cdot 311-22\cdot99=-1$, so your fraction is $\frac{311}{99}$

0
On

${22 \over 7} = 3 + {1 \over 7}$

Previous convergent before reaching ${22 \over 7}$ is ${3 \over 1}$

To produce a "semi-convergent" close to but not equal ${22 \over 7}$

$${22k ± 3 \over 7k ± 1}$$

$d = max(7k ± 1) < 100 = 7\times14+2$

Closest fraction = $\large {22\times14\;+\;3 \over 7\times14\;+\;1} = {311 \over 99}$