Skip to main content

Section 8.3 Linear Diophantine Equations

Beginning Activity Beginning Activity 1: Integer Solutions for Linear Equations in One Variable

1.

Does the linear equation 6x=42 have a solution that is an integer? Explain.

2.

Does the linear equation 7x=βˆ’21 have a solution that is an integer? Explain.

3.

Does the linear equation 4x=9 have a solution that is an integer? Explain.

4.

Does the linear equation βˆ’3x=20 have a solution that is an integer? Explain.

5.

Prove the following theorem:

Beginning Activity Beginning Activity 2: Linear Equations in Two Variables

1.

Find integers x and y so that 2x+6y=25 or explain why it is not possible to find such a pair of integers.

2.

Find integers x and y so that 6xβˆ’9y=100 or explain why it is not possible to find such a pair of integers.

3.

Notice that x=2 and y=1 is a solution of the equation 3x+5y=11, and that x=7 and y=βˆ’2 is also a solution of the equation 3x+5y=11.

(a)

Find two pairs of integers x and y so that x>7 and 3x+5y=11. (Try to keep the integer values of x as small as possible.)

(b)

Find two pairs of integers x and y so that x<2 and 3x+5y=11. (Try to keep the integer values of x as close to 2 as possible.)

(c)

Determine formulas (one for x and one for y) that will generate pairs of integers x and y so that 3x+5y=11.

Hint.

The two formulas can be written in the form x=2+km and y=1+kn, where k is an arbitrary integer and m and n are specific integers.

4.

Notice that x=4 and y=0 is a solution of the equation 4x+6y=16, and that x=7 and y=βˆ’2 is a solution of the equation 4x+6y=16.

(a)

Find two pairs of integers x and y so that x>7 and 4x+6y=16. (Try to keep the integer values of x as small as possible.)

(b)

Find two pairs of integers x and y so that x<4 and 4x+6y=16. (Try to keep the integer values of x as close to 4 as possible.)

(c)

Determine formulas (one for x and one for y) that will generate pairs of integers x and y so that 4x+6y=16.

Hint.

The two formulas can be written in the form x=4+km and y=0+kn, where k is an arbitrary integer and m and n are specific integers.

In the two beginning activities, we were interested only in integer solutions for certain equations. In such instances, we give the equation a special name.

Definition.

An equation whose solutions are required to be integers is called a Diophantine equation.

Diophantine equations are named in honor of the Greek mathematician Diophantus of Alexandria (third century C.E.). Very little is known about Diophantus' life except that he probably lived in Alexandria in the early part of the fourth century C.E. and was probably the first to use letters for unknown quantities in arithmetic problems. His most famous work, Arithmetica, consists of approximately 130 problems and their solutions. Most of these problems involved solutions of equations in various numbers of variables. It is interesting to note that Diophantus did not restrict his solutions to the integers but recognized rational number solutions as well. Today, however, the solutions for a so-called Diophantine equation must be integers.

Definition.

If a and b are integers with a≠0, then the equation ax=b is a linear Diophantine equation in one variable.

Theorem 8.20 in Beginning Activity 1 provides us with results that allow us to determine which linear diophantine equations in one variable have solutions and which ones do not have a solution.

A linear Diophantine equation in two variables can be defined in a manner similar to the definition for a linear Diophantine equation in one variable.

Definition.

Let a, b, and c be integers with a≠0 and b≠0. The Diophantine equation ax+by=c is called a linear Diophantine equation in two variables.

The equations that were investigated in Beginning Activity 2 were linear Diophantine equations in two variables. The problem of determining all the solutions of a linear Diophantine equation has been completely solved. Before stating the general result, we will provide a few more examples.

Example 8.21. A Linear Diophantine Equation in Two Variables.

The following example is similar to the examples studied in Beginning Activity 2.

We can use substitution to verify that x=2 and y=βˆ’1 is a solution of the linear Diophantine equation

4x+3y=5.

The following table shows other solutions of this Diophantine equation.

x y
2 βˆ’1
5 βˆ’5
8 βˆ’9
11 βˆ’13
βˆ’1 3
βˆ’4 7
βˆ’7 11
βˆ’10 15

It would be nice to determine the pattern that these solutions exhibit. If we consider the solution x=2 and y=βˆ’1 to be the β€œstarting point,” then we can see that the other solutions are obtained by adding 3 to x and subtracting 4 from y in the previous solution. So we can write these solutions to the equation as

x=2+3k and y=βˆ’1βˆ’4k,

