23
Math 412: Number Theory Lecture 2: GCD and linear diophantine equations Gexin Yu [email protected] College of William and Mary Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophan

Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Math 412: Number TheoryLecture 2: GCD and linear diophantine equations

Gexin [email protected]

College of William and Mary

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 2: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

GCD and Euclidean Algorithm

Let (a, b) be the greatest common divisor (gcd) of a and b.

Lemma: if a = bq + r , then (a, b) = (b, r).

Euclidean Algorithm to find (a, b)

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 3: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

GCD and Euclidean Algorithm

Let (a, b) be the greatest common divisor (gcd) of a and b.

Lemma: if a = bq + r , then (a, b) = (b, r).

Euclidean Algorithm to find (a, b)

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 4: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

GCD and Euclidean Algorithm

Let (a, b) be the greatest common divisor (gcd) of a and b.

Lemma: if a = bq + r , then (a, b) = (b, r).

Euclidean Algorithm to find (a, b)

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 5: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Ex: Find (2134, 3246).

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 6: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Theorem: there exist integers m, n so that

(a, b) = ma + bn.

Thm: (a, b), when ab 6= 0, is the least positive integer of the formma + nb. In fact, {ma + nb : m, n ∈ Z} = {kb : k ∈ Z}.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 7: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Theorem: there exist integers m, n so that

(a, b) = ma + bn.

Thm: (a, b), when ab 6= 0, is the least positive integer of the formma + nb. In fact, {ma + nb : m, n ∈ Z} = {kb : k ∈ Z}.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 8: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Coprime Integers

The integers a and b are coprime (relatively prime) if (a, b) = 1.

Then a and b are coprime if and only if there exist m, n ∈ Z so that

ma + nb = 1.

Ex: If (a, b) = 1, and a|n and b|n, then ab|n.

Thm: if (a, b) = d , then (a/d , b/d) = 1. From this, we can reduceevery fraction into its lowest term.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 9: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Coprime Integers

The integers a and b are coprime (relatively prime) if (a, b) = 1.

Then a and b are coprime if and only if there exist m, n ∈ Z so that

ma + nb = 1.

Ex: If (a, b) = 1, and a|n and b|n, then ab|n.

Thm: if (a, b) = d , then (a/d , b/d) = 1. From this, we can reduceevery fraction into its lowest term.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 10: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Coprime Integers

The integers a and b are coprime (relatively prime) if (a, b) = 1.

Then a and b are coprime if and only if there exist m, n ∈ Z so that

ma + nb = 1.

Ex: If (a, b) = 1, and a|n and b|n, then ab|n.

Thm: if (a, b) = d , then (a/d , b/d) = 1. From this, we can reduceevery fraction into its lowest term.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 11: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Coprime Integers

The integers a and b are coprime (relatively prime) if (a, b) = 1.

Then a and b are coprime if and only if there exist m, n ∈ Z so that

ma + nb = 1.

Ex: If (a, b) = 1, and a|n and b|n, then ab|n.

Thm: if (a, b) = d , then (a/d , b/d) = 1. From this, we can reduceevery fraction into its lowest term.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 12: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Euclid Lemma: If a|bc and (a, b) = 1, then a|c .

Ex: (Euclid Lemma, special case) if p|ab then p|a or p|b.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 13: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Euclid Lemma: If a|bc and (a, b) = 1, then a|c .

Ex: (Euclid Lemma, special case) if p|ab then p|a or p|b.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 14: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Linear Diophantine Equation

Consider equation ax + by = c , where a, b, c are integers and d = (a, b).

The equation has no integral solutions if d 6 |c .

If d |c, then there are infinitely many integral solutions.

Moreover, if x = x0, y = y0 is a particular solution, then all solutionsare given by

x = x0 + (b/d)n, y = y0 − (a/d)n,

where n is an integer.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 15: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 16: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Lemma:a1x1 + a2x2 + . . .+ anxn + an+1xn+1 = c

if and only if

a1x1 + a2x2 + . . .+ an−1xn−1 + (an, an+1)y = c

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 17: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Prime numbers

Definition: a (positive) integer p is prime if p has no divisor otherthan 1 and p. Otherwise it is a composite number.

Ex: Every composite number has a prime divisor.

Ex: every composite integer n has a prime divisor at most√n.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 18: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Prime numbers

Definition: a (positive) integer p is prime if p has no divisor otherthan 1 and p. Otherwise it is a composite number.

Ex: Every composite number has a prime divisor.

Ex: every composite integer n has a prime divisor at most√n.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 19: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Prime numbers

Definition: a (positive) integer p is prime if p has no divisor otherthan 1 and p. Otherwise it is a composite number.

Ex: Every composite number has a prime divisor.

Ex: every composite integer n has a prime divisor at most√n.

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 20: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Thm: there are infinite many prime numbers.

Sieve of Eratosthenes: a method to find all prime less than an integer.

Prime Number Theorem: Let π(x) be the number of primes at mostx , then π(x)→ x

ln x as x →∞.

Primitive Test: a polynomial time algorithm was found in 2002 byAgrawal, Kayal, and Saxena (an India CS professors with two understudents).

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 21: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Thm: there are infinite many prime numbers.

Sieve of Eratosthenes: a method to find all prime less than an integer.

Prime Number Theorem: Let π(x) be the number of primes at mostx , then π(x)→ x

ln x as x →∞.

Primitive Test: a polynomial time algorithm was found in 2002 byAgrawal, Kayal, and Saxena (an India CS professors with two understudents).

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 22: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Thm: there are infinite many prime numbers.

Sieve of Eratosthenes: a method to find all prime less than an integer.

Prime Number Theorem: Let π(x) be the number of primes at mostx , then π(x)→ x

ln x as x →∞.

Primitive Test: a polynomial time algorithm was found in 2002 byAgrawal, Kayal, and Saxena (an India CS professors with two understudents).

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations

Page 23: Math 412: Number Theory Lecture 2: GCD and linear ...gyu.people.wm.edu/Fall2016/Math412/nt-lec2-note.pdfGexin Yu gyu@wm.edu Math 412: Number Theory Lecture 2: GCD and linear diophantine

Thm: there are infinite many prime numbers.

Sieve of Eratosthenes: a method to find all prime less than an integer.

Prime Number Theorem: Let π(x) be the number of primes at mostx , then π(x)→ x

ln x as x →∞.

Primitive Test: a polynomial time algorithm was found in 2002 byAgrawal, Kayal, and Saxena (an India CS professors with two understudents).

Gexin Yu [email protected] Math 412: Number Theory Lecture 2: GCD and linear diophantine equations