Linear Diophantine Equation #4

Linear Diophantine Equations
  1. C + D = B + E
  2. B + C = A + E
  3. A - D = E - 2

Hint

Sometimes, under the pressure of time, you need to make a trade-off between solving it analytically and solving it with trial and error. In this case, a combination of both will leads to the quickest solution. First, sum up all three equations, in order to eliminate 3 out 5 variables.

Answer

Sometimes, under the pressure of time, you need to make a trade-off between solving it analytically and solving it with trial and error. In this case, a combination of both will leads to the quickest solution. First, sum up all three equations, in order to eliminate 3 out 5 variables.


C+ D = B + E

B + C = A + E

A - D = E - 2

——————— +

2C + B + A = 3E + B + A - 2



Which we can simplify as:
  • 2C = 3E - 2
Here, your quickest approach would be to try different values. Let's try out all numbers ranging from 1-5 for C.
  • If C= 1, 3E should equal 4, which isn't possible with integers.
  • If C= 2, 3E should equal 6, which isn't possible, because E = 2 would result in a non-unique solution.
  • If C= 3, 3E should equal 8, which isn't possible with integers.
  • If C= 4, 3E should equal 10, which isn't possible with integers.
  • If C= 5, 3E should equal 12, which works! E = 4.
So now we have:
  • C = 5
  • E = 4
Now we can substitute these values in the first two equations:
  • 5 + D = B + 4 (or D = B - 1)
  • B + 5 = A + 4 (or A = B + 1)
From this, we know that D < B < A, so:
  • D = 1
  • B = 2
  • A = 3
So the full solution is:
  • A = 3
  • B = 2
  • C = 5
  • D = 1
  • E = 4