I stuck this problem I can solve for 2 variable, but 3 variable or more I have no idea about it. Anyone can give me a hint?
-
https://answers.yahoo.com/question/index?qid=20100923051301AA3a69E and https://issuu.com/tsangkinfun/docs/_david_m._burton__elementary_number/45 – lab bhattacharjee Oct 19 '16 at 05:03
-
Thank you for link . It's solve my problem completely ^ ^ – Lingnoi401 Oct 19 '16 at 05:12
-
What do you mean satisfies? If I take $x=y=z=1$ I get $998$. Does $998$ satisfy your expression? – Ross Millikan Oct 19 '16 at 05:12
-
It ask for linear combination of gcd.I forgot to put gcd in problem – Lingnoi401 Oct 19 '16 at 05:15
-
Isn’t the gcd equal to $2$? That’s already the gcd of $198$ and $512$, so you can ignore the $288$ part. – Lubin Oct 19 '16 at 05:32
-
I notice none of the existing answers give a way to find the general solution, only a way to find some specific solution. I wonder if it would be worthwhile for me to write up an example showing how to find the general solution, for example using a Smith normal form expression of $\begin{bmatrix} 198 & 288 & 512 \end{bmatrix}$. – Daniel Schepler Jan 12 '21 at 22:05
3 Answers
Well, obviously
$$\begin{align} 1 &= \frac{198x + 288y + 512z}{\gcd(198, 288, 512)}\\ \gcd(198, 288, 512)&=\gcd(2\cdot99, 2\cdot144, 2^9) = 2\\ 1 &= 99x + 144y + 256z \end{align}$$
$\gcd(99,144)=9$ so there are $a,b$ where $9 = a99 + b144$
$\gcd(144, 256) = 16$ so there are $c,d$ where $16 = c144 + d256$
$\gcd(9,16) = 1$ so there are $e,f$ where $1 = e9 + 16f$
So we want $$\begin{align} 1&=e(a99 + b144) + f(c144 + d256)\\&= 99ae + 144(be+fc)+ 256df\\ &x = ae;\quad y = be+fc;\quad z = df\\ 1 &= 9e + 16f\end{align}$$
Use Euclid's algorithm: $$\begin{align} 16 &= 9 + 7;& 7&=16-9\\ 9&=7+2;& 2&=9-7\\ 7 &= 3(2) + 1;& 1&= 7-3*2\end{align}$$ $$\begin{align}&=(16-9) - 3(9-7) = (16-9)-3(9 - (16-9))\\ &= 4\cdot16 - 7\cdot9\end{align}$$
So $$e = -7;\quad f= 4\\ x = -7a;\quad y = -7b+4c;\quad z = 4d$$
$$\begin{align} 16 &= c144 + d256\\ 1 &= 9c + 16d\\ 16 &= 9 + 7;\quad 7 = 16 - 9\\ 9 &= 7+2;\quad 2 = 9-7\\ 7 &= 3(2) + 1;\quad 1 = 7-3(2)= (16-9)-3(9-7)\\ &=16 - 4\cdot9 + 3(16-9)\\ &=4\cdot16 - 7\cdot9 \end{align}$$
So $$c= -7;\quad d=4\\ x = -7a;\quad y = -7b-28;\quad z = 16$$
And finally $$\begin{align} 9 &= 99a + 144b\\ 1 &= 11a + 16b\\ 16 &= 11 + 5\\ 11 &= 2\cdot5 + 1\\ 1 &= 11- 2(5)=11-2(16-11) = 3\cdot11 - 2\cdot16 \end{align}$$
So $$a=3;\quad b=-2\\ x = -21;\quad y = -14;\quad z = 16$$
And $$2 = 198(-21) + 288(-14) + 16(512)$$
-
It's easier using the extended Euclidean algorithm - e.g. see my answer. – Bill Dubuque Oct 21 '16 at 14:55
-
1d'oh. Should have thought of that. Truth is I've always had trouble doing the euclidean algorithm without mistakes. It's easier and shorter with more variables I guess. – fleablood Oct 21 '16 at 17:45
-
1One of the main reasons for presenting the extending Euclidean algorithm that way is that it completely avoids the tedious and highly error-prone final back-substitution phase. – Bill Dubuque Oct 21 '16 at 18:18
-
1Yeah, I really should have seen that. It's the same thing but tighter so there are fewer steps. Each step slightly harder but a lot more consise and less error prone. – fleablood Oct 21 '16 at 18:25
Cancelling $2$ it suffices to solve $\,\gcd(256,144,99) = 256 z + 144 y + 99 x,\,$ which is straightforward using a version of the extended Euclidean algorithm described here, namely
$$\rm\begin{eqnarray}(1)\quad 256\!\ &=&\ \ 1&\cdot& 256\ +\ \ 0 &\cdot& 144\ +\ 0 &\cdot& 99 \\ (2)\quad 144 \ &=&\ \ 0 &\cdot& 256 \ +\ \ 1 &\cdot& 144\ +\ 0&\cdot& 99\\ (3)\ \,\quad 99 \ &=&\ \ 0 &\cdot& 256 \ +\ \ 0&\cdot& 144\ +\ 1&\cdot& 99\\ 2(2)-(1)\,\rightarrow\, (4)\ \ \quad 32 &=& {-}1&\cdot&256\ +\ \ 2&\cdot&144\ +\ 0&\cdot& 99\\ (3)\!\!-3(4)\,\rightarrow\, (5)\ \ \ \ \quad3 &=&\ \ 3&\cdot&256\ \ -\ 6&\cdot&144\ +\ 1&\cdot&99\\ 11(5)-(4)\,\rightarrow\,(6)\ \ \ \ \quad 1 &\,=\,& 34&\cdot&256 \,-68&\cdot&144+11&\cdot&99 \end{eqnarray}\qquad$$
See here for another worked example, and see here for an explicit formula for the general trivariate linear Diophantine equation (in terms of solutions of associated bivariate equations).

