FACTOID # 82: The women of Iceland earn two-thirds of their nation's university degrees.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Greatest common divisor

In mathematics, the greatest common divisor (gcd), sometimes known as the greatest common factor (gcf) or highest common factor (hcf), of two non-zero integers, is the largest positive integer that divides both numbers without remainder. For other meanings of mathematics or math, see Mathematics (disambiguation) and Math (disambiguation). ... The integers are commonly denoted by the above symbol. ... In mathematics, a divisor of an integer n, also called a factor of n, is an integer which evenly divides n without leaving a remainder. ... In mathematics, the result of the division of two integers usually cannot be expressed with an integer quotient, unless a remainder —an amount left over— is also acknowledged. ...

Contents

Overview

The greatest common divisor of a and b is written as gcd(ab), or sometimes simply as (ab). For example, gcd(12, 18) = 6, gcd(−4, 14) = 2 and gcd(5, 0) = 5. Two numbers are called coprime or relatively prime if their greatest common divisor equals 1. For example, 9 and 28 are relatively prime. In mathematics, the integers a and b are said to be coprime or relatively prime if they have no common factor other than 1 and −1, or equivalently, if their greatest common divisor is 1. ...


The greatest common divisor is useful for reducing vulgar fractions to be in lowest terms. For example, gcd(42, 56)=14, therefore, In arithmetic, a vulgar fraction (or common fraction) consists of one integer divided by a non-zero integer. ... An irreducible fraction is a fraction a/b, where the numerator a is an integer and the denominator b is a positive integer, such that there is not another fraction c/d with c smaller in absolute value than a and 0<d<b, and c and d are integers...

{42 over 56}={3 cdot 14 over 4 cdot 14}={3 over 4}.

Calculating the GCD

Greatest common divisors can in principle be computed by determining the prime factorizations of the two numbers and comparing factors, as in the following example: to compute gcd(18,84), we find the prime factorizations 18 = 2·32 and 84 = 22·3·7 and notice that the "overlap" of the two expressions is 2·3; so gcd(18,84) = 6. In practice, this method is only feasible for very small numbers; computing prime factorizations in general takes far too long. In mathematics, the integer prime-factorization (also known as prime decomposition) problem is this: given a positive integer, write it as a product of prime numbers. ...


A much more efficient method is the Euclidean algorithm, which uses the division algorithm in combination with the observation that the gcd of two numbers also divides their difference: divide 84 by 18 to get a quotient of 4 and a remainder of 12. Then divide 18 by 12 to get a quotient of 1 and a remainder of 6. Then divide 12 by 6 to get a remainder of 0, which means that 6 is the gcd. In number theory, the Euclidean algorithm (also called Euclids algorithm) is an algorithm to determine the greatest common divisor (GCD) of two elements of any Euclidean domain (for example, the integers). ... The division algorithm is a theorem in mathematics which precisely expresses the outcome of the usual process of division of integers. ...


The series of quotients generated by the Euclidean algorithm compose a continued fraction. In mathematics, a continued fraction is an expression such as where a0 is some integer and all the other numbers an are positive integers. ...


If a and b are not both zero, the greatest common divisor of a and b can be computed by using least common multiple (lcm) of a and b: In arithmetic and number theory, the least common multiple or lowest common multiple (lcm) or smallest common multiple of two integers a and b is the smallest positive integer that is a multiple of both a and b. ...

operatorname{gcd}(a,b)=frac{acdot b}{operatorname{lcm}(a,b)}.

