Top Banner
Dr. Bob Hummel Potomac Institute for Policy Studies [email protected] ORCON: Ask permission before redistributing Not intended for publication
40

The art of number theory v7b[1]

Sep 13, 2014

Download

Education

Feb 5, 2013 Cafe Scientifique Arlington
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The art of number theory v7b[1]

Dr. Bob Hummel Potomac Institute for Policy Studies

[email protected]

ORCON: Ask permission before redistributing Not intended for publication

Page 2: The art of number theory v7b[1]

STEM: Science, Technology, Engineering, & Mathematics � STEM includes mathematics � But when you call it STEM, do

you think “mathematics”? � Math is at the tail end

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 2

Are these people learning math?

Page 3: The art of number theory v7b[1]

The Phenomenon of Math Phobia

� Math is cumulative � For most of the math curriculum

�  If you fall behind, you remain behind

�  Answers in math are generally right or wrong

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 3

Why do we even bother to teach math? Don’t calculators and computers obviate math?

Page 4: The art of number theory v7b[1]

What we teach

� Arithmetic � Word problems � Algebra � Geometry � Graphing, pre-calc � Calculus

2+2=

Sally has 23 cents. She…

7X6= 4–6=–2 0+5=5

5+x=8

( ) ( ) ( )afbfxx'f −=∫ d

4 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Mostly builds one topic to the next. Parents reinforce children phobia.

Page 5: The art of number theory v7b[1]

Why do we teach these? They are useful… � Arithmetic in daily life � Word problems are about thinking

� Calculus for engineering

5 The Art of Number Theory February 4, 2013

Page 6: The art of number theory v7b[1]

But few actually ever use higher mathematics � Riemann Surfaces � Category Theory � Homotopy Theory

�  Lipschitz Functions �  Riemann-Roch

Theorem �  Algebraic Topology

6 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Page 7: The art of number theory v7b[1]

Some higher math ends up being very important

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 7

Bernard Riemann b. 1826

�  Riemannian geometry is the key to General Relativity

Partial Differential Equations leads to Computational Fluid Dynamics, and then flight control

Lehmer Sieve

And number theory, and

theory of primes, leads

to cryptography

Page 8: The art of number theory v7b[1]

But the real point is to teach logical thinking � We justify math education as

a route to logical thinking � Proofs � Analysis, vice arguments � Brain exercises

8 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Page 9: The art of number theory v7b[1]

And those STEM fields benefit from mathematical thinking � Mathematics is about analytic

thinking � Proofs �  Intuition: What is provable?

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 9

Page 10: The art of number theory v7b[1]

Let us think Deeply of Simple Things � Arnold E. Ross

�  The Ross Math Program ○  1957 to 2000 ○  Dan Shapiro continues the program

�  The Ohio State Math program for High School Students

�  Based on Number Theory

10 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Page 11: The art of number theory v7b[1]

Outcome of the Ross Program

� A rather large percentage of graduates became practicing mathematicians �  Also some famous physicists

� The big advantage of number theory: �  After some basics, many topics are

independent of one another �  And the basics are simple

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 11

Page 12: The art of number theory v7b[1]

Clock Arithmetic Example: 10:00 + 3hr = 1:00

10+3≡1 mod 12

12 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

10+2≡0 mod 12 10+9=7 mod 12

Page 13: The art of number theory v7b[1]

Clock Arithmetic with a different clock

7

1

2

3 4

5

6 4:00 mod 7

7

1

2

3 4

5

6

Add 5 “hours”

4+5≡2 mod 7

13 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

4+3≡0 mod 7

Page 14: The art of number theory v7b[1]

Addition table mod 7

+   0   1   2   3   4   5   6  

0   0   1   2   3   4   5   6  

1   1   2   3   4   5   6   0  

2   2   3   4   5   6   0   1  

3   3   4   5   6   0   1   2  

4   4   5   6   0   1   2   3  

5   5   6   0   1   2   3   4  

6   6   0   1   2   3   4   5  

14 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Page 15: The art of number theory v7b[1]

But what about multiplication?

X   0   1   2   3   4   5   6  0   0   0   0   0   0   0   0  1   0   1   2   3   4   5   6  2   0   2   4   6   1   3   5  3   0   3   6   2   5   1   4  4   0   4   1   5   2   6   3  5   0   5   3   1   6   4   2  6   0   6   5   4   3   2   1  

Examples: 3X5≡1 mod 15 2X5≡3 mod 7 5X5≡4 mod 7 6X6≡1 mod 7

