SlideShare une entreprise Scribd logo
1  sur  97
Télécharger pour lire hors ligne
Greatest Common
     Measure:
the Last 2500 Years

 Alexander Stepanov
This lecture was originally prepared as the
 1999 Arthur Schoffstall Lecture in
 Computer Science and Computer
 Engineering at the Rensselaer Polytechnic
 Institute
Abstract
The talk describes development of Euclid's algorithm from early
   Pythagoreans to modern times. This development shows gradual
   evolution of a notion of abstract (or generic) algorithm. While the
   term generic programming was introduced by Musser and Stepanov
   in 1988, the notion of algorithmic genericity goes back to remote
   centuries and is one of the main driving forces of mathematical
   progress.
Study of mathematics develops an architectural ability for organizing
   large body of knowledge, which is still lacking in Computer Science.
   Euclid’s Elements (with a good modern guide such as Robin
   Hartshorne) is a wonderful textbook for software engineers.
The sense of history is very important for a scientist in order to be able
   to evaluate what is, and is not, important. To understand something
   we need to know its history.
Pythagoras (570BC - 475BC)
Plimpton 322
“He attached supreme importance to
the study of arithmetic, which he
advanced and took out of the region of
commercial utility.”


Aristoxenus
He maintained that “the principles of
mathematics are principles of all
existing things.”
                             Aristotle
He discovered “the theory of
irrationals and the construction of
cosmic bodies.”
                              Proclus
ASTRONOMY


  GEOMETRY


NUMBER THEORY


    MUSIC
To reduce the world to numbers, one
needs the absolute common measure,
the smallest physically possible
segment, the quantum of space.
IT DOES NOT EXIST!
 However small a measure we
 pick there are segments that
 cannot be measured by it.
gcm(a, a) = a
gcm(a, b) = gcm(a, a + b)
a>b             gcm(a, b) = gcm(a - b, b)
gcm(a, b) = gcm(b, a)
line_segment gcm(line_segment a,
                  line_segment b) {
    if (a == b)   return a;
    if (a > b)    return gcm(a-b, b);
    if (a < b)    return gcm(a, b-a);
}
196      42
   154      42
   112      42
    70      42
    28      42
    28      14
    14      14 Done!

GCD:   14
Let us assume that there is a measure that
can measure both the side and the diagonal of
some square. Let us take the smallest such
square for the given measure.
(Greeks found the principle that any set of natural numbers has the smallest
element a very powerful proof technique. Now we know that it is equivalent to
mathematical induction.

So, in order to prove that something does not exist, you prove that if it exists, a
smaller one also exists.)
B   A




C   D
B                 A

 E


          F
 C                  D
AB = AF       AC ⊥ EF
B            A

     E

G
          F
     C            D
    AC ⊥ CG   EG ⊥ EF
B                  A


    E

G
           F
    C                  D
        CF = EF = EB
B             A


    E

G
          F
     C             D

    gcm(AC,AB) = gcm(AB,CF)
    gcm(CE,CF) = gcm(AC,AB)
B              A


    E

G
          F
  C                D
EC > EB   > EB < AB/2
We constructed a smaller square that
could be measured by this measure.
Contradiction!
The side and the diagonal of the square
produced by the proof result from two iterations
of the algorithm:
d, s => s, d - s => 2s - d, d - s


And the original ratio is repeated:
          d/s = (2s - d)/(d -s)
Or, as we would say it now, Pythagoras
 discovered that √2 is irrational
Plato (427BC - 347BC)
ΑΓΕΩΜΕΤΡΗΤΟΣ ΜΗΔΕΙΣ ΕΙΣΙΤΩ
LET NO ONE WHO DOES NOT
KNOW GEOMETRY ENTER
They came to Plato’s lecture on the Good in the
conviction that they would get some one or other
of the things that the world calls good: riches, or
health, or strength. But when they found that
Plato’s reasonings were of mathematics their
disenchantment was complete.

                          Aristoxenus
Plato's Algorithm
void sqrt_of_2(int count) {
  int side = 1;
  int diagonal = 1;

    for(int n = 0; n < count; ++n) {
      int tmp = side + diagonal;
      diagonal = tmp + side;
      side = tmp;
    }

    display(diagonal, side, count);
}
Rational diameter of:

 1 is 1     (1)
 2 is 3     (1.5)
 5 is 7     (1.4)
 12 is 17    (1.41667)
 29 is 41    (1.41379)
 70 is 99    (1.41429)
 169 is 239    (1.4142)
 408 is 577    (1.41422)
 985 is 1393 (1.41421)
 2378 is 3363 (1.41421)
Euclid (325BC-265BC)
Some one who had begun to read geometry
 with Euclid, when he had learnt the first
 theorem, asked Euclid, “what shall I get by
 learning these things?” Euclid called his
 slave and said, “Give him threepence,
 since he must make gain out of what he
 learns.”

Strobaeus, Florilegium
Euclid guaranteed termination by changing the
input types:
unsigned int gcd(unsigned int a,
                 unsigned int b) {
   assert(a > 0 && b > 0);
   // should wait for Arabs
   // and Leonardo Pisano
   if (a == b)   return a;
   if (a > b)    return gcd(a-b, b);
/* if (b > a) */ return gcd(a, b-a);
}
Elements, Book X
Proposition 1. Two unequal magnitudes
  being set out, if from the greater there is
  subtracted a magnitude greater than its
  half, and from that which is left a
  magnitude greater than its half, and if this
  process is repeated continually, then there
  will be left some magnitude less than the
  lesser magnitude set out.
Elements, Book X
Proposition 2. If, when the less of two
  unequal magnitudes is continually
  subtracted in turn from the greater that
  which is left never measures the one
  before it, then the two magnitudes are
  incommensurable.
Elements, Book X
Proposition 3. To find the greatest common
  measure of two given commensurable
  magnitudes.

Corollary. If a magnitude measures two
 magnitudes, then it also measures their
 greatest common measure.
