Main Question for this Lesson
Given a linear Diophantine equation
In the previous lesson, Linear
Diophantine Equations Part 1, we began a discussion of linear
Diophantine equations. In that lesson, we focused on what these
equations are, when a solution exists, and how to find a solution when
one exists. Recall, a linear Diophantine equation is an equation of the
form
In this lesson, we will explore how to find all solutions to linear Diophantine equations, and also look at finding solutions under various constraints.
Given a linear Diophantine equation
Consider the following example, which was also discussed in the previous lesson.
A robot can move backwards or forwards with big steps (
Are there other moves that the robot can make to end up
Solution:
In the previous lesson, we saw that we need to solve the equation
But there are many other solutions. Using guess and check, we find some other solutions:
In fact, there are infinitely many integer solutions!
Do you notice a pattern appearing among these solutions?
Try picking two solutions, say
Try all of the pairs. What do you notice?
First, when we say we are looking for the complete solution to an equation, we mean that we are looking for all solutions to the equation.
Let’s look closer at the linear Diophantine equation in Example
This is the equation of a line with slope
Thus, the solutions to the linear Diophantine equation
We know that
The equation
The slope of this line is equal to
Notice that, in reducing this fraction, we factored out a common
factor of
Now, from
We can move left
Or, we can move right
From
We can continue in this manner to generate all of the points on the line with integer coordinates.
In general, every point
That is, the complete solution to the linear Diophantine
equation
Suppose that
Then, the complete solution is given by
Let’s check this for the robot example. Here, we looking to find the
complete solution to the linear Diophantine equation
According to this theorem, the complete solution to the linear
Diophantine equation
As expected, this is exactly we had found earlier!
If we had started with the solution
Can you convince yourself that this is the same solution set as we
had found starting with the solution
First, find a solution
The complete solution to the linear Diophantine equation is then
Determine the complete solution to the linear Diophantine equation
Solution:
To determine the complete solution, we first need to find one solution. We will use the techniques we learned in the previous lesson to first find one solution.
We begin by calculating
Since
To find a solution, we work backwards through the steps above.
From line
Substituting for
Multiplying both sides of this equation by
To determine the complete solution, we calculate:
Thus, the complete solution to the linear Diophantine equation
Notice that in order to find the complete solution to a linear Diophantine equation, we need to start with a solution, but it does not matter how we find this solution! If we can find a solution by inspection, trial-and-error, or some other method, this will also suffice! If we can find a solution quickly by inspection or trial-and-error, this can lead to quickly finding the complete solution, as we’ll see in our next example.
Determine the complete solution to the linear Diophantine equation
Solution:
To determine the complete solution, we first need to find one solution. To do so, we could use the techniques we learned in the previous lesson, as we did in Example 2; however, if we can spot a solution by inspection, this can also be used to generate the complete solution!
By inspection, we can see that
That is, the complete solution is
Thus, the complete solution to the linear Diophantine equation
Determine the complete solution to the linear Diophantine equation
To determine the complete solution, we first need to find one solution.
By inspection, we can see that
That is, the complete solution is
Thus, the complete solution to the linear Diophantine equation
Determine the complete solution to the linear Diophantine equation
To determine the complete solution, we first need to find one solution. We will use the techniques we learned in the previous lesson to first find one solution.
We begin by calculating
Since
To find a solution, we work backwards through the steps above.
From line
Substituting for
Multiplying both sides of this equation by
To determine the complete solution, we calculate:
Thus, the complete solution to the linear Diophantine equation
Notice that what we have seen so far tells us that if a linear
Diophantine equation has a solution, then it has infinitely many (since
there are infinitely many choices for the integer
Sara needs
Solution:
We need to solve the equation
In Question
The answer suggests that we should use
In Example
First, what is the complete solution to this problem? In this problem
That is, the complete solution is
For the solution to make sense in the context of the problem, we need
both
Similarly,
Solving for
That is, if
Thus, in order for there to be a non-negative number of quarters and
dimes, we must have
Using
Determine all solutions to the linear Diophantine equation
Solution:
From Example
Therefore, to have
Substituting in each value of