0

$$24,-11$$

So we begin with $gcd(24,-11)$

$$24=-2*-11+2=gcd(-11,2)$$

$$-11=-6*2+1=gcd(2,1)=1$$

So $gcd(24,-11)=1$ now how do I find x,y such that $1=24x-11y$?

gbox
  • 12,867

2 Answers2

2

Easier than back-substitution is too keep track of the linear relations from the start

$$\begin{align} 24 &= \ \ 1(24)+0(11)\\ 11 &=\ \ 0(24)+1(11)\\ 2 &=\ \ 1(24)-2(11)\ \ =\ \rm row_1 - 2\cdot row_2\\ 1 &=\! -5(24)\!+\!11(11)\, = \ \rm row_2 - 5\cdot row_3 \end{align}$$

i.e. we perform the Euclidean algorithm on the LHS and in parallel on the RHS.

See this answer for much more on this version of the extended Euclidean algorithm.

Bill Dubuque
  • 272,048
1

The standard trick is to substitute backward from the equations you already have. For example, you have $-11=-6\cdot2+1$, so that means $1=-11+6\cdot2$. Using your first equation, we can re-write $2$ to yield the new equation $1=-11+6\cdot(24+2\cdot-11)$, which implies $\boxed{1=6\cdot24-11\cdot13}$ by distributing the $6$ and combining like terms.