where k is an integer. We can use substitution and algebra to verify that these expressions for x and y give solutions of this equation as follows:

4x+3y=4(2+3k)+3(βˆ’1βˆ’4k)=(8+12k)+(βˆ’3βˆ’12k)=5.

We should note that we have not yet proved that these solutions are all of the solutions of the Diophantine equation 4x+3y=5. This will be done later.

If the general form for a linear Diophantine equation is ax+by=c, then for this example, a=4 and b=3. Notice that for this equation, we started with one solution and obtained other solutions by adding b=3 to x and subtracting a=4 from y in the previous solution. Also, notice that gcd(3,4)=1.

Progress Check 8.22. An Example of a Linear Diophantine Equation.

(a)

Verify that the following table shows some solutions of the linear Diophantine equation 6x+9y=12.

x y
2 0
5 βˆ’2
8 βˆ’4
11 βˆ’6
βˆ’1 2
βˆ’4 4
βˆ’7 6
βˆ’10 8

(b)

Follow the pattern in this table to determine formulas for x and y that will generate integer solutions of the equation 6x+9y=12. Verify that the formulas actually produce solutions for the equation 6x+9y=12.

Solution.

x=2+3k and y=0βˆ’2k, where k can be any integer. Again, this does not prove that these are the only solutions.

Progress Check 8.23. Revisiting Beginning Activity 2.

Do the solutions for the linear Diophantine equations in Beginning Activity 2 show the same type of pattern as the solutions for the linear Diophantine equations in Example 8.21 and Progress Check 8.22? Explain.

Solution.

One of the Diophantine equations in Beginning Activity 2 was 3x+5y=11. We were able to write the solutions of this Diophantine equation in the form

x=2+5k and y=1βˆ’3k,

where k is an integer. Notice that x=2 and y=1 is a solution of this equation. If we consider this equation to be in the form ax+by=c, then we see that a=3, b=5, and c=11. Solutions for this equation can be written in the form

x=2+bk and y=1βˆ’ak,

where k is an integer.

The other equation was 4x+6y=16. So in this case, a=4, b=6, and c=16. Also notice that d=gcd(4,6)=2. We note that x=4 and y=0 is one solution of this Diophantine equation and solutions can be written in the form

x=4+3k and y=0βˆ’2k,

where k is an integer. Using the values of a, b, and d given above, we see that the solutions can be written in the form

x=2+bdk and y=0βˆ’ad,

where k is an integer.

The solutions for the linear Diophantine equations in Beginning Activty 2, Example 8.21, and Progress Check 8.22 provide examples for the second part of Theorem 8.24.

Proof.

The proof of Item 1 is Exercise 8.3.1. For Item 2, we let a, b, and c be integers with aβ‰ 0 and bβ‰ 0, and let d=gcd(a,b). We also assume that d∣c. Since d=gcd(a,b), Theorem 8.10 tells us that d is a linear combination of a and b. So there exist integers s and t such that

(79)d=as+bt.

Since d∣c, there exists an integer m such that c=dm. We can now multiply both sides of equation (79) by m and obtain

dm=(as+bt)mca(sm)+b(tm).

This means that x=sm, y=tm is a solution of ax+by=c, and we have proved that the Diophantine equation ax+by=c has at least one solution.

Now let x=x0, y=y0 be any particular solution of ax+by=c, let k∈Z, and let

(80)x=x0+bdky=y0βˆ’adk.

We now verify that for each k∈Z, the equations in (80) produce a solution of ax+by=c.

ax+by=a(x0+bdk)+b(y0βˆ’adk)=ax0+abdk+by0βˆ’abdk=ax0+by0=c.

This proves that the Diophantine equation ax+by=c has infinitely many solutions.

We now show that every solution of this equation can be written in the form described in equation (80). So suppose that x and y are integers such that ax+by=c. Then

(ax+by)βˆ’(ax0+by0)=cβˆ’c=0,

and this equation can be rewritten in the following form:

(81)a(xβˆ’x0)=b(y0βˆ’y).

Dividing both sides of this equation by d, we obtain

(ad)(xβˆ’x0)=(bd)(y0βˆ’y).

This implies that

ad divides (bd)(y0βˆ’y).

However, by Task 7.a in Section 8.2, gcd(ad,bd)=1, and so by Theorem 8.14, we can conclude that ad divides (y0βˆ’y). This means that there exists an integer k such that y0βˆ’y=adk, and solving for y gives

y=y0βˆ’adk.