Euclid guaranteed termination by changing the
input types:
unsigned int gcd(unsigned int a,
                 unsigned int b) {
   assert(a > 0 && b > 0);
   // should wait for Arabs
   // and Leonardo Pisano
   if (a == b)   return a;
   if (a > b)    return gcd(a-b, b);
/* if (b > a) */ return gcd(a, b-a);
}
           Why a-b, not a%b?
Lincoln and Euclid
"He studied and nearly mastered the six
  books of Euclid since he was a member of
  Congress. He regrets his want of
  education, and does what he can to supply
  the want."

--Lincoln's Autobiography of 1860
New Math against Euclid
In 1959, at a conference on the teaching of
  mathematics in Réalmont, France, Jean
  Dieudonné rose and hurled the slogans
  "Down with Euclid!" and "Death to
  triangles!"
I.M.Yaglom, Elementary Geometry Then
  and Now
The Years of Decline: 212BC - 1202AD
In summo apud illos honore geometria fuit, itaque nihil
   mathematicis inlustrius; at nos metiendi ratiocinandique
   utilitate huius artis terminavimus modum.

Among them [the Greeks] geometry was held in highest
  honor; nothing was more glorious than mathematics. But
  we [the Romans] have limited the usefulness of this art
  to measuring and calculating.

Cicero, Tusculan Disputations
Omar Khayyam (1048-1123)
Sqrt(2) = 1 + 1/(2 + 1/(2 + 1/(2 + ...

Continued fractions generated by quotients
represent a ratio of any two segments.
Leonardo Pisano (1170-1250)
It took over 1500 years to move to:
unsigned int gcd(unsigned int m,
                 unsigned int n) {
   while (n != 0) {
     unsigned int t = m % n;
     m = n;
     n = t;
   }
   return m;
}
196        42   196 = 42*4 + 28
    42        28    42 = 28*1 + 14
    28        14    28 = 14*2 + 0
    14        0     Done!

GCD:     14
Simon Stevin (1548 - 1620)
Simon Stevin:
int gcd(int m, int n) {
   while (n != 0) {
     int t = m % n;
     m = n;
     n = t;
   }
   return m;
}
Simon Stevin:

polynomial<real>
gcd(polynomial<real> m,
     polynomial<real> n) {
   while (n != 0) {
      polynomial<real> t = m % n;
      m = n;
      n = t;
   }
   return m;
}
3x2+2x-2
x-2 3x3-4x2-6x+10
    3x3-6x2
        2x2-6x
        2x2-4x
            -2x+10
            -2x+4
                6
Carl Friedrich Gauss
   (1777 - 1855)
Given many numbers A, B, C, etc the greatest
common divisor is found as follow. Let all the
numbers be resolved into their prime factors,
and from these extract the ones which are
common to A, B, C, etc…

     Gauss, Disqisitiones Arithmeticae, art. 18
Carl Gauss:

complex<int>
gcd(complex<int> m,
     complex<int> n) {
   while (n != 0) {
      complex<int> t = m % n;
      m = n;
      n = t;
   }
   return m;
}
Finding a Gaussian remainder
To find a remainder of z1 divided by z2
1. Construct a square grid on the complex
   plane generated by z2 together with
   i*z2, -i*z2 and -z2.
2. Find a square in the grid containing z1.
3. Find a vertex w of the square closest to
   z1.
4. The remainder is z1 - w.
Z1




Z2
Lejeune Dirichlet
 (1805 - 1857)
“It is now clear that the whole structure of number theory
rests on a single foundation, namely the algorithm for finding
the greatest common divisor of two numbers. All the
subsequent theorems … are still only simple consequences
of the result of this initial investigation, so one is entitled to
make the following claim: any analogous theory, for which
there is a similar algorithm for the greatest common divisor,
must also have consequences analogous to those in our
theory. In fact, such theories exist.”

Lejeune Dirichlet,
Lectures on Number Theory
“If one considers all numbers of the form
                    t + n√-a
where a is a particular positive integer and t and n are
    arbitrary integers … it is only for certain values of a, e.g.
    a = 1, that the greatest common divisor of two numbers
    could be found by an algorithm like the one for …
    integers. … However, it is otherwise when a = 5. …
    For example, 21 = 3*7 = (1+2√-5)*(1-2√-5)…”

Lejeune Dirichlet,
Lectures on Number Theory
Richard Dedekind
  (1831 - 1916)
Algebraic integers
Algebraic integers are roots of monic
  polynomials with integer coefficients.
Es steht alles schon bei Dedekind!

                      Emmy Noether

(It is all already in Dedekind.)

All = {rings, fields, ideals, modules,…}
Euclid and Göttingen
•   Gauss
     – Regular polygons
     – Non-Euclidean geometry
            • Lobachevsky and Bolyai
            • The equality of two volumes of two tetrahedra
•   Dirichlet
     – Infinity of primes in arithmetic progression
•   Riemann
     – Non-Euclidian geometry
•   Dedekind
     – Edoxian theory reborn
•   Klein
     – Erlanger program
•   Hilbert
     – Foundations of Geometry
     – One must be able to say at all times -- instead of points, straight lines, and planes -- tables,
          beer mugs, and chairs
     – Mechanization of mathematics
Emmy Noether (1882 -1935)
It was she who taught us to think in terms of
   simple and general algebraic concepts –
   homomorphic mappings, groups and rings
   with operators, ideals…
                   P.S. Alexandrov
For Emmy Noether, relationships among
   numbers, functions, and operations became
   transparent, amenable to generalisation, and
   productive only after they have been
   dissociated from any particular objects and
   have been reduced to general conceptual
   relationships…
                   B.L. van der Waerden
Bartel Leendert van der Waerden
          (1903 - 1996)
Dedekind, Noether, van der Waerden:
template <class
            EuclideanRingElement>
EuclideanRingElement
gcd(EuclideanRingElement m,
     EuclideanRingElement n) {
   while (n != 0) {
      EuclideanRingElement t = m % n;
      m = n;
      n = t;
   }
   return m;
}
Euclidean domain
• A commutative ring (+, -, *)
• Function norm: Ring -> Unsigned
  – norm(a*b) >= norm(a)
  – For any a, b, where b != 0, there exist
    q, r, such that a == q*b + r and
     r == 0 || norm(r) < norm(b)
Donald Knuth
  (1938 - )
Knuth’s objection: gcd(1, -1) = -1
template <class
              EuclideanRingElement>
EuclideanRingElement
gcd(EuclideanRingElement m,
     EuclideanRingElement n) {
   while (n != 0) {
      EuclideanRingElement t = m % n;
      m = n;
      n = t;
   }
   if (m < 0) m = -m;
   return m;
}
Depends on the definition!
Greatest common divisor is a common divisor
that is divisible by any other common divisor.
What is Euclidian Domain?
• What are operations and their
  requirements?

• What are intended models?

• What are related algorithms?
Extended Euclid
template <class EuclideanDomain>
triple<EuclideanDomain, EuclideanDomain, EuclideanDomain>
extended_euclid(EuclideanDomain u, EuclideanDomain v) {
   EuclideanDomain u0 = 1;
   EuclideanDomain v0 = 0;
   EuclideanDomain u1 = u;
   EuclideanDomain v1 = v;
   while (v1 != 0) {
       EuclideanDomain q = u1/v1;
       u0 -= v0 * q;
       swap(u0, v0);
       u1 -= v1 * q;
       swap(u1, v1);
   }
   return make_triple(u0, (u1 - u * u0) / v, u1);
}
Josef Stein (1961):

 gcd(n, 0) = gcd(0, n) = n
 gcd(n, n) = n
 gcd(2n, 2m) = 2gcd(n, m)
 gcd(2n, 2m + 1) = gcd(n, 2m + 1)
 gcd(2n + 1, 2m) = gcd(2n + 1, m)
 gcd(2n + 1, 2(n + k) + 1) =
     gcd(2(n + k) + 1, 2n + 1) =
        gcd(2n + 1, k)
196       42
  98        21    2
  49        21    2
  28        21    2
  14        21    2
   7        21    2
  14          7   2
   7          7   2   Done!
GCD: 7*2 = 14
template <class BinaryInteger>
BinaryInteger gcd(BinaryInteger m,
                  BinaryInteger n) {

  make_non_negative(m);
  make_non_negative(n);

  if (is_zero(m)) return n;
  if (is_zero(n)) return m;

  int d = 0;

  while (is_even(m) && is_even(n)) {
    half_non_negative(m);
    half_non_negative(n);
    ++d;
  }
while (is_even(m)) half_non_negative(m);

    while (is_even(n)) half_non_negative(n);

    while (true)
      if (m < n) {
        n = n - m;
        do {
          half_non_negative(n);
        } while (is_even(n));
      } else if (n < m) {
        m = m - n;
        do {
          half_non_negative(m);
        } while (is_even(m));
      } else
        return left_shift(m, d);
}
Stein for polynomials

Use x as 2!
Stein for polynomials over a field
gcd(p,0) = gcd(0,p) = p
gcd(p, p) = p
gcd(x*p1,x*p2) = x*gcd(p1, p2)
gcd(x*p1,x*p2+c) = gcd(p1, x*p2+c)
gcd(x*p1+c,x*p2) = gcd(x*p1+c,p2)
if degree(p1) >= degree(p2)
 gcd(x*p1+c1,x*p2+c2) =
  gcd(p1-(c1/c2)*p2, x*p2+c2)
if degree(p1) < degree(p2)
 gcd(p1,p2) = gcd(p2,p1)
x3-3x-2      x2-4
x3-.5x2-3x   x2-4
x2-.5x-3     x2-4
x2-2x        x2-4
x-2          x2-4
x2-4         x-2
x2-2x        x-2
x-2          x-2 Done!
GCD: x-2
Weilert algorithm for Gaussian Integers

Use 1+i as 2!
Division by 1+i
a+bi/1+i =(a+bi)(1-i)/(1+i)(1-i)=
 (a+bi)(1-i)/2 = ((a+b) - (a-b)i)/2

A Gaussian integer a+bi is divisible by 1+i if
  and only if a=b(mod 2)
Remainder Cancellation
If two Gaussian integers z1 and z2 are not divisible by 1+i
    then z1+z2 is divisible by 1+i. Then z1-z2, z1+i*z2 and
    z1-i*z2 are also divisible by 1+i.

And,

min (|z1+z2|, |z1-z2|, |z1+i*z2|, |z1-i*z2|) < max(|z1|, |z2|)
Damgård and Frandsen Algorithm
• Stein algorithm works for Eisenstein
  integers Z[ζ], i.e. the integers extended
  with ζ (−1+ − 3
             2   ), a complex primitive third
  root of unity.
• We use 1 - ζ as our 2.
What is Stein domain?
Few definitions

• is_unit(u) iff there is a v such that v*u == 1



• are_associates(m, n) iff is_unit(u) && u*n == m



• is_smallest_prime(p) iff for any q != 0,
      norm(q) < norm(p) => is_unit(q)
Few lemmas

• is_unit(u) => norm(a) == norm(u*a)




•   if a Euclidean ring is not a field it has a smallest prime




• is_smallest_prime(p) => is_unit(q%p) || q%p == 0
Conjecture



Every Euclidean domain is a Stein domain
template <typename EuclideanElement>
EuclideanElement binary_gcd(EuclideanElement m, EuclideanElement n)
{
   EuclideanElement p = smallest_prime<EuclideanElement>();

    if (is_zero(m)) return n;
    if (is_zero(n)) return m;

    EuclideanElement r = unit<EuclideanElement>();

    while (n%p == 0   &&   m%p == 0) {
                  r   *=   p;
                  n   /=   p;
                  m   /=   p;
    }

    while (n%p == 0) n /= p;
    while (m%p == 0) m /= p;

    while (!are_associates(m, n)) {
         m -= ((m%p)/(n%p))*n;   // does not always work
         while (m%p == 0) m /= p;
         swap(m, n);
    }

    return n*r;
}
Non-Euclidean Stein domains

In 2004 Agarwal and Frandsen
  demonstrated that there is a non-
  Euclidean ring (ring of integers in
  Q(√-19)) that is a Stein domain
Conclusions
• Computer Science is Mathematics
• The Math which is important for CS is
  what should be our high school math
  – Algebra
  – Geometry
• Finally, know your heroes
  – Euclid and Euler, not Jobs and Gates
Suggestions for study
• Geometry teaches you an architectural
  sense:
  – Euclid, Elements, translated by Sir Thomas L.
    Heath, Dover , 1956 (3 volumes) - Amazon
• Algebra teaches you transformational
  techniques:
  – George Chrystal, Textbook of Algebra, AMS
    Chelsea Publishing, 1964 (2 volumes) - AMS
Extended bibliography


This is the list of books and papers from
 which the material for the talk was
 gathered.
David Fowler, The Mathematics Of Plato's Academy,
   Oxford, 1999
John Stillwell, Mathematics and Its History, Springer-
   Verlag, 1989
Sir Thomas Heath, History of Greek Mathematics,
   Dover, 1981 (2 volumes)
Euclid, Elements, translated by Sir Thomas L.
   Heath, Dover , 1956 (3 volumes)
B. L. van der Waerden, Geometry and Algebra in
   Ancient Civilizations, Springer-Verlag, 1983
Robin Hartshorne, Geometry: Euclid and Beyond,
   Springer-Verlag, 2000
Lucio Russo, The Forgotten Revolution, Springer-
   Verlag, 2004
Laurence E. Siegler, Fibonacci's Liber Abaci,
  Springer-Verlag, 2002
Nicolas Bourbaki, Elements of the History of
  Mathematics, Springer-Verlag, 1999
Carl Friedrich Gauss, Disquisitiones Arithmaticae,
  Yale, 1965
John Stillwell, Elements of Number Theory,
  Springer-Verlag, 2002
Peter Gustav Lejeune Dirichlet, Lectures on
  Number Theory, AMS, 1999
Richard Dedekind, Theory of Algebraic Integers,
  Cambridge, 1996
B. L. van der Waerden, Algebra, Springer-Verlag,
  1994
Donald Knuth, Art of Computer Programming, vol.
  2, Seminumerical Algorithms, Addison-Wesley,
  1998
Josef Stein, Computational problems associated
  with Racah algebra, J. Comput. Phys., (1967) 1,
  397-405
Andre Weilert, (1+ i)-ary GCD Computation in Z[i]
  as an Analogue of the Binary GCD Algorithm, J.
  Symbolic Computation (2000) 30, 605-617
Ivan Bjerre Damgård and Gudmund Skovbjerg
  Frandsen, Efficient algorithms for GCD and
  cubic residuosity in the ring of Eisenstein
  integers, Proceedings of the 14th International
  Symposium on Fundamentals of Computation
  Theory, Lecture Notes in Computer Science
  2751, Springer-Verlag (2003), 109-117

Saurabh Agarwal, Gudmund Skovbjerg Frandsen,
  Binary GCD Like Algorithms for Some Complex
  Quadratic Rings. ANTS 2004, 57-71

Contenu connexe

Tendances

1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge
1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge
1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridgealproelearning
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Tomonari Masada
 
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTS
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTSA SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTS
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTScsandit
 
Kittel c. introduction to solid state physics 8 th edition - solution manual
Kittel c.  introduction to solid state physics 8 th edition - solution manualKittel c.  introduction to solid state physics 8 th edition - solution manual
Kittel c. introduction to solid state physics 8 th edition - solution manualamnahnura
 
Cahit 8-equitability of coronas cn○k1
Cahit 8-equitability of coronas cn○k1Cahit 8-equitability of coronas cn○k1
Cahit 8-equitability of coronas cn○k1eSAT Publishing House
 
Numerical Evidence for Darmon Points
Numerical Evidence for Darmon PointsNumerical Evidence for Darmon Points
Numerical Evidence for Darmon Pointsmmasdeu
 
parameterized complexity for graph Motif
parameterized complexity for graph Motifparameterized complexity for graph Motif
parameterized complexity for graph MotifAMR koura
 
New Families of Odd Harmonious Graphs
New Families of Odd Harmonious GraphsNew Families of Odd Harmonious Graphs
New Families of Odd Harmonious GraphsIJMIT JOURNAL
 
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...theijes
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyKelly Bresnahan
 
Quantum logic synthesis (srikanth)
Quantum logic synthesis (srikanth)Quantum logic synthesis (srikanth)
Quantum logic synthesis (srikanth)bitra11
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyJorgeVillamarin5
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmeticJanani S
 

Tendances (20)

Hw2
Hw2Hw2
Hw2
 
1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge
1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge
1.trigonometry Further Mathematics Zimbabwe Zimsec Cambridge
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
 
Poisson factorization
Poisson factorizationPoisson factorization
Poisson factorization
 
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan PalacioElliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
 
Ecc2
Ecc2Ecc2
Ecc2
 
Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)
 
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTS
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTSA SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTS
A SURVEY ON ELLIPTIC CURVE DIGITAL SIGNATURE ALGORITHM AND ITS VARIANTS
 
Kittel c. introduction to solid state physics 8 th edition - solution manual
Kittel c.  introduction to solid state physics 8 th edition - solution manualKittel c.  introduction to solid state physics 8 th edition - solution manual
Kittel c. introduction to solid state physics 8 th edition - solution manual
 
Cahit 8-equitability of coronas cn○k1
Cahit 8-equitability of coronas cn○k1Cahit 8-equitability of coronas cn○k1
Cahit 8-equitability of coronas cn○k1
 
Numerical Evidence for Darmon Points
Numerical Evidence for Darmon PointsNumerical Evidence for Darmon Points
Numerical Evidence for Darmon Points
 
Ica group 3[1]
Ica group 3[1]Ica group 3[1]
Ica group 3[1]
 
Density of states of bulk semiconductor
Density of states of bulk semiconductorDensity of states of bulk semiconductor
Density of states of bulk semiconductor
 
parameterized complexity for graph Motif
parameterized complexity for graph Motifparameterized complexity for graph Motif
parameterized complexity for graph Motif
 
New Families of Odd Harmonious Graphs
New Families of Odd Harmonious GraphsNew Families of Odd Harmonious Graphs
New Families of Odd Harmonious Graphs
 
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...
An Efficient Elliptic Curve Cryptography Arithmetic Using Nikhilam Multiplica...
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Quantum logic synthesis (srikanth)
Quantum logic synthesis (srikanth)Quantum logic synthesis (srikanth)
Quantum logic synthesis (srikanth)
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmetic
 

Similaire à Greatest Common Measure: the Last 2500 Years

Astrodynamics_Note.pdf
Astrodynamics_Note.pdfAstrodynamics_Note.pdf
Astrodynamics_Note.pdffurexpose
 
CGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationCGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationBruno Levy
 
amer.math.monthly.124.2.179.pdf
amer.math.monthly.124.2.179.pdfamer.math.monthly.124.2.179.pdf
amer.math.monthly.124.2.179.pdfxohovaf
 
Year 13 challenge mathematics problems 107
Year 13 challenge mathematics problems 107Year 13 challenge mathematics problems 107
Year 13 challenge mathematics problems 107Dennis Almeida
 
On approximating the Riemannian 1-center
On approximating the Riemannian 1-centerOn approximating the Riemannian 1-center
On approximating the Riemannian 1-centerFrank Nielsen
 
Rational points on elliptic curves
Rational points on elliptic curvesRational points on elliptic curves
Rational points on elliptic curvesmmasdeu
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsVjekoslavKovac1
 
Practice questions( calculus ) xii
Practice questions( calculus ) xiiPractice questions( calculus ) xii
Practice questions( calculus ) xiiindu psthakur
 
ISI MSQE Entrance Question Paper (2009)
ISI MSQE Entrance Question Paper (2009)ISI MSQE Entrance Question Paper (2009)
ISI MSQE Entrance Question Paper (2009)CrackDSE
 
Probability and Entanglement
Probability and EntanglementProbability and Entanglement
Probability and EntanglementGunn Quznetsov
 
Dynamic Programming.pptx
Dynamic Programming.pptxDynamic Programming.pptx
Dynamic Programming.pptxThanga Ramya S
 
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...inventionjournals
 
Midterm Study Guide
Midterm Study GuideMidterm Study Guide
Midterm Study Guidevhiggins1
 
Spike sorting: What is it? Why do we need it? Where does it come from? How is...
Spike sorting: What is it? Why do we need it? Where does it come from? How is...Spike sorting: What is it? Why do we need it? Where does it come from? How is...
Spike sorting: What is it? Why do we need it? Where does it come from? How is...NeuroMat
 

Similaire à Greatest Common Measure: the Last 2500 Years (20)

Astrodynamics_Note.pdf
Astrodynamics_Note.pdfAstrodynamics_Note.pdf
Astrodynamics_Note.pdf
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 3
Unit 3Unit 3
Unit 3
 
CGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationCGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulation
 
amer.math.monthly.124.2.179.pdf
amer.math.monthly.124.2.179.pdfamer.math.monthly.124.2.179.pdf
amer.math.monthly.124.2.179.pdf
 
Year 13 challenge mathematics problems 107
Year 13 challenge mathematics problems 107Year 13 challenge mathematics problems 107
Year 13 challenge mathematics problems 107
 
On approximating the Riemannian 1-center
On approximating the Riemannian 1-centerOn approximating the Riemannian 1-center
On approximating the Riemannian 1-center
 
M112rev
M112revM112rev
M112rev
 
Rational points on elliptic curves
Rational points on elliptic curvesRational points on elliptic curves
Rational points on elliptic curves
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operators
 
Practice questions( calculus ) xii
Practice questions( calculus ) xiiPractice questions( calculus ) xii
Practice questions( calculus ) xii
 
ISI MSQE Entrance Question Paper (2009)
ISI MSQE Entrance Question Paper (2009)ISI MSQE Entrance Question Paper (2009)
ISI MSQE Entrance Question Paper (2009)
 
Probability and Entanglement
Probability and EntanglementProbability and Entanglement
Probability and Entanglement
 
Proof in Mathematics
Proof in MathematicsProof in Mathematics
Proof in Mathematics
 
Maths04
Maths04Maths04
Maths04
 
Dynamic Programming.pptx
Dynamic Programming.pptxDynamic Programming.pptx
Dynamic Programming.pptx
 
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...
On Triplet of Positive Integers Such That the Sum of Any Two of Them is a Per...
 
Midterm Study Guide
Midterm Study GuideMidterm Study Guide
Midterm Study Guide
 
Spike sorting: What is it? Why do we need it? Where does it come from? How is...
Spike sorting: What is it? Why do we need it? Where does it come from? How is...Spike sorting: What is it? Why do we need it? Where does it come from? How is...
Spike sorting: What is it? Why do we need it? Where does it come from? How is...
 
1 ca nall
1 ca nall1 ca nall
1 ca nall
 

Dernier

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Greatest Common Measure: the Last 2500 Years

  • 1. Greatest Common Measure: the Last 2500 Years Alexander Stepanov
  • 2. This lecture was originally prepared as the 1999 Arthur Schoffstall Lecture in Computer Science and Computer Engineering at the Rensselaer Polytechnic Institute
  • 3. Abstract The talk describes development of Euclid's algorithm from early Pythagoreans to modern times. This development shows gradual evolution of a notion of abstract (or generic) algorithm. While the term generic programming was introduced by Musser and Stepanov in 1988, the notion of algorithmic genericity goes back to remote centuries and is one of the main driving forces of mathematical progress. Study of mathematics develops an architectural ability for organizing large body of knowledge, which is still lacking in Computer Science. Euclid’s Elements (with a good modern guide such as Robin Hartshorne) is a wonderful textbook for software engineers. The sense of history is very important for a scientist in order to be able to evaluate what is, and is not, important. To understand something we need to know its history.
  • 6. “He attached supreme importance to the study of arithmetic, which he advanced and took out of the region of commercial utility.” Aristoxenus
  • 7. He maintained that “the principles of mathematics are principles of all existing things.” Aristotle
  • 8. He discovered “the theory of irrationals and the construction of cosmic bodies.” Proclus
  • 10. To reduce the world to numbers, one needs the absolute common measure, the smallest physically possible segment, the quantum of space.
  • 11. IT DOES NOT EXIST! However small a measure we pick there are segments that cannot be measured by it.
  • 12. gcm(a, a) = a gcm(a, b) = gcm(a, a + b) a>b gcm(a, b) = gcm(a - b, b) gcm(a, b) = gcm(b, a)
  • 13. line_segment gcm(line_segment a, line_segment b) { if (a == b) return a; if (a > b) return gcm(a-b, b); if (a < b) return gcm(a, b-a); }
  • 14. 196 42 154 42 112 42 70 42 28 42 28 14 14 14 Done! GCD: 14
  • 15. Let us assume that there is a measure that can measure both the side and the diagonal of some square. Let us take the smallest such square for the given measure. (Greeks found the principle that any set of natural numbers has the smallest element a very powerful proof technique. Now we know that it is equivalent to mathematical induction. So, in order to prove that something does not exist, you prove that if it exists, a smaller one also exists.)
  • 16. B A C D
  • 17. B A E F C D AB = AF AC ⊥ EF
  • 18. B A E G F C D AC ⊥ CG EG ⊥ EF
  • 19. B A E G F C D CF = EF = EB
  • 20. B A E G F C D gcm(AC,AB) = gcm(AB,CF) gcm(CE,CF) = gcm(AC,AB)
  • 21. B A E G F C D EC > EB > EB < AB/2
  • 22. We constructed a smaller square that could be measured by this measure. Contradiction!
  • 23. The side and the diagonal of the square produced by the proof result from two iterations of the algorithm: d, s => s, d - s => 2s - d, d - s And the original ratio is repeated: d/s = (2s - d)/(d -s)
  • 24. Or, as we would say it now, Pythagoras discovered that √2 is irrational
  • 25. Plato (427BC - 347BC)
  • 27. LET NO ONE WHO DOES NOT KNOW GEOMETRY ENTER
  • 28. They came to Plato’s lecture on the Good in the conviction that they would get some one or other of the things that the world calls good: riches, or health, or strength. But when they found that Plato’s reasonings were of mathematics their disenchantment was complete. Aristoxenus
  • 29. Plato's Algorithm void sqrt_of_2(int count) { int side = 1; int diagonal = 1; for(int n = 0; n < count; ++n) { int tmp = side + diagonal; diagonal = tmp + side; side = tmp; } display(diagonal, side, count); }
  • 30. Rational diameter of: 1 is 1 (1) 2 is 3 (1.5) 5 is 7 (1.4) 12 is 17 (1.41667) 29 is 41 (1.41379) 70 is 99 (1.41429) 169 is 239 (1.4142) 408 is 577 (1.41422) 985 is 1393 (1.41421) 2378 is 3363 (1.41421)
  • 32. Some one who had begun to read geometry with Euclid, when he had learnt the first theorem, asked Euclid, “what shall I get by learning these things?” Euclid called his slave and said, “Give him threepence, since he must make gain out of what he learns.” Strobaeus, Florilegium
  • 33. Euclid guaranteed termination by changing the input types: unsigned int gcd(unsigned int a, unsigned int b) { assert(a > 0 && b > 0); // should wait for Arabs // and Leonardo Pisano if (a == b) return a; if (a > b) return gcd(a-b, b); /* if (b > a) */ return gcd(a, b-a); }
  • 34. Elements, Book X Proposition 1. Two unequal magnitudes being set out, if from the greater there is subtracted a magnitude greater than its half, and from that which is left a magnitude greater than its half, and if this process is repeated continually, then there will be left some magnitude less than the lesser magnitude set out.
  • 35. Elements, Book X Proposition 2. If, when the less of two unequal magnitudes is continually subtracted in turn from the greater that which is left never measures the one before it, then the two magnitudes are incommensurable.
  • 36. Elements, Book X Proposition 3. To find the greatest common measure of two given commensurable magnitudes. Corollary. If a magnitude measures two magnitudes, then it also measures their greatest common measure.
  • 37. Euclid guaranteed termination by changing the input types: unsigned int gcd(unsigned int a, unsigned int b) { assert(a > 0 && b > 0); // should wait for Arabs // and Leonardo Pisano if (a == b) return a; if (a > b) return gcd(a-b, b); /* if (b > a) */ return gcd(a, b-a); } Why a-b, not a%b?
  • 38. Lincoln and Euclid "He studied and nearly mastered the six books of Euclid since he was a member of Congress. He regrets his want of education, and does what he can to supply the want." --Lincoln's Autobiography of 1860
  • 39. New Math against Euclid In 1959, at a conference on the teaching of mathematics in Réalmont, France, Jean Dieudonné rose and hurled the slogans "Down with Euclid!" and "Death to triangles!" I.M.Yaglom, Elementary Geometry Then and Now
  • 40. The Years of Decline: 212BC - 1202AD In summo apud illos honore geometria fuit, itaque nihil mathematicis inlustrius; at nos metiendi ratiocinandique utilitate huius artis terminavimus modum. Among them [the Greeks] geometry was held in highest honor; nothing was more glorious than mathematics. But we [the Romans] have limited the usefulness of this art to measuring and calculating. Cicero, Tusculan Disputations
  • 42. Sqrt(2) = 1 + 1/(2 + 1/(2 + 1/(2 + ... Continued fractions generated by quotients represent a ratio of any two segments.
  • 44. It took over 1500 years to move to: unsigned int gcd(unsigned int m, unsigned int n) { while (n != 0) { unsigned int t = m % n; m = n; n = t; } return m; }
  • 45. 196 42 196 = 42*4 + 28 42 28 42 = 28*1 + 14 28 14 28 = 14*2 + 0 14 0 Done! GCD: 14
  • 47.
  • 48. Simon Stevin: int gcd(int m, int n) { while (n != 0) { int t = m % n; m = n; n = t; } return m; }
  • 49. Simon Stevin: polynomial<real> gcd(polynomial<real> m, polynomial<real> n) { while (n != 0) { polynomial<real> t = m % n; m = n; n = t; } return m; }
  • 50. 3x2+2x-2 x-2 3x3-4x2-6x+10 3x3-6x2 2x2-6x 2x2-4x -2x+10 -2x+4 6
  • 51. Carl Friedrich Gauss (1777 - 1855)
  • 52. Given many numbers A, B, C, etc the greatest common divisor is found as follow. Let all the numbers be resolved into their prime factors, and from these extract the ones which are common to A, B, C, etc… Gauss, Disqisitiones Arithmeticae, art. 18
  • 53. Carl Gauss: complex<int> gcd(complex<int> m, complex<int> n) { while (n != 0) { complex<int> t = m % n; m = n; n = t; } return m; }
  • 54. Finding a Gaussian remainder To find a remainder of z1 divided by z2 1. Construct a square grid on the complex plane generated by z2 together with i*z2, -i*z2 and -z2. 2. Find a square in the grid containing z1. 3. Find a vertex w of the square closest to z1. 4. The remainder is z1 - w.
  • 55. Z1 Z2
  • 57. “It is now clear that the whole structure of number theory rests on a single foundation, namely the algorithm for finding the greatest common divisor of two numbers. All the subsequent theorems … are still only simple consequences of the result of this initial investigation, so one is entitled to make the following claim: any analogous theory, for which there is a similar algorithm for the greatest common divisor, must also have consequences analogous to those in our theory. In fact, such theories exist.” Lejeune Dirichlet, Lectures on Number Theory
  • 58. “If one considers all numbers of the form t + n√-a where a is a particular positive integer and t and n are arbitrary integers … it is only for certain values of a, e.g. a = 1, that the greatest common divisor of two numbers could be found by an algorithm like the one for … integers. … However, it is otherwise when a = 5. … For example, 21 = 3*7 = (1+2√-5)*(1-2√-5)…” Lejeune Dirichlet, Lectures on Number Theory
  • 59. Richard Dedekind (1831 - 1916)
  • 60. Algebraic integers Algebraic integers are roots of monic polynomials with integer coefficients.
  • 61. Es steht alles schon bei Dedekind! Emmy Noether (It is all already in Dedekind.) All = {rings, fields, ideals, modules,…}
  • 62. Euclid and Göttingen • Gauss – Regular polygons – Non-Euclidean geometry • Lobachevsky and Bolyai • The equality of two volumes of two tetrahedra • Dirichlet – Infinity of primes in arithmetic progression • Riemann – Non-Euclidian geometry • Dedekind – Edoxian theory reborn • Klein – Erlanger program • Hilbert – Foundations of Geometry – One must be able to say at all times -- instead of points, straight lines, and planes -- tables, beer mugs, and chairs – Mechanization of mathematics
  • 64. It was she who taught us to think in terms of simple and general algebraic concepts – homomorphic mappings, groups and rings with operators, ideals… P.S. Alexandrov For Emmy Noether, relationships among numbers, functions, and operations became transparent, amenable to generalisation, and productive only after they have been dissociated from any particular objects and have been reduced to general conceptual relationships… B.L. van der Waerden
  • 65. Bartel Leendert van der Waerden (1903 - 1996)
  • 66. Dedekind, Noether, van der Waerden: template <class EuclideanRingElement> EuclideanRingElement gcd(EuclideanRingElement m, EuclideanRingElement n) { while (n != 0) { EuclideanRingElement t = m % n; m = n; n = t; } return m; }
  • 67. Euclidean domain • A commutative ring (+, -, *) • Function norm: Ring -> Unsigned – norm(a*b) >= norm(a) – For any a, b, where b != 0, there exist q, r, such that a == q*b + r and r == 0 || norm(r) < norm(b)
  • 68. Donald Knuth (1938 - )
  • 69. Knuth’s objection: gcd(1, -1) = -1 template <class EuclideanRingElement> EuclideanRingElement gcd(EuclideanRingElement m, EuclideanRingElement n) { while (n != 0) { EuclideanRingElement t = m % n; m = n; n = t; } if (m < 0) m = -m; return m; }
  • 70. Depends on the definition!
  • 71. Greatest common divisor is a common divisor that is divisible by any other common divisor.
  • 72. What is Euclidian Domain? • What are operations and their requirements? • What are intended models? • What are related algorithms?
  • 73. Extended Euclid template <class EuclideanDomain> triple<EuclideanDomain, EuclideanDomain, EuclideanDomain> extended_euclid(EuclideanDomain u, EuclideanDomain v) { EuclideanDomain u0 = 1; EuclideanDomain v0 = 0; EuclideanDomain u1 = u; EuclideanDomain v1 = v; while (v1 != 0) { EuclideanDomain q = u1/v1; u0 -= v0 * q; swap(u0, v0); u1 -= v1 * q; swap(u1, v1); } return make_triple(u0, (u1 - u * u0) / v, u1); }
  • 74. Josef Stein (1961): gcd(n, 0) = gcd(0, n) = n gcd(n, n) = n gcd(2n, 2m) = 2gcd(n, m) gcd(2n, 2m + 1) = gcd(n, 2m + 1) gcd(2n + 1, 2m) = gcd(2n + 1, m) gcd(2n + 1, 2(n + k) + 1) = gcd(2(n + k) + 1, 2n + 1) = gcd(2n + 1, k)
  • 75. 196 42 98 21 2 49 21 2 28 21 2 14 21 2 7 21 2 14 7 2 7 7 2 Done! GCD: 7*2 = 14
  • 76. template <class BinaryInteger> BinaryInteger gcd(BinaryInteger m, BinaryInteger n) { make_non_negative(m); make_non_negative(n); if (is_zero(m)) return n; if (is_zero(n)) return m; int d = 0; while (is_even(m) && is_even(n)) { half_non_negative(m); half_non_negative(n); ++d; }
  • 77. while (is_even(m)) half_non_negative(m); while (is_even(n)) half_non_negative(n); while (true) if (m < n) { n = n - m; do { half_non_negative(n); } while (is_even(n)); } else if (n < m) { m = m - n; do { half_non_negative(m); } while (is_even(m)); } else return left_shift(m, d); }
  • 79. Stein for polynomials over a field gcd(p,0) = gcd(0,p) = p gcd(p, p) = p gcd(x*p1,x*p2) = x*gcd(p1, p2) gcd(x*p1,x*p2+c) = gcd(p1, x*p2+c) gcd(x*p1+c,x*p2) = gcd(x*p1+c,p2) if degree(p1) >= degree(p2) gcd(x*p1+c1,x*p2+c2) = gcd(p1-(c1/c2)*p2, x*p2+c2) if degree(p1) < degree(p2) gcd(p1,p2) = gcd(p2,p1)
  • 80. x3-3x-2 x2-4 x3-.5x2-3x x2-4 x2-.5x-3 x2-4 x2-2x x2-4 x-2 x2-4 x2-4 x-2 x2-2x x-2 x-2 x-2 Done! GCD: x-2
  • 81. Weilert algorithm for Gaussian Integers Use 1+i as 2!
  • 82. Division by 1+i a+bi/1+i =(a+bi)(1-i)/(1+i)(1-i)= (a+bi)(1-i)/2 = ((a+b) - (a-b)i)/2 A Gaussian integer a+bi is divisible by 1+i if and only if a=b(mod 2)
  • 83. Remainder Cancellation If two Gaussian integers z1 and z2 are not divisible by 1+i then z1+z2 is divisible by 1+i. Then z1-z2, z1+i*z2 and z1-i*z2 are also divisible by 1+i. And, min (|z1+z2|, |z1-z2|, |z1+i*z2|, |z1-i*z2|) < max(|z1|, |z2|)
  • 84. Damgård and Frandsen Algorithm • Stein algorithm works for Eisenstein integers Z[ζ], i.e. the integers extended with ζ (−1+ − 3 2 ), a complex primitive third root of unity. • We use 1 - ζ as our 2.
  • 85. What is Stein domain?
  • 86. Few definitions • is_unit(u) iff there is a v such that v*u == 1 • are_associates(m, n) iff is_unit(u) && u*n == m • is_smallest_prime(p) iff for any q != 0, norm(q) < norm(p) => is_unit(q)
  • 87. Few lemmas • is_unit(u) => norm(a) == norm(u*a) • if a Euclidean ring is not a field it has a smallest prime • is_smallest_prime(p) => is_unit(q%p) || q%p == 0
  • 89. template <typename EuclideanElement> EuclideanElement binary_gcd(EuclideanElement m, EuclideanElement n) { EuclideanElement p = smallest_prime<EuclideanElement>(); if (is_zero(m)) return n; if (is_zero(n)) return m; EuclideanElement r = unit<EuclideanElement>(); while (n%p == 0 && m%p == 0) { r *= p; n /= p; m /= p; } while (n%p == 0) n /= p; while (m%p == 0) m /= p; while (!are_associates(m, n)) { m -= ((m%p)/(n%p))*n; // does not always work while (m%p == 0) m /= p; swap(m, n); } return n*r; }
  • 90. Non-Euclidean Stein domains In 2004 Agarwal and Frandsen demonstrated that there is a non- Euclidean ring (ring of integers in Q(√-19)) that is a Stein domain
  • 91. Conclusions • Computer Science is Mathematics • The Math which is important for CS is what should be our high school math – Algebra – Geometry • Finally, know your heroes – Euclid and Euler, not Jobs and Gates
  • 92. Suggestions for study • Geometry teaches you an architectural sense: – Euclid, Elements, translated by Sir Thomas L. Heath, Dover , 1956 (3 volumes) - Amazon • Algebra teaches you transformational techniques: – George Chrystal, Textbook of Algebra, AMS Chelsea Publishing, 1964 (2 volumes) - AMS
  • 93. Extended bibliography This is the list of books and papers from which the material for the talk was gathered.
  • 94. David Fowler, The Mathematics Of Plato's Academy, Oxford, 1999 John Stillwell, Mathematics and Its History, Springer- Verlag, 1989 Sir Thomas Heath, History of Greek Mathematics, Dover, 1981 (2 volumes) Euclid, Elements, translated by Sir Thomas L. Heath, Dover , 1956 (3 volumes) B. L. van der Waerden, Geometry and Algebra in Ancient Civilizations, Springer-Verlag, 1983 Robin Hartshorne, Geometry: Euclid and Beyond, Springer-Verlag, 2000 Lucio Russo, The Forgotten Revolution, Springer- Verlag, 2004
  • 95. Laurence E. Siegler, Fibonacci's Liber Abaci, Springer-Verlag, 2002 Nicolas Bourbaki, Elements of the History of Mathematics, Springer-Verlag, 1999 Carl Friedrich Gauss, Disquisitiones Arithmaticae, Yale, 1965 John Stillwell, Elements of Number Theory, Springer-Verlag, 2002 Peter Gustav Lejeune Dirichlet, Lectures on Number Theory, AMS, 1999 Richard Dedekind, Theory of Algebraic Integers, Cambridge, 1996 B. L. van der Waerden, Algebra, Springer-Verlag, 1994
  • 96. Donald Knuth, Art of Computer Programming, vol. 2, Seminumerical Algorithms, Addison-Wesley, 1998 Josef Stein, Computational problems associated with Racah algebra, J. Comput. Phys., (1967) 1, 397-405 Andre Weilert, (1+ i)-ary GCD Computation in Z[i] as an Analogue of the Binary GCD Algorithm, J. Symbolic Computation (2000) 30, 605-617
  • 97. Ivan Bjerre Damgård and Gudmund Skovbjerg Frandsen, Efficient algorithms for GCD and cubic residuosity in the ring of Eisenstein integers, Proceedings of the 14th International Symposium on Fundamentals of Computation Theory, Lecture Notes in Computer Science 2751, Springer-Verlag (2003), 109-117 Saurabh Agarwal, Gudmund Skovbjerg Frandsen, Binary GCD Like Algorithms for Some Complex Quadratic Rings. ANTS 2004, 57-71