33
The Euclidean Algorithm Paul Tokorcheck Department of Mathematics Iowa State University September 26, 2014

The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The Euclidean Algorithm

Paul Tokorcheck

Department of MathematicsIowa State University

September 26, 2014

Page 2: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The Elements

China

India

Islam

Europe

Page 3: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,
Page 4: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

A map of Alexandria, Egypt, as it appeared shortly afterEuclid and during the expansion of the Roman Empire.

Page 5: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Euclid’s Elements, Book VII, Propositions 1 and 2.This copy of The Elements is from Constantinople, writtenin 888CE.

Page 6: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Detail. Here you can see some familiar drawings.

Page 7: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The Silk Road between Rome and the Han Dynasty(206 BCE - 220 CE)

Page 8: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The Suanshu Shu.

This copy was foundwithin a tomb inZhangjiashan, Hubeiprovince, China. Thetomb was sealed in 186BCE and opened byarcheologists in 1983.

Page 9: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Zhou Bi Suan Jing

(The Arithmetical Classicof the Gnomon and theCircular Paths of Heaven)

Jiuzhang Suanshu

(The Nine Chapters on theMathematical Art)

Page 10: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Liu Hui, on a modernChinese postagestamp. He lived inthe 3rd Century CE,and wrote hiscommentaries on theZhou Bi Suan Jingand theJiuzhang Suanshuaround 263 CE.

Page 11: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The mathematicians of China knew how to find the GCDof two numbers, which they called the Deng Shu. Here istheir method:

17163→ 108

63→ 45

63→ 45

18→ 27

18→ 9

18→ 9

9

Page 12: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Asia in the early first millenium.

Page 13: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Aryabhata was born near Bihar, India in 476 CE, andwrote his Aryabhat.ıya in 499 CE.

Bhaskara I later transcribed it and wrote his owncommentary in 629 CE.

Page 14: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Kut.t.aka:

“[A quantity when divided] by twelve has a remainderwhich is five, and furthermore, it is seen by me [having] aremainder which is seven, when divided by thirty-one.What should one such quantity be?” (Bhaskara I in hiscommentary, 629 CE.)

N = 12y + 5 = 31x + 7

12y − 31x = 2

Page 15: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Kut.t.aka:

“[A quantity when divided] by twelve has a remainderwhich is five, and furthermore, it is seen by me [having] aremainder which is seven, when divided by thirty-one.What should one such quantity be?” (Bhaskara I in hiscommentary, 629 CE.)

N

= 12y + 5 = 31x + 7

12y − 31x = 2

Page 16: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Kut.t.aka:

“[A quantity when divided] by twelve has a remainderwhich is five, and furthermore, it is seen by me [having] aremainder which is seven, when divided by thirty-one.What should one such quantity be?” (Bhaskara I in hiscommentary, 629 CE.)

N = 12y + 5

= 31x + 7

12y − 31x = 2

Page 17: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Kut.t.aka:

“[A quantity when divided] by twelve has a remainderwhich is five, and furthermore, it is seen by me [having] aremainder which is seven, when divided by thirty-one.What should one such quantity be?” (Bhaskara I in hiscommentary, 629 CE.)

N = 12y + 5 = 31x + 7

12y − 31x = 2

Page 18: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Kut.t.aka:

“[A quantity when divided] by twelve has a remainderwhich is five, and furthermore, it is seen by me [having] aremainder which is seven, when divided by thirty-one.What should one such quantity be?” (Bhaskara I in hiscommentary, 629 CE.)

N = 12y + 5 = 31x + 7

12y − 31x = 2

Page 19: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The Pulverizer: we attempt to find an integer solution to

12y − 31x = 2

by repeated division of polynomials.

y =31x + 2

12= 2x + w

x =12w − 2

7= 1w + v

w =7v + 2

5= 1v + u

v =5u − 2

2.

Choosing u = 2 and v = 4 gives the solutioncorrespoding to N = 317.

Page 20: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

“Whoever, when a given remainder of the Sun inrevolutions and so on is on a Monday or a Thursday or aWednesday, tells the zodiacal sign [and so on of the Sun’slongitude], he knows the pulverizer.”

From Brahmasphut.asiddhanta by Brahmagupta, 628 CE.

Page 21: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Aryabhata - 1975 Bhaskara I - 1979

Page 22: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Islamic expansion before the Abbasid Caliphate.

Page 23: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Abu ‘Abdallah Muh.ammad ibnMusa al-Khwarizmı, on aSoviet-era postage stamp.c.780 - c.850 CE

Page 24: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

al-Khwarizmı was author ofAl-Kitab al-mukhtas. ar fıhısab al-gabr wa’l-muqabala.

(The Compendious Book onCalculation by Completionand Balancing.)

Page 25: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Hulagu Khan, grandson of Genghis, with his wife.

Page 26: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

The House of Wisdom was destroyed during the Siege ofBaghdad, in 1258 CE.

Page 27: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Europe at the start of the 13th Century.

Page 28: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

A translation ofal-Khwarizmı’s workinto Latin.

Page 29: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Saint Thomas Aquinas.

c.1225 - 1274 CE.

Page 30: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Leonardo da Vinci.

1452 - 1519 CE.

Page 31: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Galileo Galilei.

1564 - 1642 CE.

Page 32: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Leonhard Euler.

1707 - 1783 CE.

Page 33: The Euclidean Algorithm...Al-Kitab al-mukhtas¯ .ar f¯ı h¯ıs ab al-¯ gabr wa’l-muq˘ abala¯ . (The Compendious Book on Calculation by Completion and Balancing.) Hulagu Khan,

Etienne Bezout.

1730 - 1783 CE.