Properties

  • Every common divisor of a and b is a divisor of gcd(ab).
  • gcd(ab), where a and b are not both zero, may be defined alternatively and equivalently as the smallest positive integer d which can be written in the form d = a·p + b·q where p and q are integers. This expression is called Bézout's identity. Numbers p and q like this can be computed with the extended Euclidean algorithm.
  • gcd(a, 0) = |a|, for a ≠ 0, since any number is a divisor of 0, and the greatest divisor of a is |a|. This is usually used as the base case in the Euclidean algorithm.
  • If a divides the product b·c, and gcd(ab) = d, then a/d divides c.
  • If m is a non-negative integer, then gcd(m·am·b) = m·gcd(ab).
  • If m is any integer, then gcd(a + m·bb) = gcd(ab). If m is a nonzero common divisor of a and b, then gcd(a/mb/m) = gcd(ab)/m.
  • The gcd is a multiplicative function in the following sense: if a1 and a2 are relatively prime, then gcd(a1·a2b) = gcd(a1b)·gcd(a2b).
  • The gcd is a commutative function: gcd(a, b) = gcd(b, a).
  • The gcd is an associative function: gcd(a, gcd(b, c)) = gcd(gcd(a, b), c).
  • The gcd of three numbers can be computed as gcd(abc) = gcd(gcd(ab), c), or in some different way by applying commutativity and associativity. This can be extended to any number of numbers.
gcd(ab)·lcm(ab) = a·b.
This formula is often used to compute least common multiples: one first computes the gcd with Euclid's algorithm and then divides the product of the given numbers by their gcd. The following versions of distributivity hold true:
gcd(a, lcm(bc)) = lcm(gcd(ab), gcd(ac))
lcm(a, gcd(bc)) = gcd(lcm(ab), lcm(ac)).
  • It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the natural numbers become a complete distributive lattice with gcd as meet and lcm as join operation. This extension of the definition is also compatible with the generalization for commutative rings given below.

