1) Unbounded Minimalization 2) Bezout's Identity 3) Euclid's 1st Theorem 4) Fundamental Theorem of Arithmetic (Unique Factorization Theorem) 5) Pairing Functions 6) Class home page is at http://vkedco.blogspot.com/2011/08/theory-of-computation-home.html

Theory of Computation: Lecture 15Presentation Transcript

CS 5000: Theory of Computation Lecture 15 Vladimir Kulyukin Department of Computer Science Utah State Universitywww.youtube.com/vkedco www.vkedco.blogspot.com

Outline ● Review ● Unbounded Minimalization ● More Number Theory – Bezouts Identity – Euclids 1st Theorem – Fundamental Theorem of Arithmetic (Unique Factorization Theorem) ● Pairing Functionswww.youtube.com/vkedco www.vkedco.blogspot.com

Review: Well-Ordering Principle ● The well-ordering principle states that every non-empty set of natural numbers has a smallest element ● In axiomatic set theory, the set of natural numbers is defined as the set that contains 0 and is closed under the successor operation ● The set of natural numbers {n | {0, …, n} is well- ordered} contains all natural numberswww.youtube.com/vkedco www.vkedco.blogspot.com

Review: Euclid’s 2nd Theorem There are infinitely many primeswww.youtube.com/vkedco www.vkedco.blogspot.com

Review: Euclid’s 2nd Theorem (Formulation 1) Given a finite sequence of primes 2,3,5,..., pi , Ei = 2 ⋅ 3 ⋅ 5 ⋅ ... ⋅ pi + 1 is either a new prime or has a prime divisor greater than pi .www.youtube.com/vkedco www.vkedco.blogspot.com

Review: Euclid’s 2nd Theorem (Formulation 2) We set p 0 = 0 for the base case. Then we define pi to be the i - th prime. In other words, p1 = 2, p 2 = 3, p3 = 5, p 4 = 7,... Consider E = p n !+1. Then E is either a prime or is divisible by a prime greater than p n .www.youtube.com/vkedco www.vkedco.blogspot.com

Review: Lower and Upper Bounds for Next Prime pi +1 ∈ [ pi + 1, pi !+1], because the next prime after pi is greater than pi . Hence, pi + 1 for the lower bound. But it must divide pi !+1. Hence, pi !+1 for the upper bound.www.youtube.com/vkedco www.vkedco.blogspot.com

Review: Computing N-th Prime is P.R. 1. p 0 = 0 2. p n +1 = min [ Prime( t ) & t > p n ] t ≤ p n !+1www.youtube.com/vkedco www.vkedco.blogspot.com

Unbounded Minimalization Let P( x1 ,..., xn , t ) be a predicate. The unbounded minimalization of P( x1 ,..., xn , t ) is defined as g ( x1 ,..., xn ) = min P( x1 ,..., xn , y ) ywww.youtube.com/vkedco www.vkedco.blogspot.com

Theorem 7.2 (Ch. 3) If P( t , x1 ,..., xn ) is a computable predicate, then g ( x1 ,..., xn ) = min P( y, x1 ,..., xn ) is partially computable ywww.youtube.com/vkedco www.vkedco.blogspot.com

Proof [A1] IF P(X1, …, Xn, Y) GOTO E Y←Y+1 GOTO A1www.youtube.com/vkedco www.vkedco.blogspot.com

More Number Theorywww.youtube.com/vkedco www.vkedco.blogspot.com

Why Number Theory? ● Why do we study number theory in a computer science class? ● Because we are about to study Gödel numbers ● A Gödel numbering is a function that assigns to each statement of some formal language a unique natural number, called its Gödel number ● The concept was developed by Kurt Gödel, an Austrian logician, mathematician and philosopher in the 1930swww.youtube.com/vkedco www.vkedco.blogspot.com

Kurt Gödel (1906 - 1978)www.youtube.com/vkedco www.vkedco.blogspot.com

Why Number Theory? ● A computer scientist can view Gödel numbers as a formal theory of program compilation ● Modern compilers, viewed abstractly, do nothing but translate symbolic statements of high-level programming languages (formalisms) into binary numbers ● To understand Gödel numbers, we need some tools and concepts from number theory ● Our end objective is to compile L programs into natural numberswww.youtube.com/vkedco www.vkedco.blogspot.com

Bezout’s Identity If a and b are integers whose greatest common divisor is d , i.e., gcd( a,b ) = d , then there are integers x and y such that ax + by = d .www.youtube.com/vkedco www.vkedco.blogspot.com

