You are on page 1of 8

DIOPHANTINE EQUATION

These equations are of great importance in programming contest. In solving real life problems.
In mathematics, a Diophantine equation is a polynomial equation in two or more unknowns such that only
the integer solutions are searched or studied (an integer solution is a solution such that all the unknowns take
integer values). A linear Diophantine equation is an equation between two sums of monomials of degree zero or
one. An exponential Diophantine equation is one in which exponents on terms can be unknowns.
Diophantine problems have fewer equations than unknown variables and involve finding integers that work
correctly for all equations. In more technical language, they define analgebraic curve, algebraic surface, or more
general object, and ask about the lattice points on it.
The word Diophantine refers to the Hellenistic mathematician of the 3rd century, Diophantus of Alexandria, who
made a study of such equations and was one of the first mathematicians to introduce symbolism into algebra. The
mathematical study of Diophantine problems that Diophantus initiated is now called Diophantine analysis.
While individual equations present a kind of puzzle and have been considered throughout history, the formulation of
general theories of Diophantine equations (beyond the theory ofquadratic forms) was an achievement of the
twentieth century.

Linear Diophantine equations[edit]


One equation[edit]
The simplest linear Diophantine equation takes the form ax + by = c, where a, b and c are given integers. The
solutions

are

completely

solution (where x and y are

described
integers) if

by

the

and

following
only

if c is

theorem: This
a

multiple

Diophantine
of

equation

the greatest

has

common

divisor of a and b. Moreover, if (x, y) is a solution, then the other solutions have the form (x + kv, y - ku), where k is
an arbitrary integer, and u and v are the quotients of a and b (respectively) by the greatest common divisor
of a and b.
Proof: If d is this greatest common divisor, Bzout's identity asserts the existence of integers e and f such
that ae + bf = d. If c is a multiple of d, then c = dh for some integer h, and (eh, fh) is a solution. On the other hand,
for every integers x and y, the greatest common divisor d of a and b divides ax + by. Thus, if the equation has a
solution, then c must be a multiple of d. If a = ud and b = vd, then for every solution (x, y), we have
,
showing that (x + kv, y - ku) is another solution. Finally, given two solutions such that ax1 + by1 = ax2 + by2 = c,
one deduces that u (x2 - x1) + v (y2 - y1) = 0. As u and v are coprime,Euclid's lemma shows that there exists an
integer k such that x2 - x1 = kv and y2 - y1 = -ku. Therefore x2 = x1 + kv and y2 = y1 - kv, which completes the
proof.
A Diophantine equation is an equation in which only integer solutions are allowed.
Hilbert's 10th problem asked if an algorithm existed for determining whether an arbitrary Diophantine equation has a solution. Such an
algorithm does exist for the solution of first-order Diophantine equations. However, the impossibility of obtaining a general solution was
proven by Yuri Matiyasevich in 1970 (Matiyasevich 1970, Davis 1973, Davis and Hersh 1973, Davis 1982, Matiyasevich 1993) by
showing that the relation
(where
is the
thFibonacci number) is Diophantine. More specifically, Matiyasevich showed

that there is a polynomial in ,


integers , , , ... such that

, and a number of other variables , , , ... having the property that


.

iff there exist

Matiyasevich's result filled a crucial gap in previous work by Martin Davis, Hilary Putnam, and Julia Robinson. Subsequent work by
Matiyasevich and Robinson proved that even for equations in thirteen variables, no algorithm can exist to determine whether there is a
solution. Matiyasevich then improved this result to equations in only nine variables (Jones and Matiyasevich 1982).
Ogilvy and Anderson (1988) give a number of Diophantine equations with known and unknown solutions.
A linear Diophantine equation (in two variables) is an equation of the general form

(1)
where solutions are sought with , , and integers. Such equations can be solved completely, and the first known solution was
constructed by Brahmagupta. Consider the equation

(2)
Now use a variation of the Euclidean algorithm, letting

and
(3)
(4)
(5)
(6)

Starting from the bottom gives


(7)
(8)
so
(9)
(10)
Continue this procedure all the way back to the top.
Take as an example the equation

(11)
and apply the algorithm above to obtain

(12)

The solution is therefore

How to Solve a Linear Diophantine Equation


A Diophantine equation is an algebraic equation with the additional restriction that we are only
concerned with solutions in which the variables are integers. In general, Diophantine equations are
very difficult to solve and there are many approaches. (Fermat's Last Theorem is a famous
Diophantine equation that sat unsolved for over 350 years.)

However, linear Diophantine equations of the form ax + by = c can be solved relatively easily by the
algorithm described here. By using this method, we can find (4,7) as the only solution in positive
integers to 31x + 8y = 180. Division in modular arithmetic can also be expressed as a linear
Diophantine equation. For example, 12/7 (mod 18) asks for the solution to 7x = 12 (mod 18) and can
be rewritten as 7x = 12 + 18y or 7x - 18y = 12. While some of the diophantine equations are
extremely difficult to solve, you can give this one a try.
Step 1. If it isn't already, put the equation in the form ax + by = c.