- 272,048
-
1As Lubin noted, clearly $, 256 = 2^8$ is copime to $99$ so we can reduce to two variables writing $,1 = 256z + 99x,$ with $,y=0.,$ But I thought it would be more instructive to do a trivariate example, given the OP's remarks. – Bill Dubuque Oct 21 '16 at 20:06
-
You can solve it using different combinations.There are four possible cases.
$$\begin{cases}x=y&(1)\\y=z&(2)\\x=z&(3)\\x\neq y\neq z&(4)\end{cases}$$
Solutions possible in case $(1)$:
$$\begin{align} 198x+288y+512z&=2&[x=y]\\ 486x+512z&=2\\ 512-486&=26\\ (26*a)-2&\neq512b\\ (26*c)-2&\neq486d\\ \end{align}$$
So case $(1)$ has no solutions. Similarly for case $(3)$ no solution exists.
For case $(2)$:
$$800z+198x=2$$
It means either $x$ or $z$ should be negative.
Since the last digit of $800z$ is $0$, the last digit of $198x$ must be $8$. It means we can take $x$ as a digit which ends with 1.
Since the last second digit of $800z$ is $0$ the last second digit in $198x$ must be $9$. To get a value $9$ in $10$s place we need to consider digit $0$ in $10$s place for $x$.
$$\frac{800}{198}\approx4\implies z\approx4x$$
By considering all, we get solutions as
$$\begin{align} x_1&=101,&z_1&=25\\ x_2&=501,&z_2&=124\\ &\vdots\\ x_n&=400+x_n-1,&z_n&=z_n-1 +4 (z_1) -1,&y_n&=z_n \end{align}$$
It means infinite solutions exist as according to case $(3)$. Solution to case four is already given by fleablood.

- 1,017