Bezout’s Identity: Example gcd(12,42) = 6 12 x + 42 y = 6 x = 4, y = −1 12 ⋅ 4 + 42 ⋅ (−1) = 6 x = −3, y = 1 (−3) ⋅12 + 1 ⋅ 42 = 6www.youtube.com/vkedco www.vkedco.blogspot.com

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.www.youtube.com/vkedco www.vkedco.blogspot.com

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 Bwww.youtube.com/vkedco www.vkedco.blogspot.com

Euclid’s 1st Theorem: Proof Show that if p | ab, p is prime, then p | a or p | b. Assume that p | ab, p is prime, ¬( p | a ). Since p | ab, rp = ab, for some number r. Then gcd (p,a) = 1. By Bezout s Identity, there are integers x and y such that px + ay = 1. Now, b = b( px + ay ) = bpx + bay = bpx + rpy = p (bx + ry ). So p is a factor of b. We could have also assumed that ¬( p | b) and shown that p is a factor of a.www.youtube.com/vkedco www.vkedco.blogspot.com

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 Theoremwww.youtube.com/vkedco www.vkedco.blogspot.com

FTA: Key Insight 1200 = 2 ⋅ 3 ⋅ 54 2 Any divisor of 1200 is of the form 2 ⋅ 3 ⋅ 5 , where x y z x ∈ [0,4], y ∈ [0,1], z ∈ [0,2]www.youtube.com/vkedco www.vkedco.blogspot.com

FTA: Proof 1. 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 uniquewww.youtube.com/vkedco www.vkedco.blogspot.com

FTA: Proof (Part 1) 1. Suppose not every natural number greater than 1 has a prime factorization. 2. By the well - ordering principle, there must be the smallest such number. Call this number n. 3. n is not a prime, because, if it were, it would have itself as its factorization. 4. So n is a composite. 5. Since n is a composite, n = ab, where 1 < a < n and 1 < b < n. 6. Since a and b are positive numbers less than n and n is the smallest number that does not have a prime factorization, a and b both have prime factorizations. 7. But then n has a prime factorization that consists of the prime factorizations of a and b.www.youtube.com/vkedco www.vkedco.blogspot.com

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 itselfwww.youtube.com/vkedco www.vkedco.blogspot.com

FTA: Proof (Part 2) 1. Recall Euclid s 1st Theorem : if p is a prime and p|ab, then p|a or p|b. 2. Let n be a natural number greater than 1 that has two prime factorizations F1 and F2 . 3. n = F1 = p1...pn = F2 = q1...qm = n. 4. Take p1. p1|n. Thus, p1|q1...qm . 5. By Euclid s 1st Theorem, p1|q1 or p1|q2 ...qm . Since p1 is a prime, it must be the case that p1 = q1 or p1 = qi , 2 ≤ i ≤ m. Thus, p1 can be taken out of F1 and F2 by dividing them both by p1. 6. The same trick can be repeated for p2 , p3 , ..., pn . 7. But, since F1 = F2 , it must be the case that n = m and for 1 ≤ i, j ≤ n, pi = q j .www.youtube.com/vkedco www.vkedco.blogspot.com

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 in the position to map lists of numbers into single numbers and vice versa ● Remember that our end objective is to compile L programs into natural numberswww.youtube.com/vkedco www.vkedco.blogspot.com

Pairing Functions • x, y = 2 ( 2 y + 1) − 1 x • 2 ( 2 y + 1) − 1 ≥ 0 x x, y + 1 = 2 ( 2 y + 1) xwww.youtube.com/vkedco www.vkedco.blogspot.com

Equation 8.1 (Ch. 3) If z is a a natural number, there is a unique solution for x, y to the following equation : x, y = zwww.youtube.com/vkedco www.vkedco.blogspot.com

Equation 8.1 (Ch. 3) 1. x , y = z 2. x, y + 1 = 2 x (2 y + 1). 3. z + 1 = 2 x (2 y + 1). { } 4. x = max 2 | ( z + 1) . In other words, d d x is the largest number such that 2 x | ( z + 1). z +1 −1 z +1 x 5. 2 y + 1 = x ⇒ y = 2 2 2www.youtube.com/vkedco www.vkedco.blogspot.com

Equation 8.1 (Ch. 3) • Since x, y = z = 2 ( 2 y + 1) − 1, x x, y + 1 = z + 1 = 2 ( 2 y + 1). x Therefore, x < z + 1, y < z + 1. Hence, x ≤ z , y ≤ z.www.youtube.com/vkedco www.vkedco.blogspot.com

Full NameComment goes here.AJINKYATIPOLE88882 months ago