Author: | Tesida Gurn |

Country: | Sri Lanka |

Language: | English (Spanish) |

Genre: | Personal Growth |

Published (Last): | 16 December 2005 |

Pages: | 450 |

PDF File Size: | 16.4 Mb |

ePub File Size: | 2.87 Mb |

ISBN: | 872-7-34599-345-1 |

Downloads: | 16551 |

Price: | Free* [*Free Regsitration Required] |

Uploader: | Mozragore |

In mathematicsthe Euclidean algorithm[note 1] or Euclid’s algorithm algoritmx, is an efficient method for computing the greatest common divisor GCD of two numbers, the largest number that divides both of them without leaving a remainder.

It is named after the ancient Greek mathematician Euclidwho first described it in his Elements c. It is an example of an algorithma step-by-step procedure for performing a calculation according to well-defined rules, and is one of the oldest algorithms in common use. It can be used to reduce fractions to their simplest formand is a part of many other number-theoretic and cryptographic calculations. The Euclidean algorithm is based on the principle that the greatest common divisor of two numbers does not change if the larger number is replaced by its difference with the smaller number.

Since this replacement reduces the larger of the two numbers, repeating this process gives successively smaller pairs of numbers until the two numbers become equal. When that occurs, they are the GCD of the original two numbers. By reversing the stepsthe GCD can be expressed as a sum of the two original numbers each multiplied by a positive or negative integere. Algorimta version of the Euclidean algorithm described above and eiclid Euclid can take many subtraction steps to find the GCD when one of the given numbers is much bigger than the other.

A more efficient version of the algoriyma shortcuts these steps, instead replacing the larger of the two numbers by its remainder when divided by the smaller of the two with this version, the algorithm stops when reaching a zero remainder. With this improvement, the algorithm never requires more steps than five times the number of digits base 10 of alogritma smaller integer. Additional methods for improving the algorithm’s efficiency were developed in the 20th century. The Euclidean algorithm has many theoretical algorltma practical applications.

It is used for reducing fractions to their simplest form and for performing division in modular arithmetic. Computations using this algorithm form part of the cryptographic protocols that are used to secure internet communications, and in methods for breaking these cryptosystems by factoring large composite numbers.

The Euclidean algorithm may be used to solve Euxlid equationssuch as finding numbers that satisfy multiple congruences according to the Chinese remainder theoremto construct continued fractionsand to find accurate rational approximations to real numbers. Finally, it can be used algorimta a basic tool for proving theorems akgoritma number theory such as Lagrange’s four-square theorem and the uniqueness of prime factorizations.

The original algorithm was described only for natural numbers and geometric euvlid real numbersbut the algorithm was generalized in the 19th century to other types of numbers, such as Gaussian integers and polynomials of one variable. This led to modern abstract algebraic notions such as Euclidean domains. The Euclidean algorithm calculates the greatest common divisor GCD of two natural numbers a and b.

The greatest common divisor g is the largest natural number that divides both a and b without leaving a remainder. Nevertheless, 6 and 35 are coprime. No natural number other than wlgoritma divides both 6 and 35, since they have no prime factors in common.

The natural numbers m and n must be coprime, since any common factor could be factored out of m and n to make g greater.

Thus, algofitma other number c that divides both a and b must also divide g.

## Euclidean algorithm

The greatest common divisor g of a and b is the unique positive common divisor of a and b algoritm is divisible by any other common divisor c. The GCD can be visualized as follows. The sides of the algorita can be divided into segments of length cwhich divides the rectangle into a grid of squares of side length c. The greatest common divisor g is the largest value of c for which this is possible.

For illustration, a by rectangular area can be divided into a grid of: Therefore, 12 is the greatest common divisor of 24 and The GCD of two numbers a and b is the product of the prime factors shared by the two numbers, where a same prime factor can be used multiple times, but only as long as the product of these factors divides both a algorutma b.

If two numbers have no euflid factors in common, their greatest common divisor is 1 obtained here as an instance of the empty productin other words they are coprime. A key advantage of the Euclidean algorithm is that it can find the GCD efficiently without having to compute the prime factors.

Another definition of the GCD is helpful in advanced mathematics, particularly ring theory. The set of all integral linear combinations of a and b is actually the same as the set of all multiples of ejclid mgwhere m is an integer.

The equivalence of this GCD definition with the other definitions is described below. The GCD of three or more numbers equals the product of the prime factors common to all the numbers, [11] but it can also be calculated by repeatedly taking the GCDs of pairs of numbers. The Euclidean algorithm proceeds in a series of steps such that the output of each step is used as an input for the next one. Let k be an integer that counts the steps of the algorithm, starting with zero. The goal of the k th step is to find a quotient q k and remainder r k that satisfy the equation.

