Algebra – Integer Pair Points on Linear Functions

algebra-precalculuselementary-number-theory

It's possible I'm missing something obvious, but I'm struggling with a problem dealing with finding points on a line where both the $x$ and $y$ coordinates are integers. Basically, given a line ($y=mx+b$) find one point on the line where both $x$ and $y$ are integers. It would be helpful to know in what cases this doesn't work as well. I think I know a few of them, for example $y=1.2x+0.1$ and $y=3x+0.5$ have no integer-integer pairings. The first one has no such pairings as the first decimal value will never be odd for any values of $x$, and therefore there will always be a $0.1$ hanging around. The second, since $x$ values are integers, would always be an integer $+ 0.5$, which will never be an integer.

Thank you for any help!

Best Answer

Assume that the equation is $y=mx+b$, where $m,b\in\mathbb{R}$. If either or both of $m$ and $b$ are irrational, then $mx+b$ would be irrational. Hence, the equation cannot have an integer pair as a solution.
Thus, we assume that $m,b\in\mathbb{Q}$. As a consequence, we have $m=\frac{m_1}{m_2}$ and $b=\frac{b_1}{b_2}$, where $m_1,m_2,b_1,b_2\in\mathbb{Z}$ and $m_2,b_2\neq 0$. Substituting these in the equation, we get $y=\frac{m_1}{m_2}x+\frac{b_1}{b_2}$. This equation can be converted into an equivalent equation of the form $px+qr=r$, where $p,q,r\in\mathbb{Z}$. This is called a 'Linear Diophantine equation'.
A well-known result is that any equation of the above form has an integer solution if and only if $GCD(p,q)|r$ (i.e., the greatest common divisor of $p$ and $q$ divides $r$).
Once an equation satisfies the above condition, we can determine an integer solution. This can be done using the 'Extended Euclidean algorithm', which gives a solution to the equation $px+qy=GCD(p,q)$. Let $(x',y')$ be a solution. Since it satisfies the equation, we have $px'+qy'=GCD(p,q)$. Multiply the whole equation by $c=\frac{r}{GCD(p,q)}$. This gives $cpx'+cqx'=c\cdot GCD(p,q)$ or equivalently, $p(cx')+q(cy')=r$. Thus, $(cx',cy')$ is a solution to $px+qy=r$.