Linear Diophantine Equations
Lesson · Intermediate
Number Theory
Linear Diophantine Equations
Example:
Since
there is no answer.
1) Divide both sides by gcd(15,10).
2) Try to find one x and y that satisfy the equation.
or
General Solution
In General
1) Check gcd(a,b) | n.
2) Divide both sides by gcd(a,b).
3) Find one answer that satisfies
4) Multiply by n'.
(If finding one example to satisfy a'x+b'y=n' is easy, skip 3rd step.)
5) General Answers:
(coefficient of k cancel out)
Reducing Coefficients (Scaling Trick)
Solution 1
Solution 2
coefficients of k cancel out.
We can also solve Diophantine equations using modular arithmetic.
How many nonnegative integer solutions are there to
Modulo 7,
so
Thus
Substitute:
so
Since x,y ≥ 0,
Therefore, there are
nonnegative integer solutions.
Positive integers x and y satisfy
Find the least possible value of x + y.
Reduce modulo 23:
so
Since
we get
Thus
Substituting into the original equation,
which gives
Therefore,
For positive x,y, the smallest possible k is 0.
Hence the minimum is
Find the smallest positive integer N that can be written in both forms
and
for positive integers x,y.
Equating the expressions,
so
Reduce modulo 17:
Since
we get
Therefore,
The smallest positive value occurs at
Thus
So the smallest possible value is
Find all integer solutions of
Rewrite:
Since 49 is odd,
Write
Also,
Since
we get
Write
Substitute:
Divide by 14:
One solution is
because
Therefore,
Hence,