Thus, the algorithm can be written as a sequence of equations. If a is smaller than bthe first step of the algorithm swaps the numbers. Since the remainders decrease with every step but can never be negative, a remainder r N must eventually equal zero, at which point the algorithm stops. The number N cannot be infinite because there are only a finite number of nonnegative integers between the initial remainder r 0 and zero.

The validity of the Euclidean algorithm can be proven by a two-step argument. Since it is a common divisor, it must be less than or equal to the greatest common divisor g. In the second step, any natural number c that divides both a and b in other words, any common divisor of a and b divides the remainders r k. By definition, a and b can be written as multiples of c: An analogous argument shows that c also divides the subsequent remainders r 1r 2etc. Thus, g is the greatest common divisor of all the succeeding pairs: To begin, multiples of are subtracted from until the remainder is less than Then multiples of are subtracted from until the remainder is less than Then multiples of 21 are subtracted from until the remainder is less than Since the last remainder is zero, the algorithm ends with 21 as the greatest common divisor of and This agrees with the gcdfound by prime factorization above.

In tabular form, the steps are. The Euclidean algorithm can be visualized in terms of the tiling analogy given above for the greatest common divisor.

We then attempt to tile the residual rectangle with r 0 -by- r 0 square tiles. This leaves a second residual rectangle r 1 -by- r 0which we attempt to tile using r 1 -by- r 1 square tiles, and so on. The sequence ends when there is no residual rectangle, i. The length of the sides of the smallest square tile is the GCD of the dimensions of the original rectangle. For example, the smallest square tile in the adjacent figure is by shown in redand 21 is the GCD of andthe dimensions of the original rectangle shown in green.

The theorem which underlies the definition of the Euclidean division ensures that such a quotient and remainder always exist and are unique. Euclidean division reduces all the steps between two exchanges into a single step, which is thus more efficient. Moreover, the quotients are not needed, thus one may replace Euclidean division by the modulo operationwhich gives only the remainder.

Thus the iteration of the Euclidean algorithm becomes simply. Implementations of the algorithm may be expressed in pseudocode. For example, the division-based version may be programmed as [19].

During the loop iteration, a is reduced by multiples of the previous remainder b until a is smaller than b. Then a is the next remainder r k. In another version of Euclid’s algorithm, the quotient at each step is increased by one if the resulting negative remainder is smaller in magnitude than the typical positive remainder.

However, an alternative negative remainder e k can be computed:. If r k is replaced by e k. Leopold Kronecker has shown that this version requires the least number of steps of any version of Euclid’s algorithm.

### Euclidean algorithm – Wikipedia

The Euclidean algorithm is one of the oldest algorithms in common use. In modern usage, one alogritma say it was formulated there for real numbers. But lengths, areas, and volumes, represented as real numbers in modern usage, are not measured in the same units and there is no natural unit of length, area, or volume; the concept of real numbers was unknown at that time. The latter algorithm is geometrical.

The algorithm was probably not discovered by Euclidwho compiled results from earlier mathematicians in his Elements. Centuries later, Euclid’s algorithm was discovered independently both in India and in China, [33] primarily to solve Diophantine equations that arose in astronomy and making accurate calendars.

In the late 5th century, the Indian mathematician and astronomer Aryabhata described the algorithm as the “pulverizer”, [34] perhaps because of its effectiveness in solving Diophantine equations. The extended Euclidean algorithm was published by the English mathematician Nicholas Saunderson[38] who attributed it to Roger Cotes as a method for computing continued fractions efficiently. In the 19th century, the Euclidean algorithm led to the development of new number systems, such as Gaussian integers and Eisenstein integers.

InCarl Gauss used the Euclidean algorithm to demonstrate unique factorization of Gaussian integersalthough his work was first published in For example, Dedekind was the first to prove Fermat’s two-square theorem using the unique factorization of Gaussian integers.

In the closing decades of the 19th century, the Euclidean algorithm gradually became eclipsed by Dedekind’s more general theory of ideals. Other applications of Euclid’s algorithm were developed in the 19th century. InCharles Sturm showed that the algorithm was useful in the Sturm chain method for counting the real roots of polynomials in any given interval. The Euclidean algorithm was the first integer relation algorithmwhich is a method for finding integer relations between commensurate real numbers.

Several novel integer relation algorithms have been developed, such as the algorithm of Helaman Ferguson and R. Forcade [46] and the LLL algorithm. InCole and Davie developed a two-player game based on the Euclidean algorithm, called The Game of Euclid[49] which has an optimal strategy.

The players take turns removing m multiples of the smaller pile from the larger. The winner is the first player to reduce one pile to ekclid stones. The integers s and t can be calculated from the quotients q 0q 1etc. Those two remainders can be likewise expressed in terms of their quotients and preceding remainders.

The process of substituting remainders by formulae involving their predecessors can be continued until the original numbers a and b are reached:. After all the remainders r 0r 1etc.