تاريخ الرياضيات
الاعداد و نظريتها
تاريخ التحليل
تار يخ الجبر
الهندسة و التبلوجي
الرياضيات في الحضارات المختلفة
العربية
اليونانية
البابلية
الصينية
المايا
المصرية
الهندية
الرياضيات المتقطعة
المنطق
اسس الرياضيات
فلسفة الرياضيات
مواضيع عامة في المنطق
الجبر
الجبر الخطي
الجبر المجرد
الجبر البولياني
مواضيع عامة في الجبر
الضبابية
نظرية المجموعات
نظرية الزمر
نظرية الحلقات والحقول
نظرية الاعداد
نظرية الفئات
حساب المتجهات
المتتاليات-المتسلسلات
المصفوفات و نظريتها
المثلثات
الهندسة
الهندسة المستوية
الهندسة غير المستوية
مواضيع عامة في الهندسة
التفاضل و التكامل
المعادلات التفاضلية و التكاملية
معادلات تفاضلية
معادلات تكاملية
مواضيع عامة في المعادلات
التحليل
التحليل العددي
التحليل العقدي
التحليل الدالي
مواضيع عامة في التحليل
التحليل الحقيقي
التبلوجيا
نظرية الالعاب
الاحتمالات و الاحصاء
نظرية التحكم
بحوث العمليات
نظرية الكم
الشفرات
الرياضيات التطبيقية
نظريات ومبرهنات
علماء الرياضيات
500AD
500-1499
1000to1499
1500to1599
1600to1649
1650to1699
1700to1749
1750to1779
1780to1799
1800to1819
1820to1829
1830to1839
1840to1849
1850to1859
1860to1864
1865to1869
1870to1874
1875to1879
1880to1884
1885to1889
1890to1894
1895to1899
1900to1904
1905to1909
1910to1914
1915to1919
1920to1924
1925to1929
1930to1939
1940to the present
علماء الرياضيات
الرياضيات في العلوم الاخرى
بحوث و اطاريح جامعية
هل تعلم
طرائق التدريس
الرياضيات العامة
نظرية البيان
Euclidean Algorithm
المؤلف:
Bach, E. and Shallit, J
المصدر:
Algorithmic Number Theory, Vol. 1: Efficient Algorithms. Cambridge, MA: MIT Press, 1996.
الجزء والصفحة:
...
18-7-2020
2540
Euclidean Algorithm
The Euclidean algorithm, also called Euclid's algorithm, is an algorithm for finding the greatest common divisor of two numbers and
. The algorithm can also be defined for more general rings than just the integers
. There are even principal rings which are not Euclidean but where the equivalent of the Euclidean algorithm can be defined. The algorithm for rational numbers was given in Book VII of Euclid's Elements. The algorithm for reals appeared in Book X, making it the earliest example of an integer relation algorithm (Ferguson et al. 1999).
The Euclidean algorithm is an example of a P-problem whose time complexity is bounded by a quadratic function of the length of the input values (Bach and Shallit 1996).
Let , then find a number
which divides both
and
(so that
and
), then
also divides
since
![]() |
(1) |
Similarly, find a number which divides
and
(so that
and
), then
divides
since
![]() |
(2) |
Therefore, every common divisor of and
is a common divisor of
and
, so the procedure can be iterated as follows:
![]() |
(3) |
For integers, the algorithm terminates when divides
exactly, at which point
corresponds to the greatest common divisor of
and
,
. For real numbers, the algorithm yields either an exact relation or an infinite sequence of approximate relations (Ferguson et al. 1999).
An important consequence of the Euclidean algorithm is finding integers and
such that
![]() |
(4) |
This can be done by starting with the equation for , substituting for
from the previous equation, and working upward through the equations.
Note that the are just remainders, so the algorithm can be easily applied by hand by repeatedly computing remainders of consecutive terms starting with the two numbers of interest (with the larger of the two written first). As an example, consider applying the algorithm to
. This gives 42, 30, 12, 6, 0, so
. Similarly, applying the algorithm to (144, 55) gives 144, 55, 34, 21, 13, 8, 5, 3, 2, 1, 0, so
and 144 and 55 are relatively prime.
A concise Wolfram Language implementation can be given as follows.
Remainder[a_, b_] := Mod[a, b]
Remainder[a_, 0] := 0
EuclideanAlgorithmGCD[a_, b_] := FixedPointList[
{Last[#], Remainder @@ #}&, {a, b}][[-3, 1]]
Lamé showed that the number of steps needed to arrive at the greatest common divisor for two numbers less than is
![]() |
(5) |
where is the golden ratio. Numerically, Lamé's expression evaluates to
![]() |
(6) |
which, for , is always
times the number of digits in the smaller number (Wells 1986, p. 59). As shown by Lamé's theorem, the worst case occurs when the algorithm is applied to two consecutive Fibonacci numbers. Heilbronn showed that the average number of steps is
for all pairs
with
. Kronecker showed that the shortest application of the algorithm uses least absolute remainders. The quotients obtained are distributed as shown in the following table (Wagon 1991).
quotient | ![]() |
1 | 41.5 |
2 | 17.0 |
3 | 9.3 |
Let be the number of divisions required to compute
using the Euclidean algorithm, and define
if
. Then the function
is given by the recurrence relation
(7) |
Tabulating this function for gives
![]() |
(8) |
(OEIS A051010). The maximum numbers of steps for a given , 2, 3, ... are 1, 2, 2, 3, 2, 3, 4, 3, 3, 4, 4, 5, ... (OEIS A034883).
Consider the function
![]() |
(9) |
giving the average number of steps when is fixed and
chosen at random (Knuth 1998, pp. 344 and 353-357). The first few values of
are 0, 1/2, 1, 1, 8/5, 7/6, 13/7, 7/4, ... (OEIS A051011 and A051012). Norton (1990) showed that
![]() |
(10) |
where is the Mangoldt function and
is Porter's constant (Knuth 1998, pp. 355-356).
The related function
![]() |
(11) |
where is the totient function, gives the average number of divisions when
is fixed and
is a random number coprime to
. Porter (1975) showed that
![]() |
(12) |
(Knuth 1998, pp. 354-355).
Finally, define
![]() |
(13) |
as the average number of divisions when and
are both chosen at random in
Norton (1990) proved that
![]() |
(14) |
where is the derivative of the Riemann zeta function.
There exist 21 quadratic fields in which there is a Euclidean algorithm (Inkeri 1947, Barnes and Swinnerton-Dyer 1952).
For additional details, see Uspensky and Heaslet (1939) and Knuth (1998).
Although various attempts were made to generalize the algorithm to find integer relations between variables, none were successful until the discovery of the Ferguson-Forcade algorithm (Ferguson et al. 1999). Several other integer relation algorithms have now been discovered.
REFERENCES:
Bach, E. and Shallit, J. Algorithmic Number Theory, Vol. 1: Efficient Algorithms. Cambridge, MA: MIT Press, 1996.
Barnes, E. S. and Swinnerton-Dyer, H. P. F. "The Inhomogeneous Minima of Binary Quadratic Forms. I." Acta Math 87, 259-323, 1952.
Chabert, J.-L. (Ed.). "Euclid's Algorithm." Ch. 4 in A History of Algorithms: From the Pebble to the Microchip. New York: Springer-Verlag, pp. 113-138, 1999.
Cohen, H. A Course in Computational Algebraic Number Theory. New York: Springer-Verlag, 1993.
Courant, R. and Robbins, H. "The Euclidean Algorithm." §2.4 in Supplement to Ch. 1 in What Is Mathematics?: An Elementary Approach to Ideas and Methods, 2nd ed. Oxford, England: Oxford University Press, pp. 42-51, 1996.
Dunham, W. Journey through Genius: The Great Theorems of Mathematics. New York: Wiley, pp. 69-70, 1990.
Ferguson, H. R. P.; Bailey, D. H.; and Arno, S. "Analysis of PSLQ, An Integer Relation Finding Algorithm." Math. Comput. 68, 351-369, 1999.
Finch, S. R. "Porter-Hansley Constants." §2.18 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 156-160, 2003.
Inkeri, K. "Über den Euklidischen Algorithmus in quadratischen Zahlkörpern." Ann. Acad. Sci. Fennicae. Ser. A. I. Math.-Phys. 1947, 1-35, 1947.
Knuth, D. E. The Art of Computer Programming, Vol. 1: Fundamental Algorithms, 3rd ed. Reading, MA: Addison-Wesley, 1997.
Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, 1998.
Motzkin, T. "The Euclidean Algorithm." Bull. Amer. Math. Soc. 55, 1142-1146, 1949.
Nagell, T. "Euclid's Algorithm." §7 in Introduction to Number Theory. New York: Wiley, pp. 21-23, 1951.
Norton, G. H. "On the Asymptotic Analysis of the Euclidean Algorithm." J. Symb. Comput. 10, 53-58, 1990.
Porter, J. W. "On a Theorem of Heilbronn." Mathematika 22, 20-28, 1975.
Séroul, R. "Euclidean Division" and "The Euclidean Algorithm." §2.1 and 8.1 in Programming for Mathematicians. Berlin: Springer-Verlag, pp. 5 and 169-161, 2000.
Sloane, N. J. A. Sequences A034883, A051010, A051011, and A051012 in "The On-Line Encyclopedia of Integer Sequences."
Uspensky, J. V. and Heaslet, M. A. Elementary Number Theory. New York: McGraw-Hill, 1939.
Wagon, S. "The Ancient and Modern Euclidean Algorithm" and "The Extended Euclidean Algorithm." §8.1 and 8.2 in Mathematica in Action. New York: W. H. Freeman, pp. 247-252 and 252-256, 1991.
Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. Middlesex, England: Penguin Books, p. 59, 1986.
الاكثر قراءة في نظرية الاعداد
اخر الاخبار
اخبار العتبة العباسية المقدسة

الآخبار الصحية