Substituting this value for y in equation (81) and solving for x yields

x=x0+bdk.

This proves that every solution of the Diophantine equation ax+by=c can be written in the form prescribed in (2).

The proof of the following corollary to Theorem 8.24 is Exercise 8.3.2.

Progress Check 8.26. Linear Diophantine Equations.

(a)

Use the Euclidean Algorithm to verify that gcd(63,336)=21. What conclusion can be made about linear Diophantine equation 63x+336y=40 using Theorem 8.24? If this Diophantine equation has solutions, write formulas that will generate the solutions.

Solution.

Since 21 does not divide 40, Theorem 8.24 tells us that the Diophantine equation 63x+336y=40 has no solutions. Remember that this means there is no ordered pair of integers (x,y) such that 63x+336y=40. However, if we allow x and y to be real numbers, then there are real number solutions. In fact, we can graph the straight line whose equation is 63x+336y=40 in the Cartesian plane. From the fact that there is no pair of integers x,y such that 63x+336y=40, we can conclude that there is no point on the graph of this line in which both coordinates are integers.

(b)

Use the Euclidean Algorithm to verify that gcd(144,225)=9. What conclusion can be made about linear Diophantine equation 144x+225y=27 using Theorem 8.24? If this Diophantine equation has solutions, write formulas that will generate the solutions.

Solution.

To write formulas that will generate all the solutions, we first need to find one solution for 144x+225y=27. This can sometimes be done by trial and error, but there is a systematic way to find a solution. The first step is to use the Euclidean Algorithm in reverse to write gcd(144,225) as a linear combination of 144 and 225. See Section 8.1 to review how to do this. The result from using the Euclidean Algorithm in reverse for this situation is

144β‹…11+225β‹…(βˆ’7)=9.

If we multiply both sides of this equation by 3, we obtain

144β‹…33+225β‹…(βˆ’21)=27.

This means that x0=33,y0=βˆ’21 is a solution of the linear Diophantine equation 144x+225y=27. We can now use Theorem 8.24 to conclude that all solutions of this Diophantine equation can be written in the form

x=33+2259ky=βˆ’21βˆ’1449k,

where k∈Z. Simplifying, we see that all solutions can be written in the form

x=33+25ky=βˆ’21βˆ’16k,

where k∈Z.

We can check this general solution as follows: Let k∈Z. Then

144x+225y=144(33+25k)+225(βˆ’21βˆ’16k)=(4752+3600k)+(βˆ’4725βˆ’3600k)=27.

Exercises Exercises

1.

Prove Item 1 of Theorem 8.24:

Let a, b, and c be integers with a≠0 and b≠0, and let d=gcd(a,b). If d does not divide c, then the linear Diophantine equation ax+by=c has no solution.

2.

Prove Corollary 8.25.

Let a, b, and c be integers with a≠0 and b≠0. If a and b are relatively prime, then the linear Diophantine equation ax+by=c has infinitely many solutions. In addition, if (x0,y0) is a particular solution of this equation, then all the solutions of the equation are given by
x=x0+bky=y0βˆ’ak,
where k∈Z.

4.

A certain rare artifact is supposed to weigh exactly 25 grams. Suppose that you have an accurate balance scale and 500 each of 27 gram weights and 50 gram weights. Explain how to use Theorem 8.24 to devise a plan to check the weight of this artifact.

Hint.

Notice that gcd(50,27)=1. Start by writing 1 as a linear combination of 50 and 27.

Answer.

There are several possible solutions to this problem, each of which can be generated from the solutions of the Diophantine equation 27x+50y=25.

5.

On the night of a certain banquet, a caterer offered the choice of two dinners, a steak dinner for $25 and a vegetarian dinner for $16. At the end of the evening, the caterer presented the host with a bill (before tax and tips) for $1461. What is the minimum number of people who could have attended the banquet? What is the maximum number of people who could have attended the banquet?

Answer.

This problem can be solved by finding all solutions of a linear Diophantine equation 25x+16y=1461, where both x and y are positive. The mininum number of people attending the banquet is 66.

6.

The goal of this exercise is to determine all (integer) solutions of the linear Diophantine equation in three variables 12x1+9x2+16x3=20.

(a)

First, notice that gcd(12,9)=3. Determine formulas that will generate all solutions for the linear Diophantine equation 3y+16x3=20.

Answer.

y=12+16k,x3=βˆ’1βˆ’3k

(b)

