number theory Diophantine equation real world example.

136 Views Asked by At

A man paid $11.37$ for $39$ cent and $69$ cent pens. We wish to solve for

$$39x+69y=1137$$

However, since $(39,69)=3 \mid 1137$ this reduces down to

$$13x+23y=379 \space \space \space (*)$$

Then the text reads: Using the Euclidean algorithm on $13$ and $23$ and solving the equations backwards gives

$$13(-7)+23(4)=1$$

I wanna know how they got $-7$ and $4$ so quickly and why this implies $-7,4$ are solutions to $(*)$. Thanks in advance.

1

There are 1 best solutions below

6
On BEST ANSWER

they used the Euclidean Algorithm to solve for $x=-7, y=4$ although they did not show it. here it is: First, $23=1\cdot 13+1\cdot 10, 13=1\cdot 10+1\cdot3, 10=3\cdot 3+1\cdot 1$, so we have: \begin{align} 1&= 10-3\cdot 3 \\ &= 10-3\cdot(13-1\cdot 10) \\ &= 4\cdot 10-3\cdot 13 \\ &= 4(23-1\cdot 13)-3\cdot 13 \\ &= 4\cdot 23-7\cdot 13. \end{align}

Since this pair is a solution to $13x+23y=1$, then multiplying both sides of the equation by $379$ gives you that the pair $x=-7\cdot 379, y=4\cdot379$ is a solution to $(*)$. Finally, to find a valid solution to your original problem, notice that $13\cdot23 -23\cdot 13 = 0$. So, if we add $23$ to $x$ and subtract $13$ from $y$ we will have another valid solution. To see this explicitly, $$(13\cdot23 -23\cdot 13) + 379(13\cdot-7+23\cdot4)= 0 + 379(13\cdot-7+23\cdot4)= 379\cdot 1= 379.$$ So we can add $c$ multiples of $23$ to $x$ and subtract multiples of $13$ from $y$ to get soltuions where both $x$ and $y$ are positive.