Math 2.0

concept

Euclidean algorithm

Summary

The Euclidean algorithm computes the greatest common divisor of two natural numbers aa and bb. It uses two rules: gcd⁡(a,0)=a\gcd(a, 0) = a, and gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a, b) = \gcd(b, a \bmod b) when b≠0b \neq 0. It applies the second rule until the second number is 00. Then the first number is the result. The algorithm stops, because the second number gets smaller at each step.

Remarks

The second rule is true because aa and bb have the same common divisors as bb and a mod ba \bmod b. The number of steps is at most a constant times the number of digits of the smaller input. Lamé's theorem gives this bound. The algorithm also works in each Euclidean domain, for example in the ring of polynomials over a field.

Explanations

L1 human

To find gcd⁡(48,18)\gcd(48, 18), divide again and again, and keep the divisor and the remainder. 48=2⋅18+1248 = 2 \cdot 18 + 12, then 18=1⋅12+618 = 1 \cdot 12 + 6, then 12=2⋅6+012 = 2 \cdot 6 + 0. The last nonzero remainder is 66, so gcd⁡(48,18)=6\gcd(48, 18) = 6.

What this node needs for W2
  • edge defines in: at least one definition (0 of 1)
  • edge instance_of in: at least two examples (0 of 2)
  • edge not_instance_of in: at least one non-example (0 of 1)
  • edge specializes both: the more general notions and the special cases (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

What depends on this

2 nodes use this node, directly or through other nodes.

Sources

  1. Web https://en.wikipedia.org/wiki/Euclidean_algorithm, Procedure