Number Theory - Linear Diophantine Equation - CICS COMPUTER SCIENCE 1
Number Theory - Linear Diophantine Equation - CICS COMPUTER SCIENCE 1
Practice Exercises
Linear Diophantine Equation
A. Tell whether the following Diophantine Equation can be solved or not. Encircle S if
it is solvable and NS if the given equation cannot be solved.
a) 9x + 62y = 99 S NS
Solution:
By division algorithm;
62 = (9)(6) + 8
9 = (8)(1) + 1
8 = (1)(8) + 0
Solution:
66 = (28)(2) + 10
28 = (10)(2) + 8
10 = (8)(1) + 2
8 = (2)(4) + 0
Solution:
70 = (28)(2) + 14
The question is, “Is 186 exactly divisible by 14?”. The answer is NO. Since 14 does not
divides 186, there is no solution.
Solution:
Let us take a look if the next equation has a solution by finding first the gcd(32, 68) using
again the division algorithm,
68 = (32)(2) + 4
32 = (4)(8) + 0.
Now, let us examine if 4 divides 124. What can you say? Yes, 4 divides 124 or 124 is exactly
divisible by 4. So, the equation has a solution.
e) 16x + 18y = 45 S NS
Lastly, let us look if our next equation has a solution or do not have a solution. What are we
going to do? Correct! First, we need to determine the gcd(16, 18) using again the division
algorithm.
18 = (16)(1) + 2
16 = (2)(8) + 0.
What do you think? Is there a solution or not? Is 45 exactly divisible by 2? The answer is NO.
Hence, there is no solution.
a) 24x + 138 y = 18 ; ax + by = c
First, we need to determine if the equation has a solution or not. Since we are looking for its
general solution, the Diophantine equation should have first a solution. We need to look for the
greatest common divisor of 24 and 138 first.
138 = (24)(5) + 18
24 = (18)(1) + 6
18 = (6)(3) + 0.
Now, since 6 | 18, there is a solution. Since, there is a solution, we could look for the possible
complete solution for this. Next is we are going to write gcd(24, 138) as a linear combination of
a and b by reversing the steps in Euclidean algorithm.
6 = (24)(1) – (18)(1)
6 = (24)(1) – [(138) – (24)(5)](1)
6 = (24)(1) – (138)(1) + (24)(5)
6 = (24)(6) – (138)(1)
(6)(3) = (24)(18) + (138)(-3)
So, the xo = 18 and yo = -3. Hence the complete solution would be;
and
y = yo - (a/d)t = -3 - (24/6)t = -3 - 4t
b) 221 x + 35y = 11
Solution:
Just like what we did in (a), we could find its complete solution if and only if there is a solution.
221 = (35)(6) + 11
35 = (11)(3) + 2
11 = (2)(5) + 1
2 = (1)(2) + 0.
1 = (11)(1) – (2)(5)
1 = (11)(1) – [(35) – (11)(3)](5)
1 = (11)(1) – (35)(5) + (11)(15)
1 = (11)(16) – (35)(5)
1 = [(221) – (35)(6)](16) – (35)(5)
1 = (221)(16) – (35)(96) – (35)(5)
1 = (221)(16) – (35)(101)
1 = (221)(16) + (35)(-101)
(1)(11) = (221)(176) + (35)(-1111)
So, the xo = 176 and yo = -1111. Hence the complete solution would be;
and
54 = (21)(2) + 12
21 = (12)(1) + 9
12 = (9)(1) + 3
9 = (3)(3) + 0
Now, the gcd(54, 12) = 3 which divides 906. The equation 54x + 21y = 906 has
infinitely many solutions. Then find the general solutions by using linear
combination;
3 = 12 – (9)(1)
3 = 12 – [21 – (12)(1)](1)
3 = 12 – (21)(1) + (12)(1)
and
let x > 0 and y > 0. It follows that 604 + 7t > 0. Solving for t > -86.29. Similarly in -1510 – 18t
> 0 and solving for t < - 83.89. It shows that; -86.29 < t < -83.89. Since t is an integer then we
could say that t = -86, -85 and – 84.
Therefore; x = 2; 9; and 16 and y = 38; 20 and 2 are the only positive solutions in the positive
integers.