You are on page 1of 3

Lec07: Linear Diophantine Equations

09 March 2023, MATH4024-Number Theory, Lecturer: Prof A. Munagi

1 The Linear Diophantine Equation


By a Diophantine Equation we understand an equation where only integer solutions are
required.
(Named after the ancient Greek mathematician Diophantus of Alexandria (c. 250
A.D.)).
The equation
ax + by = c, where a, b, c ∈ Z (1)
is called a linear diophantine equation in two variables.
Define a lattice point in the plane to be a point (x, y) in which x and y are both
integers. Note that (x, y) is a solution of (1) if and only if it is a lattice point in the
plane that lies on the straight line (1). It is clear that if the line (1) passes through one
lattice point, it must pass through infinitely many.

Theorem 1.1. Let a and b be integers with d = (a, b). The equation ax + by = c, has
no integral solutions if d - c. If d|c, then there are infinitely many integral solutions.
Moreover, if x = x0 , y = y0 is a particular solution of the equation, then all solutions
are given by
x = x0 + (b/d)n, y = y0 − (a/d)n,
where n is an arbitrary integer.

Proof. Assume that x, y ∈ Z such that ax + by = c. Then, since d|a and d|b, it follows
that d|c. Hence if d - c, there are no integral solutions of the equation.
Now assume that d|c. Since d = (a, b), there are integers s, t with d = as + bt.
We can find an integer e such that c = de. Therefore

c = de = (as + bt)e = a(se) + b(te).

Hence a particular solution of the equation is (x0 , y0 ) = (se, te).

1
Prof A. Munagi Linear Diophantine Equations MATH4024-Number Theory

To show that there are infinitely many solutions, let x = x0 + (b/d)n and y =
y0 − (a/d)n for any n ∈ Z. Then (x, y) is a solution because

ax + by = ax0 + a(b/d)n + by0 − b(a/d)n = ax0 + by0 = c.

Lastly we show that every solution of ax + by = c must be of the stated form.


Suppose x, y are integers with ax + by = c. Since ax0 + by0 = c, we subtract to get
(ax + by) − (ax0 + by0 ) = 0,
which implies that a(x − x0 ) + b(y − y0 ) = 0, that is, a(x − x0 ) = b(y0 − y).
Dividing both sides by d, we obtain

(a/d)(x − x0 ) = (b/d)(y0 − y).

But we know that (a/d, b/d) = 1. It follows that (a/d)|(y0 − y). So there is an integer
n such that y0 − y = (a/d)n, that is, y = y0 − (a/d)n.
Substituting this value of y into a(x − x0 ) = b(y0 − y) gives a(x − x0 ) = b(a/dn), which
implies that x = x0 + (b/d)n.

1.1 Examples and Exercises


(1) Consider 17x + 13y = 100.
We have (17, 13) = 1 and 1|100; so there are infinitely many solutions.
By the Euclidean algorithm, 17(−3) + 13(4) = 1.
Multiplying both sides by 100 gives 17(−300) + 13(400) = 100.
Hence x = −300 and y = 400 is a solution. So all solutions are given by
x = −300 + 13t, y = 400 − 17t for any t ∈ Z.
(2) Consider 60x + 21y = 97.
We have (60, 21) = 3 but 3 - 97. So the given equation has no integer solutions.
(3) Consider the problem of purchasing R5100 worth of travelers’ checks, using R200
and R500 checks. How many of each type of check should be purchased?
Let x = number of R200 checks and let y = number R500 checks. Then we need to
find nonnegative solutions of the equation 200x + 500y = 5100.
Note that (200, 500) = 100, and 100|5100. So there are infinitely many solutions.
Using the Euclidean algorithm we obtain 200(−2) + 500(1) = 100.
Since 5100 = 51 · 100, we multiply both sides by 51 to get 200(−102) + 500(51) = 5100.
So a particular solution is (x0 , y0 ) = (−102, 51). So all integral solutions are given by
x = −102 + 5n, y = 51 − 2n for any n ∈ Z. (2)
For nonnegative solutions we must have −102 + 5n ≥ 0 and 51 − 2n ≥ 0,
which gives n ≥ 1025
= 20 + 52 and n ≤ 51 2
= 25 + 12 , that is, 20 + 25 ≤ n ≤ 25 + 21 .
Hence n = 21, 22, 23, 24, 25.
Substituting these values into (2) gives the following five solutions:
(x, y) = (3, 9), (8, 7), (13, 5), (18, 3) and (23, 1).

2
Prof A. Munagi Linear Diophantine Equations MATH4024-Number Theory

Interpretations of these solutions should be clear; for example, (x, y) = (8, 7) means
that we could purchase 8 copies of 200-rand checks and 7 copies of 500-rand checks,
etc, (note that 200 · 8 + 500 · 7 = 5100) . . . .

Exercise 1. Find all solutions for each of the following Diophantine equations.
(a) 2x + 5y = 11
(b) 21x + 14y = 147
(c) 102x + 222y = 1256

Exercise 2. A student returning from Europe changes his French francs and Swiss
francs into SA money. If he receives R1706 and has received 19 cents for each French
francs and 59 cents for each Swiss franc, how much of each type of currency did he
exchange?

Exercise 3. A postal clerk has only 28- and 35-rand stamps to sell. What combinations
of these may be used to mail a package requiring postage of exactly each of the following
amounts?
(a) R350 (b) R400 (c) R777.

Exercise 4. (a) Find all solutions in integers of 15x + 7y = 210


(b) Determine the number of solutions in positive integers.

Exercise 5. Find the solutions of the equation 91x + 221y = 1053. Are there solutions
in positive integers?

Exercise 6. Find all solutions in positive integers of 11x + 7y = 200.

You might also like