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

With \(a=35\) and \(b=15\), the algorithm gives \(\gcd=5\). Which is a valid pair \((x,y)\) with \(35x+15y=5\)?

Choose one option.

Show answer
  • B. \((1,-2)\)

Explanation

We have \(35-2\cdot 15=5\), so \((1,-2)\) works. The option \((2,-4)\) gives \(70-60=10\), which is not 5.

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-006 ZW-EXTENDED-EUCLIDEAN-ALGORITHM-008 →