Greatest common divisor
The greatest common divisor (ggT) is a mathematical term. Its counterpart is the least common multiple (kgV). Both play a role in fractions and number theory, among other things.
It is the largest natural number by which two integers can be divided without a remainder.
The of two integers and is an integer with the property that it is a divisor of both and and that any integer that also divides the numbers and is itself a divisor of For the ring of integers (which has a total order >) one normalises the ggT to the largest such integer .
The term "large" in highly correlated with the usual order relation > of integers. There is, however, an important exception: since is multiple of any integer cannot be outdone in "size" in divisibility terms. This view is consistent with the lattice notion (and ideal theory) and simplifies some of the arithmetic rules below.
The English term gcd (greatest common divisor) for is also common in mathematical texts.
Often also used as a shorthand notation for used.
Example
- 12 is divisible by the following numbers without remainder: 1, 2, 3, 4, 6, 12.
- 18 has these divisors: 1, 2, 3, 6, 9, 18.
- So the common divisors of 12 and 18 are 1, 2, 3, 6 and the largest of these is 6; in characters:
Calculation
Calculation via prime factorisation
GgT and kgV can be determined by the prime factorization of the two given numbers. Example:
For the ggT, one takes the prime factors that occur in both decompositions and the smaller of the initial exponents as the associated exponents:
Euclidean and Stone Algorithm
The calculation of the prime factorization of large numbers and thus also the determination of the greatest common divisor according to the above method is very time-consuming. With the Euclideanalgorithm, however, there is an efficient method for calculating the greatest common divisor of two numbers. This method was further varied by Stein's algorithm. Whether this is an improvement depends on the respective evaluation function and "machinery" that executes the respective algorithm.
The classical Euclidean algorithm calculates the greatest common divisor by searching for a common "measure" for the lengths of two lines. To do this, the smaller of two lengths is subtracted from the larger and this step is repeated with the result and the smaller length until the subtracted number is identical to the result. Example:
The greatest common divisor is therefore 13. If you know that 13 is prime, you could already read off the divisor in the second step in the example, since a prime number cannot be divided further as a result.
In the modern Euclidean algorithm, a division with remainder is carried out in successive steps, whereby the remainder becomes the new divisor in the next step. The divisor with a remainder of 0 is the greatest common divisor of the original numbers. Example:
Thus 252 is the greatest common divisor of 3780 and 3528.
In C, the algorithm is formulated as follows:
The ggT of several numbers
One uses all prime factors that occur in each of the numbers with the smallest occurring power in each case, for example:
so:
One could also first calculate and then calculate because as a two-digit link on the natural numbers, the ggT is associative:
This justifies the notation .
Calculation rules
For integers holds - with as the magnitude of :
● |
|
| (Commutative law) | |
● |
|
| ||
● |
|
| ||
● |
|
| ||
● |
|
| ||
● |
|
|
| |
● |
|
| ||
● |
|
| (Associative law) | |
● |
|
| (Distributive law) | |
● | If is a common divisor of and then holds: | for | ||
● | If and are congruent modulo ), then |
From the mentioned calculation rule results specifically in . This also follows from the fact that every integer (even 0 itself) is a divisor of 0 because , while conversely 0 does not divide any number different from 0.
If one of the two arguments is kept fixed, then a multiplicative function, because for divisor alien numbers and holds:
Bézout lemma
→ Main article: Bézout lemma
According to Bézout's lemma, the greatest common divisor of two integers and represented as a linear combination of and with integer coefficients:
- with
For example, the greatest common divisor of and has the following representation:
The coefficients and can be calculated with the extended Euclidean algorithm.
Special cases
For even , odd and whole holds:
;
;
;
;
;
if a and b are even.
if a is even and b is odd.
if a and b are odd.
If a prime number is composed of two real summands, it is always alien to the divisor:
.
Applications
Fractions
Reducing removes a common factor of the numerator and denominator of a fraction, but does not change the value of the fraction, e.g. . If you shorten with the greatest common divisor of the numerator and denominator, you get a fraction that cannot be shortened any further. For example, , so
A fraction that cannot be shortened further is called a truncated fraction or a fully and maximally truncated fraction.
Relationship between ggT and the least common multiple
Other algebraic structures with ggT
The concept of the ggT builds on the concept of divisibility as defined in rings. In the discussion of the ggT, one restricts oneself to zero-divisible rings, in the commutative case these are the integrity rings.
An integrity ring in which every two elements have a ggT is called a ggT ring or ggT range. (In a ggT ring, every two elements also have a kgV).
In general, such rings do not have a half-order, which is antisymmetrical, as the integers or the natural numbers have one. Often the divisibility relation, which is a quasi-order, is the only order relation. Therefore, the ggT can no longer be uniquely normalised as non-negative, but can only be determined down to associativity. Two elements and are associated, in characters if there is a unit with
We extend the notion of ggT to the set of all greatest common divisors of the elements of a subset a ring , formally:
.
In words: The divisors of are exactly the elements from that divide all elements from The ggT are associated with each other.
Polynomial rings
You can also form the ggT for polynomials, for example. Instead of the prime factorization, the decomposition into irreducible factors is used here:
Then
The polynomial ring in a variable is Euclidean. There, to calculate the a division with remainder.
Gaussian number ring
In the Gaussian number ring is the greatest common divisor of and even because and . Strictly speaking, is only a greatest common divisor, since all numbers associated with this number are also greatest common divisors. (The units are .)
Integrity rings
In the integrity ring the elements have
no ggT: The elements and are two maximum common divisors, because both have the same magnitude, but these two elements are not associated with each other. So there is no ggT of and .
The elements and have a ggT, namely . On the other hand, they have no kgV, because if were a kgV, then it follows from the "ggT-kgV equation" that must be associated to However, the common multiple is not a multiple of so is not a kgV and the two elements have no kgV at all.
If an integrality ring and the elements and kgV, then they also have a ggT, and the equation applies
A Euclidean ring is a principal ideal ring, which is a factorial ring, which is ultimately a ggT ring. Likewise, every principal ideal ring is a Bézout ring, which in turn is always a ggT ring.
An example of a non-commutative ggT ring are the Hurwitz quaternions.
Analytic Number Theory
In elementary number theory, the greatest common divisor of two integers to the most important basic concepts. There, one regularly writes g=and then means the positive ggT, thus assumes .
In analytic number theory, the ggT function in one variable for fixed be analytically continued to an entire function. → See Ramanujan sum.