Exercise · ZW-EXTENDED-EUCLIDEAN-ALGORITHM-006 · ★★☆ Intermediate

For \(a=30\) and \(b=12\), with \(6=30-2\cdot 12\), what value of \(y\) satisfies \(30x+12y=6\) with \(x=1\)?

Choose one option.

Show answer
  • C. -2

Explanation

From \(6=30-2\cdot 12\) one reads \(30\cdot 1+12\cdot(-2)=6\), so \(y=-2\). The value 2 comes from copying the quotient without the minus 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-005 ZW-EXTENDED-EUCLIDEAN-ALGORITHM-007 →