15 The Art of Number Theory

Dr. Bob Hummel February 4, 2013

Page 16: The art of number theory v7b[1]

Under multiplication, Up is an Abeilian Group � Zp, p a prime, = {0,1,2,3,… p–1} � Up, p a prime, = {1,2,3,… p–1} � All group properties inherited from R,

except: � Multiplicative inverses

� For any a in Up, other than 0, find a–1 such that a X a–1=1 mod p

Z7, Z17, Z213466917–1

16 The Art of Number Theory February 4, 2013

Page 17: The art of number theory v7b[1]

Greatest common divisor, also called the greatest common factor �  gcd(6,9)=3 �  gcd(55,121)=11 �  gcd(35,49)=7 �  In general, a common divisor larger than

every other common divisor �  a and b are “relatively prime” if gcd(a,b)=1 �  If p is prime, then gcd(a,p)=1 unless a=np

�  I.e., unless a ≡ 0 mod p

17 The Art of Number Theory February 4, 2013

Page 18: The art of number theory v7b[1]

Diophantine Equation

� Given a, b nonzero integers, find x, y such that ax+by=gcd(a,b)

� Theorem: There always exist an x and y, integers, that solve the Diophantine Equation

� Examples �  6X(-1)+9X(1)=3 �  55X(-2)+121X(1)=11 �  35X(3)+49X(-2)=7

18 The Art of Number Theory February 4, 2013

Page 19: The art of number theory v7b[1]

A lovely math theorem

�  Let Un = { x | gcd(x,n)=1}, under multiplication mod n

� Then Un is an Abelian Group

�  n a prime is a special case

� The proof is constructive!

February 4, 2013 The Art of Number Theory 19

Page 20: The art of number theory v7b[1]

Some examples � U21 = { 1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 20} �  Inverses:

�  1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 20 �  1, 11, 16, 17, 8, 19, 2, 13, 4, 5, 10, 20

� Check it out � How come this works? � And, incidentally, this will be important for

encryption

February 4, 2013 The Art of Number Theory 20

Page 21: The art of number theory v7b[1]

Euclid’s Algorithm to find gcd’s

b.325 BC

35 49

1

35

14 35

2

28

7 14

2

14

0

This is the gcd

gcd( 35, 49) = 7

And 1, 2, 2 are the partial quotients

1 + 1

2 + 1 2

Continued fraction!

21 The Art of Number Theory February 4, 2013

Page 22: The art of number theory v7b[1]

Another Example

230 563

2

460 103 230

2

206

24 4

103 96

7

p=563

a=230

24

3

21

3 7 2

6

1 3

3

3

0

2 2 4 3 2 3

2 + 1

2 + 1

4 + 1

3 + 1

2 + 1

3

2, 5/2, 22/9, 71/29, 164/67, 563/230 22 The Art of Number Theory February 4, 2013

563

230 =

Page 23: The art of number theory v7b[1]

So, what is the inverse of 230 mod 563 p=563

a=230

2 2 4 3 2 3

2 + 1

2 + 1

4 + 1

3 + 1

2 + 1

3

2, 5/2, 22/9, 71/29, 164/67, 563/230

Diophantine: – 164 · 230 + 67 · 563 = 1

So (– 164) · 230 = 1 mod 563

I.e., 230 – 1 = 399 mod 563

Check: 230 · 399 = 91770 = 563 · 163 + 1

23 The Art of Number Theory February 4, 2013

Answer: −164 = 399

Page 24: The art of number theory v7b[1]

A faster way of computing partial quotients

p=563

a=230

2 2 4 3 2 3

2 + 1

2 + 1

4 + 1

3 + 1

2 + 1

3

2, 5/2, 22/9, 71/29, 164/67, 563/230

0 1 2 5 22 71 164 563

1 0 1 2 9 29 67 230

Inverse is either 164 or –164

24 The Art of Number Theory February 4, 2013

Page 25: The art of number theory v7b[1]

Fermat’s Theorem

� For any a other than 0 mod p, a p = a mod p

� Equivalently a p–1 ≡ 1 mod p

b. 1601 (or maybe 1607)

25 The Art of Number Theory February 4, 2013

Page 26: The art of number theory v7b[1]

Euler’s Theorem

� Generalizes Fermat’s Theorem

a φ(n) ≡ 1 mod n where φ(n) is the number in the set Un

If gcd(a,n) = 1

b. 1707

