computability and complexity theory CSE P531 Instructor: Prof. James R. Lee Spring 2016 TA: Jeffrey Hon Course web page: http://www.cs.washington.edu/csep531 Sign up for the mailing list! Textbooks: Computational Complexity: A Modern Approach (Arora and Barak) Introduction to the Theory of Computation (Sipser) Evaluation and grading: 70% weekly homeworks, 30% class project Important note: Next Wednesday (April 6 th ), I will be in Germany.
course content Fundamentally, we ask the questions: What can a computer do? What can it do efficiently? What can’t it do? Why are compilers so bad at catching bugs? Why can’t they optimize my code better? Parallelize it? Why does proving theorems seem hard? Why can’t they solve chess? Go? Why does AI seem hard? Is there a mathematical basis for the “singularity”? Is there secure cryptography? Is it safe against quantum computers?
aliens who play chess Suppose an alien came to earth and claimed it could play perfect chess. Before admitting defeat as the inferior species, is there any way we could test his/her/its claim? Yes. In complexity theory, this is the theorem that IP = PSPACE . We wouldn’t need to spend billions of years playing against the alien over and over. Instead, we would engage in a short conversation about the sums of certain polynomials over a finite field.
proofs and computational problems The Riemann hypothesis (A conjecture about the zeros of the Riemann zeta function.) This is considered by some to be the most important unsolved problem in mathematics. ($1M Clay Math prize) 3D Bin Packing is NP-complete There is a finite set of (a billion, say) of rectangular boxes of different sizes such that if you knew how to pack these boxes into the trunk of your car, you would also know a proof of the Riemann hypothesis. (Indeed, proofs of the Riemann hypothesis with at most a million symbols are in 1-1 correspondence with ways to pack the boxes into your car.)
zero-knowledge proofs Suppose you manage to prove the Riemann Hypothesis. (Good work. This should get you at least a B+ in the course!) But you signed an NDA. Your company won’t let you publish it. Can you still win the $1M prize? Yes! There is a way to convince someone that you know a proof without revealing anything other than the fact that you proved it.
probabilistically checkable proofs Proof correct? Proof wrong? The verifier Then 99/100 times, says “I agree.” the verifier will say “Wait! I found a bug.” PCP Theorem: There is a way to write down the proof so that its validity can be checked by someone who picks 5 random words.
“Hello world.” First assignment for freshman CSE students: Write a Java program that prints “Hello world.” on the screen and then exits. Efficiency is not an issue. No partial credit. TA staff is annoyed: OK, let’s write an autograder script. If should take a Java program 𝑄 as input and - PASS if 𝑄 prints “Hello world.” and halts - FAIL otherwise Need to handle code like this: How would such a script work?
“Hello world.” First assignment for freshman CSE students: Write a Java program that prints “Hello world.” on the screen and then exits. Efficiency is not an issue. No partial credit. This seems mean: This program passes if and only if the Riemann Hypothesis is false. Writing this autograder seems like a nightmare.
“Hello world.” First assignment for freshman CSE students: Write a Java program that prints “Hello world.” on the screen and then exits. Efficiency is not an issue. No partial credit. Despite the simplicity of the assignment, there is NO PROGRAM that can grade it correctly. (We’ll prove it.)
cardinality What does it mean that two sets have the same size?
cardinality What does it mean that two sets have the same size?
cardinality Definition: Two sets 𝐵 and 𝐶 have the same cardinality if there is a one-to-one correspondence between the elements of 𝐵 and those of 𝐶 . More precisely, if there is a 1-1 and onto function 𝑔 ∶ 𝐵 → 𝐶 . 1 a 2 b c 3 d 4 5 e 6 f 𝐵 𝐶 The definition also makes sense for infinite sets!
cardinality Do the natural numbers and the even natural numbers have the same cardinality? Yes! 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 What’s the map 𝑔 ∶ ℕ → 2ℕ ? 𝑔 𝑜 = 2𝑜
countable sets Definition: A set is countably infinite iff it has the same cardinality as ℕ . A set is countable if it is finite or countably infinite. Equivalent: A set 𝑇 is countably infinite iff there is an 1-1 and onto function ∶ ℕ → 𝑇 Equivalent: A set 𝑇 is countably infinite iff we can order the elements 𝑇 = {𝑦 0 , 𝑦 1 , 𝑦 2 , 𝑦 3 , … } Question: If ∶ ℕ → 𝑇 is just onto , do we still know that 𝑇 is countably infinite?
the set ℤ of all integers
the set ℚ of rational numbers We can’t do the same thing we did for the integers. Between any two rational numbers there are an infinite number of others.
the set of positive rational numbers 1/1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 ... 2/1 2/2 2/3 2/4 2/5 2/6 2/7 2/8 ... 3/1 3/2 3/3 3/4 3/5 3/6 3/7 3/8 ... 4/1 4/2 4/3 4/4 4/5 4/6 4/7 4/8 ... 5/1 5/2 5/3 5/4 5/5 5/6 5/7 ... 6/1 6/2 6/3 6/4 6/5 6/6 ... 7/1 7/2 7/3 7/4 7/5 .... ... ... ... ... ...
the set of positive rational numbers The set of all positive rational numbers is countable. ℚ + = 1/1 , 2/1 , 1/2 , 3/1 , 2/2 , 1/3 , 4/1 , 2/3 , 3/2 , 1/4 , 5/1 , 4/2 , 3/3 , 2/4 , 1/5, … List elements in order of numerator+denominator, breaking ties according to denominator. Only 𝑙 numbers have total of sum of 𝑙 + 1 , so every positive rational number comes up some point. Technique is called “dovetailing.” Notice that repeats are OK because we can skip over them. Formal statement: A set 𝑇 is countable iff there is an onto map ∶ ℕ → 𝑇 .
the set ℚ of rational numbers
Claim: Σ ∗ is countable for every finite alphabet Σ
the set of all Java programs is countable
are the real numbers countable? Theorem [Cantor]: The set of real numbers between 0 and 1 is not countable. Proof will be by contradiction. Uses a new method called diagonalization .
real numbers between 0 and 1 : [0,1) Every number between 0 and 1 has an infinite decimal expansion: 1/2 = 0.50000000000000000000000... 1/3 = 0.33333333333333333333333... 1/7 = 0.14285714285714285714285... 𝜌 -3 = 0.14159265358979323846264... 1/5 = 0.19999999999999999999999... = 0.20000000000000000000000... Representation is unique except for the cases that the decimal expansion ends in all 0’s or all 9’s.
proof that [0,1) is uncountable Suppose, for the sake of contradiction, that there is a list of them: 1 2 3 4 5 6 7 8 9 ... r 1 0. 5 0 0 0 0 0 0 0 ... ... r 2 0. 3 3 3 3 3 3 3 3 ... ... r 3 0. 1 4 2 8 5 7 1 4 ... ... r 4 0. 1 4 1 5 9 2 6 5 ... ... r 5 0. 1 2 1 2 2 1 2 2 ... ... r 6 0. 2 5 0 0 0 0 0 0 ... ... r 7 0. 7 1 8 2 8 1 8 2 ... ... r 8 0. 6 1 8 0 3 3 9 4 ... ... ... .... ... .... .... ... ... ... ... ... ...
proof that [0,1) is uncountable Suppose, for the sake of contradiction, that there is a list of them: 1 2 3 4 5 6 7 8 9 ... r 1 0. 5 0 0 0 0 0 0 0 ... ... r 2 0. 3 3 3 3 3 3 3 3 ... ... r 3 0. 1 4 2 8 5 7 1 4 ... ... r 4 0. 1 4 1 5 9 2 6 5 ... ... r 5 0. 1 2 1 2 2 1 2 2 ... ... r 6 0. 2 5 0 0 0 0 0 0 ... ... r 7 0. 7 1 8 2 8 1 8 2 ... ... r 8 0. 6 1 8 0 3 3 9 4 ... ... ... .... ... .... .... ... ... ... ... ... ...
proof that [0,1) is uncountable Suppose, for the sake of contradiction, that there is a list of them: 1 2 3 4 5 6 7 8 9 ... Flipping rule: 1 r 1 0. 5 0 0 0 0 0 0 0 ... ... If digit is 5 , make it 1 . 5 If digit is not 5 , make it 5 . r 2 0. 3 3 3 3 3 3 3 3 ... ... 5 r 3 0. 1 4 2 8 5 7 1 4 ... ... 1 r 4 0. 1 4 1 5 9 2 6 5 ... ... 5 r 5 0. 1 2 1 2 2 1 2 2 ... ... 5 r 6 0. 2 5 0 0 0 0 0 0 ... ... 5 r 7 0. 7 1 8 2 8 1 8 2 ... ... 5 r 8 0. 6 1 8 0 3 3 9 4 ... ... ... .... ... .... .... ... ... ... ... ... ...
proof that [0,1) is uncountable Suppose, for the sake of contradiction, that there is a list of them: 1 2 3 4 5 6 7 8 9 ... Flipping rule: 1 r 1 0. 5 0 0 0 0 0 0 0 ... ... If digit is 5 , make it 1 . 5 If digit is not 5 , make it 5 . r 2 0. 3 3 3 3 3 3 3 3 ... ... 5 r 3 0. 1 4 2 8 5 7 1 4 ... ... 1 r 4 0. 1 4 1 5 9 2 6 5 ... ... 5 r 5 0. 1 2 1 2 2 1 2 2 ... ... 5 r 6 0. 2 5 0 0 0 0 0 0 ... ... 5 r 7 0. 7 1 8 2 8 1 8 2 ... ... 5 r 8 0. 6 1 8 0 3 3 9 4 ... ... If diagonal element is 0. 𝑦 11 𝑦 22 𝑦 33 𝑦 44 𝑦 55 ⋯ then let’s called the flipped number 0. ... .... ... .... .... ... ... ... ... ... ... 𝑦 11 𝑦 22 𝑦 33 𝑦 44 𝑦 55 ⋯ It cannot appear anywhere on the list!
Recommend
More recommend