Diophantine PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Linear Diophantine Equations

In the third century, Diophantus of Alexandria


wrote a book called Arithmetic, consisiting of
problems and theor solutions which can today be
formulated as polynomial equations in one or more
variables with integer coefficients; all the solutions
to these equations were meant to be positive
integers (or sometimes, rational numbers).

(It is important to note that these equations were


not algebraic—algebraic notation and symbolic
methods were not to be invented for some 700
years—and that there was a long history of similar
problem solving known to Babylonian
mathematics.)

From the tradition of Diophantus, we call any


equation whose solutions are meant to be integers a
Diophantine equation. A very important class of
Diophantine equations are of linear type, and the
simplest nontrivial equation of this type has the
form

Given integers a, b, c, find integers x, y so that


ax + by = c.

Our discussion of how the gcd (a, b) has the form


ax + by for a suitable choice of x, y suggests that c
must be related to (a, b). This is indeed the case.
Brahmagupta’s Theorem Given integers a, b, c,
the Diophantine equation

(*) ax + by = c

has no solutions unless (a, b)|c, in which case


solutions to (*) are identical with solutions to

a b c
(**) x+ y= .
(a,b) (b,c) (a,b)

If x = x0, y = y0 is any one solution to (**), then all


solutions have the form

b a
x = x0 + k, y = y 0 - k for any integer k.
(a,b) (a,b)

Proof If (*) has a solution, then since (a, b) divides


the left side of the equation, it must divide the
† right: (a, b)|c. When this condition holds, dividing
through (*) by (a, b) yields (**), so both equations
have the same set of solutions. Putting
a b c
a¢ = , b¢ = , c¢ = ,
(a,b) (a,b) (a,b)
note that since a¢ and b¢ are relatively prime, we
can, by the extended Euclidean algorithm, find
integers X, Y so that a¢X + b¢Y = 1. It follows that
x0 =†c¢X , y0 = c†¢Y satisfy (**). Thus, (**) is solvable.



If x = x0, y = y0 is any one solution to (**) and
x = x1, y = y1 is another, then subtracting these two
equations gives the relation a¢(x 0 - x1 ) = -b¢( y0 - y1 ).
And since a¢ and b¢ have no common factors, we
conclude that a¢ | (y 0 - y1 ), b¢ | (x0 - x1 ). It follows that
y1 = y0 - ka¢ , and so also x1 = x0 + kb¢ . //


What is more, in light of the extended Euclidean
† †
algorithm, the theorem suggests how to compute
† the solution set†to the Diophantine equation
ax +by = c. We illustrate with an example of a
problem from Euler:

A farmer lays out the sum of 1770 crowns in purchasing horses


and oxen. He pays 31 crowns for each horse and 21 crowns for
each ox. How many horses and oxen did the farmer buy?

With x = number of horses and y = number of oxen,


the problem becomes one of solving the
Diophantine equation 31x + 21y = 1770. Since
(31,21) = 1, we compute, by the extended Euclidean
algorithm:

31 1 0
21 0 1 1
10 1 -1 2
1 -2 3

whence 1 = -2⋅31 + 3 ⋅21 and by multiplying through


by 1770 we get 1770 = -3540 ⋅31+ 5310 ⋅ 21.



Therefore, x0 = –3540, y0 = 5310 is one solution.
The entire solution set has the form

x = -3540 + 21k, y = 5310 - 31k

where k is any integer.

See† Fig 2.6.1 (p. 49) for an indication of the


geometric interpretation of this solution. Since the
equation is a Diophantine one, all solutions points
of the integer lattice in the plane that lie on the
line 31x +21y =1770.

It is also sometimes desirable to restrict attention


to positive integer solutions only. (Diophantus does
this in the Arithmetic.) From the general solution,
it is a simple addition of inequality conditions that
resolves this extra requirement. In the example we
worked out above, this proceeds thusly:

-3540 + 21k ≥ 0 5310 - 31k ≥ 0


21k ≥ 3540 5310 ≥ 31k
k ≥ 168.57... 171.29... ≥ k

Consequently, since k must be an integer, k = 169,


170, or 171, leading to precisely three solutions:
† †
(x,y) = (9,71) = (30,40) = (51,9)

You might also like