26 The Art of Number Theory February 4, 2013

Page 27: The art of number theory v7b[1]

This would seem to have little to do with encryption � After all, the simplest encryption is a

letter cipher:

� This encryption method, indeed, any simple cipher, is easily broken

A→N B→O C→P D→Q

M→Z …

27 The Art of Number Theory February 4, 2013

Page 28: The art of number theory v7b[1]

Public key encryption is completely different concept �  I tell you how to encrypt a message to

me

� You encrypt, and send the message to me

� Only I know how to decrypt

Me You Encryption key

Me You Encrypted message

Me You

Decrypt

A variation allows one to “sign” messages to prove authentication

28 The Art of Number Theory February 4, 2013

Page 29: The art of number theory v7b[1]

RSA Public Key encryption

� Uses number theory! � First, I need to tell you how to encrypt a

message I choose two prime numbers, p and q

Set N = p·q

Choose any E such that gcd(E, (p–1)·(q–1)) = 1

Me You N and E

I send you N and E

29 The Art of Number Theory February 4, 2013

Page 30: The art of number theory v7b[1]

Quick Aside

� Finding primes p and q is quick and easy � Uses a probabilistic algorithm � Works even if p and q involve hundreds of

digits

� Also, choosing an E is quick and easy

30 The Art of Number Theory February 4, 2013

Page 31: The art of number theory v7b[1]

RSA Public Key encryption

� Next, you encrypt the message � You have N and E

�  As does everyone else

Your message is m1, m2, m3, …

You compute ni ≡ miE mod N for each mi

You send me ni for each i

Converted to numbers

Me You ni

31 The Art of Number Theory February 4, 2013

Page 32: The art of number theory v7b[1]

Quick aside 2

� Computing xE mod N is easy and fast, by repeatedly squaring

32 The Art of Number Theory February 4, 2013

Page 33: The art of number theory v7b[1]

In order to decrypt, I need to use the algorithm to find inverses � Recall: � So I can use the continued fraction

algorithm to find D such that:

E satisfies gcd(E, (p–1)·(q–1)) = 1

ED ≡ 1 mod (p–1)·(q–1)

33 The Art of Number Theory February 4, 2013

Page 34: The art of number theory v7b[1]

And now I can decrypt the message

�  To decrypt: I compute

� Amazingly,

� But if someone else doesn’t know D, they can’t decrypt

niD mod N for each ni

mi ≡ niD mod N for each ni

34 The Art of Number Theory February 4, 2013

Page 35: The art of number theory v7b[1]

How to factor N

� Given N=p·q, find p and q �  I.e., factorization �  Believed to be “hard” �  But no one knows for sure

35 The Art of Number Theory February 4, 2013

Page 36: The art of number theory v7b[1]

So, the big outstanding question: How to factor large numbers that are a product of two primes?

� As of right now, there is no good way

� There is also no proof that it can’t be done

February 4, 2013 The Art of Number Theory 36

Page 37: The art of number theory v7b[1]

But if we had a quantum computer, there is a reasonably fast way

�  Based on Shor’s Algorithm �  A probabilistic algorithm, specifically for a

quantum computer �  Uses number theory:

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 37

1. Choose any a in UN (mod N)

2. Find r = o(a) mod N Smallest r such that ar ≡ 1 mod N

3. If r is odd, go back to 1, and try again

5. If it is 1, then try again (at step 1)

4. Compute gcd(ar/2 – 1, N), which be a divisor of N I.e., 1, p, or q

Page 38: The art of number theory v7b[1]

Quantum Computer role in breaking RSA � Powers of a form a periodic series:

� A quantum computer can quickly do an FFT

to find the period of a periodic series �  The periodic series can be held in log2N qubits

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 38

a, a2, a3, a4, a5, …, ar, a, a2, … ar, a, a2, …

Page 39: The art of number theory v7b[1]

Prognosis

� Bob’s opinion: �  Breakthrough’s are coming too fast to

believe there won’t be a practical quantum computer soon

� RSA will get broken, but some time later ○  Needs a lot of qubits ○  Needs control and a good programming ability

� Quantum computers will mostly be used to break RSA ○  And for quantum key distribution

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 39

Page 40: The art of number theory v7b[1]

Greater prognosis

� Can we get over math phobia?

� But maybe not today

February 4, 2013 The Art of Number Theory

Dr. Bob Hummel 40

Yes, I hope so. Enthusiastic, energetic teachers

Who encourage thinking deeply of simple things