[Math] Linear diophantine equation word problem

diophantine equationselementary-number-theory

I have the following word problem:

A small clothing manufacturer produces two styles of sweaters: cardigan and pullover. She sells cardigans for $\$31$ each and pullovers for $\$28$ each. If her total revenue from a day's production is $\$1460$, how many of each type might she manufacture in a day?

The first thing I did was create the following relation by, first, letting $x$ equal the number of cardigans and $y$ equal the number of pullovers. Then I was left with this:

$$31x + 28y = 1460$$

If we rearrange the equation, we would get $31x + 28y – 1460 = 0$. When I solve this equation, I get answers $x_0 = 13140$ for and $y_0 = 14600$ but the answers in the back of the book say $x = 20$ and $y = 30$. Where am I going wrong?

WORK

$\gcd{(31,28)} = 1$.

\begin{align}
&31 = 28(1) + 3 \\
&28 = 3(9) + 1 \\
&3 = (3)(1) + 0 \\
\end{align}

Then working backwards.

\begin{align}
1 &= 28 – 3(9)\\
&= 28 – (31 – 28)(9) \\
&= 28 – 9(31) + 9(28) \\
&= 10(28) – 9(31) \\
&= 31(-9) + 28(10) – 1\\
&= 31(-13140) + 28(14600)-1460 \\
\end{align}

Then we have that $x_0 = 13140$ and $y_0 = -14600$.

Thanks!

Best Answer

Hint $ $ The general solution arises by adding in the $\color{#c00}{\rm general\ solution}$ of the homogeneous equation

$$\,(x,y)\, =\, (-13140,14600) + \color{#c00}{n (28,-31)}\, =\, (28n-13140,\,14600-31n)$$

Now you need to solve for the value(s) of $\,n\,$ so that both $\,x,y\,$ are nonnegative.

Simpler $\ {\rm mod}\ 28\!:\,\ 31x\equiv 1460\iff 3x\equiv 4\equiv -24\iff x\equiv -8\equiv 20$

Or $ $ note $\,\ {\rm mod}\ 31\!:\,\ 28y\equiv 1460\iff y \equiv \dfrac{1460}{28} = \dfrac{365}7\equiv \dfrac{-7}7 \equiv -1\equiv 30$

Related Question