In number theory, Bézouts identity, named after Étienne Bézout, is a linear diophantine equation. ... The extended Euclidean algorithm is an extension to the Euclidean algorithm for finding the greatest common divisor (GCD) of integers a and b: it also finds the integers x and y in Bézouts identity (Typically either x or y is negative). ... In number theory, a multiplicative function is an arithmetic function f(n) of the positive integer n with the property that f(1) = 1 and whenever a and b are coprime, then f(ab) = f(a) f(b). ... Example showing the commutativity of addition (3 + 2 = 2 + 3) For other uses, see Commute (disambiguation). ... In mathematics, associativity is a property that a binary operation can have. ... In arithmetic and number theory, the least common multiple or lowest common multiple (lcm) or smallest common multiple of two integers a and b is the smallest positive integer that is a multiple of both a and b. ... In mathematics, and in particular in abstract algebra, distributivity is a property of binary operations that generalises the distributive law from elementary algebra. ... In mathematics, a natural number can mean either an element of the set {1, 2, 3, ...} (i. ... In mathematics, a complete lattice is a partially ordered set in which all subsets have both a supremum (join) and an infimum (meet). ... In mathematics, distributive lattices are lattices for which the operations of join and meet distribute over each other. ... The name lattice is suggested by the form of the Hasse diagram depicting it. ... Fig. ... A line, or straight line, is, roughly speaking, an (infinitely) thin, (infinitely) long, straight geometrical object, i. ...

Probabilities and expected value

The probability that two randomly chosen (unlimited) integers A and B have a given greatest common divisor d is 6over {pi^2 d^2}. This follows from the characterization of gcd(A,B) as the integer d such that d | A,B and A / d and B / d are coprime. The probability of two integers sharing a factor d is d − 2. The probability that two integers are coprime is 1 / ζ(2) = 6 / π2. (See coprime for a derivation.) Probability is the likelihood that something is the case or will happen. ... In mathematics, the integers a and b are said to be coprime or relatively prime if they have no common factor other than 1 and −1, or equivalently, if their greatest common divisor is 1. ...


Using this information, the expected value of the greatest common divisor function can be computed. This is In probability theory the expected value (or mathematical expectation) of a random variable is the sum of the probability of each possible outcome of the experiment multiplied by its payoff (value). Thus, it represents the average amount one expects as the outcome of the random trial when identical odds are...

mathrm{E}( mathrm{2} ) = sum_{d=1}^{infty} d frac{6}{pi^2 d^2} = frac{6}{pi^2} sum_{d=1}^{infty} frac{1}{d}

This last summation is the Harmonic series, which diverges. Hence the expected value of the greatest common divisor of two variables is not well-defined. This is not the case in general, however. For the greatest common divisor of k ge 3 variables, the expected value is well-defined, and by the above argument, it is See harmonic series (music) for the (related) musical concept. ...

 mathrm{E}(k) = sum_{d=1}^{infty} d^{1-k} zeta(k)^{-1} = frac{zeta(k-1)}{zeta(k)} .

where ζ(k) is the Riemann zeta function. In mathematics, the Riemann zeta function, named after German mathematician Bernhard Riemann, is a function of significant importance in number theory, because of its relation to the distribution of prime numbers. ...


For k = 3, this is approximately equal to 1.3684. For k = 4, it is approximately 1.1106.


if all integers x are limited as m ge x ge 1 then the results can be extended to

 mathrm{E}(k,m) = frac{sum_{d=1}^{m} d^{1-k}}{sum_{t=1}^{m} t^{-k}} = frac{zeta(k-1)-zeta(k-1,m+1)}{zeta(k)-zeta(k,m+1)} .

where ζ(k,m) is the Hurwitz zeta function. In mathematics, the Hurwitz zeta function is one of the many zeta functions. ...


if different m's are known for different x then the lowest m is taken.


The gcd in commutative rings

The greatest common divisor can more generally be defined for elements of an arbitrary commutative ring. In ring theory, a branch of abstract algebra, a commutative ring is a ring in which the multiplication operation obeys the commutative law. ...


If R is a commutative ring, and a and b are in R, then an element d of R is called a common divisor of a and b if it divides both a and b (that is, if there are elements x and y in R such that d·x = a and d·y = b). If d is a common divisor of a and b, and every common divisor of a and b divides d, then d is called a greatest common divisor of a and b.


Note that with this definition, two elements a and b may very well have several greatest common divisors, or none at all. But if R is an integral domain then any two gcd's of a and b must be associate elements. Also, if R is a unique factorization domain, then any two elements have a gcd. If R is a Euclidean domain then a form of the Euclidean algorithm can be used to compute greatest common divisors. In abstract algebra, an integral domain is a commutative ring with an additive identity 0 and a multiplicative identity 1 such that 0 ≠ 1, in which the product of any two non-zero elements is always non-zero; that is, there are no zero divisors. ... In abstract algebra, an integral domain is a commutative ring with 0 &#8800; 1 in which the product of any two non-zero elements is always non-zero. ... In mathematics, a unique factorization domain (UFD) is, roughly speaking, a commutative ring in which every element can be uniquely written as a product of prime elements, analogous to the fundamental theorem of arithmetic for the integers. ... In abstract algebra, a Euclidean domain (also called a Euclidean ring) is a type of ring in which the Euclidean algorithm can be used. ...


The following is an example of an integral domain with two elements that do not have a gcd:

R = mathbb{Z}left[sqrt{-3}right],quad a = 4 = 2cdot 2 = left(1+sqrt{-3}right)left(1-sqrt{-3}right),quad b = left(1+sqrt{-3}right)cdot 2

The elements 1+sqrt{-3} and 2 are two "maximal common divisors" (i.e. any common divisor which is a multiple of 2 is associated to 2, the same holds for 1+sqrt{-3}), but they are not associated, so there is no greatest common divisor of a and b.


Corresponding to the Bezout property we may, in any commutative ring, consider the collection of elements of the form pa + qb, where p and q range over the ring. This is the ideal generated by a and b, and is denoted simply (a,b). In a ring all of whose ideals are principal (a principal ideal domain or PID), this ideal will be identical with the set of multiples of some ring element d; then this d is a greatest common divisor of a and b. But the ideal (a,b) can be useful even when there is no greatest common divisor of a and b. (Indeed, Ernst Kummer used this ideal as a replacement for a gcd in his treatment of Fermat's last theorem, although he envisioned it as the set of multiples of some hypothetical, or ideal, ring element d, whence the ring-theoretic term.) In ring theory, a branch of abstract algebra, an ideal is a special subset of a ring. ... In abstract algebra, a principal ideal domain (PID) is an integral domain in which every ideal is principal (that is, generated by a single element). ... Ernst Eduard Kummer (29 January 1810 in Sorau, Brandenburg, Prussia - 14 May 1893 in Berlin, Germany) was a German mathematician. ... Pierre de Fermats conjecture written in the margin of his copy of Arithmetica proved to be one of the most intriguing and enigmatic mathematical problems ever devised. ...


See also

In arithmetic and number theory, the least common multiple or lowest common multiple (lcm) or smallest common multiple of two integers a and b is the smallest positive integer that is a multiple of both a and b. ... In mathematics, the lowest common denominator or least common denominator (abbreviated LCD) is the least common multiple of the denominators of a set of vulgar fractions. ... The binary GCD algorithm is an algorithm which computes the greatest common divisor of two positive integers. ... In number theory, the Euclidean algorithm (also called Euclids algorithm) is an algorithm to determine the greatest common divisor (GCD) of two elements of any Euclidean domain (for example, the integers). ... The extended Euclidean algorithm is an extension to the Euclidean algorithm for finding the greatest common divisor (GCD) of integers a and b: it also finds the integers x and y in Bézouts identity (Typically either x or y is negative). ... An anomalous cancellation or accidental cancellation is a particular kind of arithmetic procedural error that gives a numerically correct answer. ... This article or section is in need of attention from an expert on the subject. ...

References

Donald Ervin Knuth ( or Ka-NOOTH[1], Chinese: [2]) (b. ... Thomas H. Cormen is the co-author of Introduction to Algorithms, along with Charles Leiserson, Ron Rivest, and Cliff Stein. ... Charles E. Leiserson is a computer scientist, specializing in the theory of parallel computing and distributed computing, and particularly practical applications thereof; as part of this effort, he developed the Cilk multithreaded language. ... Professor Ron Rivest Professor Ronald Linn Rivest (born 1947, Schenectady, New York) is a cryptographer, and is the Viterbi Professor of Computer Science at MITs Department of Electrical Engineering and Computer Science. ... Clifford Stein is a computer scientist, currently working as a professor at Columbia University in New York, NY. He earned his BSE from Princeton University in 1987, a MS from Massachusetts Institute of Technology in 1989, and a PhD from Massachusetts Institute of Technology in 1992. ... Cover of the second edition Introduction to Algorithms is a book by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. ... Saunders Mac Lane (born 4 August 1909) is a US mathematician. ... Garrett Birkhoff (January 19, 1911, Princeton, New Jersey, USA - November 22, 1996, Water Mill, New York, USA) was an American mathematician. ...

External links

  • GCD Implementation in C++
  • greatest common divisor at Everything2.com
  • Greatest Common Measure: The Last 2500 Years, by Alexander Stepanov
  • Online HCF calculator
  • Online gcd calculator

  Results from FactBites:
 
Greatest common divisor - Wikipedia, the free encyclopedia (1078 words)
In mathematics, the greatest common divisor (gcd), sometimes known as the greatest common factor (gcf) or highest common factor (hcf), of two non-zero integers, is the largest positive integer that divides both numbers.
The greatest common divisor of a and b is written as gcd(a, b), or sometimes simply as (a, b).
The greatest common divisor is useful for reducing vulgar fractions to be in lowest terms.
Greatest common divisor (655 words)
The GCD of a and b is often written as gcd(a,b).
The GCD of 0 and 0 is usually defined to be 0.
The greatest common divisor of a and b (not both zero) may be defined alternatively and equivalently as follows: it is the smallest positive integer d which can be written in the form ap+bq where p and q are integers.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.