MATH 470 Lecture 4

From Notes
Jump to navigation Jump to search

« previous | Thursday, January 24, 2013 | next »


Motivation and Math History

How to calculate 217(mod7)?

  1. 4th grade . . .
  2. 8th grade: k = [0..]; remainders = repeat [1, 2, 4]; 217(mod7)=4 by the pattern (when does it repeat?)
  3. College:
    • 212(mod7)
    • 224(mod7)
    • 242(mod7)
    • 282(mod7)
    • 2164(mod7)
    • 2322(mod7)
    • 21721621224(mod7)
  4. Even faster! (secret: 261(mod7) )
    • 217=262+52626254(mod7)
    • How to find in general for mod n?

Order

Definition: For any prime p, x and px, the order of x in /p is the minimum positive integer k such that xk1(modp).

For example,

  • the order of 2 in /7 is 3: 231(mod7)
  • the order of 1 in /7 is 1: 111(mod7)
  • the order of 5 in /7 is 6: 561(mod7)


Fermat's Little Theorem

(See Fermat's Little Theorem→)


Given any prime p and any integer x,

xpx(modp)

This is often written as px, then

xp11(modp)
Note: p1 may not be the smallest integer k for xk1(modp).
  • 261(mod7)
  • 231(mod7)

Proof

Why is xp11(modp) when px?

Define modulo classes 1,2,,p1.

Multiply by x: x,2x,,(p1)x.

  • none are 0
  • No two are the same. (suppose not, then ixjx(modp)(ij)p — contradiction)
  • therefore, each will map uniquely to modulo classes

Take prouct of each group: i=1p1ii=1p1x(modp)(p1)!(p1)!x(modp)1x(modp)

We can divide by

(p1)!

since it is not a multiple of

p

.

Q.E.D.

Corollary 1

For any x such that px, the order of x is a factor of p1. Why?

Proof. If

p1=qk+r

and

0<r<k

, then

xr(modp)

— contradiction.

Q.E.D.

We know:

  • k is order in xk1(modp)
  • xp11(modp)

Corollary 2

If d and e are integers such that de1(modp1) and px, then xdex(modp).

Proof. Rewrite de1(modp1) as de=q(p1)+1.

xde=xq(p1)+1

By Fermat's little theorem, xq(p1)+1(xp1)2xx(modp)

Corollary 3

If GCD(d,p1)=1, then the function f:/p/p defined by f(x)=xd has inverse g(x)=xe.

Application Example

Written on board at beginning of class:

plaintext:  ITWASABOUTELEVENOCLOCKINTHEMORNING
ciphertext: MISGXGZFDILULOLGFEUFEPMJICLQFNJMJR


The code was build by p=29 with function f(x)=x3(mod29).

Correspondence

A B C D . . .  Z
2 3 4 5       27

We omit 0 and 1 since {0,1}3={0,1}. That's not very secure.

For example, we take the first letter 'I' with correspondence 10:

I10100014(mod29)M


How to break coding scheme (xx3(mod29)), we need to find "cubic root" mod 29.

Corollary 2 and 3 tell us that for d=3 and p=29, we need to find de1(mod28): e=19


Generalization

What about when we replace p by any integer n?

For example, "What is the last digit of 317?" is another way of asking "3^{17} \equiv \Box \pmod{10}"

Can we find a number k such that 3k1(mod10)? YES

For any integer n, we define (/n)* to be the set of all integers k in {1,2,,n1} with GCD(k,n)=1.

Examples:

  • n=5: (/5)*={1,2,3,4}
  • n=6: (/6)*={1,5}
  • n=9: (/9)*={1,2,4,5,7,8}
  • n=12: (/12)*={1,5,7,11}


Euler's Totient Function

Let ϕ(n)=number of integers in (/n)*

From previous examples,

  • ϕ(5)=4
  • ϕ(6)=2
  • ϕ(9)=6
  • ϕ(12)=4

In particular, ϕ(p)=p1

Computation

How to compute ϕ(n)?

Basic fact: ϕ(p)=p1

ϕ(pn)=pnpn1=pn1(p1)

since there are pn1 multiples of p between 0 and pn.

Properties: ϕ(mn)=ϕ(m)ϕ(n)

Take the product of the totients of the prime factorization of the number

Example

100=2252

ϕ(100)=ϕ(22)ϕ(52)=(2221)(5251)


Euler's Theorem

For any integers n, x such thta GCD(x,n)=1,

xϕ(n)1(modn)


Example

What are the last two digits of 34081? (34081(mod100))

Let n=100, then ϕ(100)=40.

Therefore 34081=(340)313(mod100)

And the last two digits are "03"