Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization...

30
Theory of Computation Bezout's Identity, Euclid's 1 st Theorem, Unique Factorization Theorem, Pairing Functions Vladimir Kulyukin www.vkedco.blogspot.com www.vkedco.blogspot.com

Transcript of Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization...

Page 1: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Theory of Computation

Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Vladimir Kulyukin

www.vkedco.blogspot.comwww.vkedco.blogspot.com

Page 2: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Outline● Number Theory Concepts & Theorems

Bezout's Identity Euclid's 1st Theorem Fundamental Theorem of Arithmetic (Unique Factoriza-

tion Theorem)● Pairing Functions

Page 3: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Number Theory Concepts &

Theorems

Page 4: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Bezout’s Identity

.

such that and integers are then there

,gcd i.e., , isdivisor common

greatest whoseintegers are and If

dbyax

yx

da,bd

ba

Page 5: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Bezout’s Identity: Example

642112)3(

1,3

6)1(42412

1,4

64212

6)42,12gcd(

yx

yx

yx

Page 6: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Euclid’s 1st Theorem (Book VII of Euclid’s Elements)

If a prime divides the product of two integers, then the prime divides at least one of the two integers. Formally, if p|ab, then p|a or p|b, where p is a prime and a and b are integers.

Page 7: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Proof Technique Note 1

● Suppose we want to prove a statement: if A then B or C

● We assume A and not B and prove C ● In other words, if A and not B are true, then C must be

true, because otherwise, B or C cannot be true● We can also assume A and not C and prove B

Page 8: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Euclid’s 1st Theorem: Proof

. offactor a is that

shown and )|( that assumed also have could We

. offactor a is So

).()(

Now, .1such that and integers are there

Identity, sBezout'By .1gcdThen .number somefor

, ,| Since ).|( prime, is ,| that Assume

ap

bp

bp

rybxprpybpxbaybpxaypxbb

aypxyx

(p,a)r

abrpabpappabp

Page 9: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Fundamental Theorem of Arithmetic

Every positive integer greater than 1 is either a prime or can be written as a product of primes. The factorization is unique except for the order of factor primes.

This theorem is also known as Unique Factorization Theorem

Page 10: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

FTA: Examples

24

2

1111

3

5321200

3212

255210

22228

326

Page 11: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

FTA: Key Insight

].2,0[],1,0[],4,0[

where,532 form theof is 1200 ofdivisor

any that knowy immediatel Then we .5321200 that know

weexample,For number. that ofdivisor every of formula the

know wenumber, a ofion factorizat prime theknow weIf

24

zyx

zyx

Page 12: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

FTA: Proof Sketch

We need to prove 2 statements:1. Every natural number greater than 1 has a prime

factorization, i.e., can be written as a product of primes

2. The prime factorization is unique

Page 13: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

FTA: Proof (Part 1)

. and of ionsfactorizat

prime theof consistsion that factorizat prime a has But then 7.

ions.factorizat prime haveboth and

ion,factorizat prime a havenot doesat number thsmallest

theis and than less numbers positive are and Since 6.

.1 and 1 where, composite, a isn Since 5.

composite. a is So 4.

ion.factorizat its as itself have it would it were, if because, prime, anot is 3.

.number thisCall

number.such smallest thebemust thereprinciple, ordering- wellBy the 2.

ion.factorizat prime a has 1an greater thnumber naturalevery not Suppose 1.

ba

n

ba

nn ba

nb na abn

n

n

n

Page 14: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Proof Technique Note 2

● Suppose that we want to prove that some mathematical object A is unique

● A common way of doing this is to postulate the existence of another mathematical object B with A’s properties and then show that A and B are the same

● In other words, A is unique, because any other object that has the same properties is A itself

Page 15: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

FTA: Proof (Part 2)

.,,1for and that case thebemust it , since But, 7.

...., ,,for repeated becan trick same The 6.

.by both themdividingby

and ofout taken becan Thus, .2or that case the

bemust it prime, a is Since .or Theorem,1st sEuclid'By 5.

Thus, . that know We. Take 4.

3.

. and

ionsfactorizat prime twohas that 1an greater thnumber natural a be Let 2.

.or then , and prime a is if :Theorem1st sEuclid' Recall .1

21

32

12

11111

12111

1111

1211

21

ji

n

i

m

m

mn

qpnjimnFF

ppp

pF

Fpmi , qpqp

p...q|qp|qp

....q|qp|npp

n....qqF...ppFn

FF

n

p|bp|ap|abp

Page 16: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Pairing Functions

Page 17: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Pairing Functions

● Pairing functions are coding devices for mapping pairs of natural numbers into single natural numbers and vice versa

● Once we have pairing functions we will be able to map lists of numbers into single numbers and vice versa

● Mapping lists of numbers into a single number will give us a means to compile L programs into natural numbers

Page 18: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Pairing Functions

1221,

01122

1122,

yyx

y

yyx

x

x

x

Page 19: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Equation 8.1 (Ch. 3)

., tofor solution

unique a is therenumber, natural a a is If

zyxx, y

z

Page 20: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Equation 8.1 (Ch. 3)

2

12

1

2

112 .5

.1|2such that number largest theis s,other wordIn

.1z| 2max .4

).12(21z .3

).12(21, .2

, .1

x

x

x

d

d

x

x

z

yz

y

zx

x

y

yyx

zyx

Page 21: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Equation 8.1 (Ch. 3): Upper Bound for x & y

., Hence,

.1,1 Therefore,

.12211,

,1122, Since

zyzx

zyzx

yzyx

yzyxx

x

Page 22: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Example 1

.10111115225,0 :Check

.51112

011|2max

11122

10112210,

.10, Solve

0

yy

xx

y

yyx

yx

d

d

x

x

Page 23: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Example 2

.19120112222,2:Check

.251220122

220|2max

20122

191122,

.19, Solve

2

2

yyy

x

y

yyx

yx

d

d

x

x

Page 24: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Splitting Natural Numbers into

Left & Right Constituents

Page 25: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Equation 8.1 (Ch. 03)

.22,219;22,219

.55,010;05,010

:Examples

.,

.,

. , and :functions twodefines 8.1Equation

rrll

rrll

yyxrzr

xyxlzl

Nzzrzl

Page 26: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Lemma

recursive. primitive are and zrzl

Page 27: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Proof

. ,min)(

; ,min)(

Thus, .,,, then , If

yxzxzr

yxzyzl

zyzxyxzNz

zzy

zzx

Page 28: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Theorem 8.1 (Ch. 03)

zzrzzl

zzrzl

yyxrxyxl

zrzlx,y

, 4.

, 3.

,,, 2.

recursive primitive areThey 1.

:properties following thehave ,, functions The

Page 29: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Proof 8.1 (Ch. 03)

This theorem summarizes the properties of the pairing function and the splitting functions l(z) and r(z). Properties 2, 3, 4 follow from Equation 8.1. Property 1 follows from Equation 8.1 and the definitions for l(z) and r(z).

Page 30: Theory of Computation (Fall 2014): Bezout's Identity, Euclid's 1st Theorem, Unique Factorization Theorem, Pairing Functions

Reading Suggestions

● Ch. 03, Computability, Complexity, and Languages, 2nd Edition, by Davis, Sigal, Weyuker, Academic Press

● Great wiki article on Bezout's identity