2
Apply Euclid's Algorithm to the coefficients a and b. This has two purposes. First, we want to
know if a and b have a common factor. If we are trying to solve 4x+ 10y = 3, we can then quickly
assert that since the left-hand side is always even and the right-hand side always odd, no integer
solutions exist. Similarly, if we had 4x + 10y = 2, we could simplify the problem to 2x + 5y = 1. The
second reason is that, provided a solution exists, we can construct one from the sequence of
quotients obtained from Euclid's Algorithm.

3
If a, b, and c have a common factor, then simplify the equation by dividing the left and right
sides of the equation by that factor. If a and b have a common factor not shared by c, then stop.
There are no integer solutions.

4
Build a three row table as shown.

5
Populate the top row of the table with the quotients from Euclid's Algorithm.The image shows
how this would look for solving 87x - 64y = 3.

6
Populate the bottom two rows from left to right by the following procedure:For each cell,
compute the product of the top cell of that column and the cell immediately to the left of the empty
cell. Fill the empty cell with that product plus the value two cells to the left.

7
Look at the last two columns in the completed table. The final column should contain a and b, the
coefficients from the equation in step 3. (If not, recheck your calculations.) The second to last column
will contain two other numbers. In the example with a = 87 and b = 64, the penultimate column
contains 34 and 25.

8
Notice that 87*25 - 64*34 = -1. The determinant of the 2x2 matrix in the lower right will always be
either plus or minus 1. If negative, multiply both sides of the identity by -1 to get -87*25 + 64*34 = 1.
This observation is the starting point from which we can build a solution.

9
Return to the original equation. Rewrite the identity in the previous step as either 87*(-25) + 64*(34)
= 1 or 87*(-25) - 64*(-34) = 1, whichever best resembles the original equation. For the example, the
second choice is preferred since it matches the -64y term in the original when y = -34.

10
Only now do we need to look at the constant term c on the right-hand side of the
equation. Since the previous equation demonstrates a solution to ax + by = 1, multiplying both sides
by c to get a(cx) + b(cy) = c. If (-25, -34) is a solution to 87x - 64y = 1, then (-75, -102) is a solution to
87x-64y = 3.

11
If a linear Diophantine equation has any solutions, then it has infinitely many solutions. This is
because ax + by = a(x+b) + b(y-a) = a(x+2b) + b(y-2a), and in general ax + by = a(x+kb) + b(y-ka) for
any integer k. Therefore, since (-75,-102) is a solution to 87x-64y = 3, other solutions are (-11,-15),
(53,72), (117,159), etc. The general solution could be written as (53+64k, 72+87k) where k is any
integer.

Linear Diophantine equations can be used in factorization strategies in the RSA algorithm. But I agree
with Qiaochu Yuan. The most interesting part of Diophantine equations is how they work by themselves
outside of 'real life'.

Linear Diophantine Equations

A Diophantine equation is an equation which is to be solved over the integers.

A linear Diophantine equation of the form


has solutions if and only if
There is a similar result for linear Diophantine equations in more than 2 variables.

A Diophantine problem is one in which the solutions are required to be integers. Abusing
terminology, I'll refer to Diophantine equations, meaning equations which are to be solved over
the integers.

Example.

has many solutions over the reals; for example,

However, this equation has no nonzero integer solutions.

Example. Since
For example,
equation

(b) If

Here

, and
. That is, the Diophantine
has solutions --- in fact, infinitely many solutions.

Theorem. Let

(a) If

, there are integers x and y such that

. Consider the Diophantine equation

, there are no solutions.


, there are infinitely many solutions of the form

is a particular solution, and

Before I give the proof, I'll give some examples, and also discuss the three variable
equation
.

Example. Solve

Since
, there are infinitely many solutions. By trial and error,
particular solution. Hence, the general solution is

For example, setting

produces the solution

Example. Solve
Since

, is a

.
, the equation has no solutions.

Example. Solve

First, I'll factor

out of the first two coefficients:

Notice that
, so those two fractions are actually integers. I'm not simplifying
you can see what's going on.

so that

Let

The equation becomes

, so this two variable equation is solvable.


the general solution is

Now I have to find x and y:

, is a particular solution, so

Thus,

This is a two variable equation. Since


solution. Therefore, the general solution is

, it's solvable.

, is a particular

All together, the general solution to the original three variable equation is

In general, if there is a solution to the linear Diophantine equation

the solution will depend on

parameters --- exactly as you'd expect from linear algebra.

Proof. (two variable case) Consider the linear Diophantine equation

Case 1. Suppose

. If x and y solve the equation, then

This contradiction shows that there cannot be a solution.


Case 2. Suppose

. Write

for

. There are integers m and n such that

Then

Hence,

, is a solution.

Suppose

, is a particular solution. Then

This proves that

is a solution for every

Finally, I want to show that every solution has this form. Suppose then that
Then
and
imply

is a solution.

Therefore,

Now
divides the left side, so it divides the right side. However,
Therefore,

Thus,

Substitute this back into the last x-y equation:

This is the result stated in the theorem (with an unimportant switch of k and

.)

You might also like