Explain why the solutions (for x1 and x2) of the Diophantine equation 12x1+9x2=3y can be used to generate solutions for 12x1+9x2+16x3=20.

Answer.

If 3y=12x1+9x2 and 3y+16x3=20, we can substitute for 3y and obtain 12x1+9x2+16x3=20.

(c)

Use the general value for y from Task 8.3.6.a to determine the solutions of 12x1+9x2=3y.

Answer.

Rewrite the equation 12x1+9x2=3y as 4x1+3x2=y. A general solution for this linear Diophantine equation is

x1=y+3nx2=βˆ’yβˆ’4n.
(d)

Use the results from Task 8.3.6.a and Task 8.3.6.c to determine formulas that will generate all solutions for the Diophantine equation 12x1+9x2+16x3=20.

Note: These formulas will involve two arbitrary integer parameters. Substitute specific values for these integers and then check the resulting solution in the original equation. Repeat this at least three times.

7.

Use the method suggested in Exercise 8.3.6 to determine formulas that will generate all solutions of the Diophantine equation 8x1+4x2βˆ’6x3=6. Check the general solution.

8.

Explain why the Diophantine equation 24x1βˆ’18x2+60x3=21 has no solution.

9.

The purpose of this exercise will be to prove that the nonlinear Diophantine equation 3x2βˆ’y2=βˆ’2 has no solution.

(a)

Explain why if there is a solution of the Diophantine equation 3x2βˆ’y2=βˆ’2, then that solution must also be a solution of the congruence 3x2βˆ’y2β‰‘βˆ’2(mod3).

(b)

If there is a solution to the congruence 3x2βˆ’y2β‰‘βˆ’2(mod3), explain why there then must be an integer y such that y2≑2(mod3).

(c)

Use a proof by contradiction to prove that the Diophantine equation 3x2βˆ’y2=βˆ’2 has no solution.

10.

Use the method suggested in Exercise 8.3.9 to prove that the Diophantine equation 7x2+2=y3 has no solution.

Activity 49. Linear Congruences in One Variable.

Let n be a natural number and let a,b∈Z with aβ‰ 0. A congruence of the form ax≑b(modn) is called a linear congruence in one variable. This is called a linear congruence since the variable x occurs to the first power.

A solution of a linear congruence in one variable is defined similarly to the solution of an equation. A solution is an integer that makes the resulting congruence true when the integer is substituted for the variable x. For example,

  • The integer x=3 is a solution for the congruence 2x≑1(mod5) since 2β‹…3≑1(mod5) is a true congruence.

  • The integer x=7 is not a solution for the congruence 3x≑1(mod6) since 3β‹…7≑1(mod6) is a not a true congruence.

(a)

Verify that x=2 and x=5 are the only solutions the linear congruence 4x≑2(mod6) with 0≀x<6.

(b)

Show that the linear congruence 4x≑3(mod6) has no solutions with 0≀x<6.

(c)

Determine all solutions of the linear congruence 3x≑7(mod8) with 0≀x<8.

(d)

The following parts of this activity show that we can use the results of Theorem 8.24 to help find all solutions of the linear congruence 6x≑4(mod8).

Verify that x=2 and x=6 are the only solutions for the linear congruence 6x≑4(mod8) with 0≀x<8.

(e)

Use the definition of β€œcongruence” to rewrite the congruence 6x≑4(mod8) in terms of β€œdivides.”

(f)

Use the definition of β€œdivides” to rewrite the result in Task 49.e in the form of an equation. (An existential quantifier must be used.)

(g)

Use the results of Task 49.d and Task 49.f to write an equation that will generate all the solutions of the linear congruence 6x≑4(mod8).

Hint.

Use Theorem 8.24. This can be used to generate solutions for x and the variable introduced in Task 49.f. In this case, we are interested only in the solutions for x.

(h)

Now let n be a natural number and let a,c∈Z with aβ‰ 0. A general linear congruence of the form ax≑c(modn) can be handled in the same way that we handled in 6x≑4(mod8).

Use the definition of β€œcongruence” to rewrite ax≑c(modn) in terms of β€œdivides.”

(i)

Use the definition of β€œdivides” to rewrite the result in Task 49.h in the form of an equation. (An existential quantifier must be used.)

(j)

Let d=gcd(a,n). State and prove a theorem about the solutions of the linear congruence ax≑c(modn) in the case where d does not divide c.

(k)

Let d=gcd(a,n). State and prove a theorem about the solutions of the linear congruence ax≑c(modn) in the case where d divides c.