Lattice Points on Lines
The point of this project is to find out which straight lines contain lattice
points (points with whole-number coordinates). Every line (other than vertical
ones) has a slope and an intercept. We can write its equation as

.
Throughout, we will use the greek letters

and

to denote irrational numbers. All other numbers will
be whole numbers (e.g.

).
The following table shows the four possibilities:

As usual, this should be written up neatly, carefully, and in complete readable sentences. Try to give reasons for all of your assertions.
Explain why there is exactly one lattice point in the first case. (What is it, and why?)
Explain why there can be no lattice points on the line in the second case.
In the third case, give examples of lines where there is a lattice point on the line, and where there can't be any. Justify your statements.
Explain exactly what conditions determine the existence of a lattice point in
the last case. Give specific examples of such lines which do and don't contain
lattice points. (You should assume that

and

.)
If there is a lattice point, explain how to find all
lattice points; give an example.
Write a Matlab program which inputs the numbers

,
and the size N of a square in the first quadrant, and then finds all the
lattice points on the line

which lie in the square
(
).
(You'll need a double "for" loop; multiply the equation through by

to get rid of fractions.)
Since all numbers are stored in a computer as a finite number of "digits", no number can be irrational as far as a computer is concerned. Thus, we can not use a computer to tell when a number is irrational or not, so we can not use it to tell when lines with irrational coefficients contain rational points.
One final note. If a line has irrational slope

,
and it contains no lattice point, it can be proved that it "passes arbitrarily
close" to lattice points. This means that, for any distance

you may specify, no matter how small (but not

),
there is some lattice point that is within distance

of the line. This is not easy to show, and is sometimes proved in a "real
analysis" course. If you are interested in a proof, see me.