Exercise · ZW-EUCLIDEAN-ALGORITHM-009 · ★★★ Advanced

Why does the Euclidean algorithm always terminate?

Choose one option.

Show answer
  • C. The remainders form a strictly decreasing sequence of nonnegative integers

Explanation

The remainders are nonnegative integers and each is smaller than the previous divisor; a strictly decreasing sequence of nonnegative integers is finite.

Study Discrete mathematics in ZWMath →

Review the concept: Euclidean algorithm

The Euclidean algorithm computes the greatest common divisor of two integers \(a\) and \(b\) by dividing repeatedly, replacing each pair by the divisor and the remainder, until the remainder is 0.

\[\gcd(a,b)=\gcd(b,\,a\bmod b)\]

More practice problems: euclidean algorithm

← ZW-EUCLIDEAN-ALGORITHM-008 ZW-EUCLIDEAN-ALGORITHM-010 →