Exercise · ZW-EXTENDED-EUCLIDEAN-ALGORITHM-010 · ★★★ Advanced

For \(a=99\) and \(b=78\), with \(\gcd(a,b)=3\), which pair \((x,y)\) satisfies \(99x+78y=3\)?

Choose one option.

Show answer
  • C. \((-11,14)\)

Explanation

Using \(3=15-2\cdot 6\) and back-substituting gives \(3=14\cdot 78-11\cdot 99\). So \((x,y)=(-11,14)\), since \(-1089+1092=3\). The pair \((11,-14)\) gives \(-3\) because of a flipped sign.

Study Elementary number theory in ZWMath →

Review the concept: Extended Euclidean algorithm

The extended Euclidean algorithm computes \(d=\gcd(a,b)\) and integers \(x\), \(y\) such that \(ax+by=d\). It is the Euclidean algorithm that also tracks the Bézout coefficients.

\[r_k=r_{k-2}-q_{k-1}r_{k-1}\\s_k=s_{k-2}-q_{k-1}s_{k-1}\\t_k=t_{k-2}-q_{k-1}t_{k-1}\]

More practice problems: extended euclidean algorithm

← ZW-EXTENDED-EUCLIDEAN-ALGORITHM-009