Find all rational numbers $\frac{p}{q}$ such that $|\frac{p}{q}− \frac{17}{12}|< \frac{1}{q^2}$

186 Views Asked by At

Find all rational numbers $\frac{p}{q}$ such that $|\frac{p}{q}− \frac{17}{12}|< \frac{1}{q^2}$

Attempt

$-\frac{1}{q^2} < \frac{p}{q} - \frac{17}{12} < \frac{1}{q^2}$

$-\frac{1}{q^2} + \frac{17}{12} < \frac{p}{q} < \frac{1}{q^2}+ \frac{17}{12} $

For $q = 1$:

$\frac{5}{12} < p < 2\frac{5}{12} $, $p=1,2$

For $q = 2$: $2\frac{1}{3} < p < 3\frac{1}{3} $, $p=3$

For $q=4$...

Do I conclude there are infinite $p$ and $q$ that satisfy the condition, or is there more to this question?

2

There are 2 best solutions below

1
On BEST ANSWER

You're on the right track up to this point:

$$-\frac{1}{q^2} + \frac{17}{12} < \frac{p}{q} < \frac{1}{q^2}+ \frac{17}{12}$$

Next, I would follow @kabel abel's advice and multiply everything by $12q^2$ to get rid of the fractions. Note that since $12q^2 > 0$, this won't change the inequality signs.

$$-12 + 17q^2 < 12pq < 12 + 17q^2$$ $$-12 < 12pq - 17q^2 < 12$$ $$\left| 12pq - 17q^2 \right| < 12$$

With the constraint that $q \ne 0$ (because if it were 0, the $\frac{p}{q}$ in the original problem would be undefined).

A brute-force search (along @O M's lines, with $|p|, |q| \le 10000$) gives the solution set:

$$\boxed{\frac{p}{q} \in \{ 1, \frac{4}{3}, \frac{7}{5}, \frac{17}{12}, \frac{10}{7}, \frac{3}{2}, 2 \}}$$

However, this fails to prove that there aren't any other solutions. So let's take a different approach.

Note that since $q$ is a nonzero integer, we must have $|q| \ge 1$, and thus $\frac{1}{q^2} \le 1$. By transitivity, $|\frac{p}{q}− \frac{17}{12}|< 1$, and thus $\frac{5}{12} < \frac{p}{q} <\frac{29}{12}$. Since this implies $\frac{p}{q} > 0$, we can assume WLOG that $p$ and $q$ are individually both positive.

Now, back to the inequality $\left| 12pq - 17q^2 \right| < 12$. This factors into $q \left| 12p - 17q \right| < 12$.

One way to achieve this inequality is to have the left-hand side be $0$. We've established that $q \ne 0$, so this case requires $|12p - 17q| = 0$, from which $\frac{p}{q} = \frac{17}{12}$.

Otherwise, we have two positive integers whose product is between 1 and 11, inclusive. This requires that the individual factors be between 1 and 11.

$$1 \le q \le 11$$ $$1 \le |12p-17q| \le 11$$

From the latter, we get $-11 \le 12p -17q \le 11$, or $17q-11 \le 12p \le 17q+11$. Since $1 \le q$, then $6 \le 17q-11$. Since $q \le 11$, then $17q + 11 \le 198$. By transitivity,

$$6 \le 12p \le 198 $$ $$\frac{1}{2} \le p \le \frac{33}{2}$$

Or, since $p$ is an integer,

$$1 \le p \le 16$$

We thus have finite bounds on both $p$ and $q$, and can limit our search for solutions to $(p, q) \in ([1, 16] \times [1, 11]) \cup (17, 12)$.

4
On

$\frac{p}{q}$ is a rational number. So, by definition, $p,q\in \mathbb{Z}, q\ne0$ and $\gcd(p,q)=1$.

Your attempt shows that, $-\frac{1}{q^2} + \frac{17}{12} < \frac{p}{q} < \frac{1}{q^2}+ \frac{17}{12}, \quad \therefore 0<\frac{p}{q}, \forall q$

Hence, $\frac{p}{q}$ is positive rational number and $p,q$ are both positive integer.( if both are negetive then it will produce same rational number.)

As, attempted to check for $p,q$, here is a python code which check $p,q$ for all $0-10000$ numbers in the equation $-12 < (12pq - 17q^2) < 12$ (simplified version of OP's equation) which gives only $7$ unique rational numbers i.e. $1, 2, \frac{3} 2, \frac{4} 3, \frac{7}5, \frac{10}7, \frac{17}{12}$.

Answer: $1, 2, \frac{3} 2, \frac{4} 3, \frac{7}5, \frac{10}7, \frac{17}{12}$

import math as m
def g():
    S = []
    for p in range(0, 10001):
        for q in range(1, 10001):
                if m.gcd(p,q)==1:
                    if -12 < (12 * p * q - 17 * q * q) < 12:
                        S.append([p, q])
    return S

print(g())