Next: To solve
Up: How to Solve
Previous: How to Solve
Proposition 1.1
Suppose
![$ a,b\in\mathbb{Z}$](img7.png)
and
![$ \gcd(a,b)=d$](img8.png)
. Then
there exists
![$ x,y\in\mathbb{Z}$](img9.png)
such that
I won't give a formal proof of this proposition, though there
are many in the literature. Instead I will show you how to
find
and
in practice, because that's what you will
need to do in order to solve equations like
.
Example 1.2
Let
![$ a=5$](img12.png)
and
![$ b=7$](img13.png)
.
The steps of the Euclidean
![$ \gcd$](img14.png)
algorithm are:
On the right, we have written each partial remainder as a
linear combination of
![$ a$](img23.png)
and
![$ b$](img24.png)
. In the last step, we write
![$ \gcd(a,b)$](img25.png)
as a linear combination of
![$ a$](img23.png)
and
![$ b$](img24.png)
, as desired.
That example wasn't too complicated, next we try a much longer example.
Example 1.3
Let
![$ a=130$](img26.png)
and
![$ b=61$](img27.png)
. We have
Thus
![$ x=130$](img42.png)
and
![$ y=-49$](img43.png)
.
Remark 1.4
For our present purposes it will always be sufficient to find one
solution to
![$ ax+by=d$](img44.png)
. In fact, there are always
infinitely many solutions. If
![$ x, y$](img45.png)
is a solution to
then for any
![$ \alpha\in\mathbb{Z}$](img47.png)
,
is also a solution, and all
solutions are of the above form for some
![$ \alpha$](img49.png)
.
It is also possible to compute
and
using PARI.
? ?bezout
bezout(x,y): gives a 3-dimensional row vector [u,v,d] such that
d=gcd(x,y) and u*x+v*y=d.
? bezout(130,61)
%1 = [23, -49, 1]
Next: To solve
Up: How to Solve
Previous: How to Solve
William A Stein
2001-09-25