BILL AND NATHAN RECORD LECTURE!!!!

158
BILL AND NATHAN RECORD LECTURE!!!! BILL AND NATHAN RECORD LECTURE!!!

Transcript of BILL AND NATHAN RECORD LECTURE!!!!

Page 1: BILL AND NATHAN RECORD LECTURE!!!!

BILL AND NATHAN RECORD LECTURE!!!!

BILL AND NATHAN RECORD LECTURE!!!

Page 2: BILL AND NATHAN RECORD LECTURE!!!!

UN-TIMED PART OFFINAL IS TUESDAY

May 11 11:00A.NO DEAD CAT

Page 3: BILL AND NATHAN RECORD LECTURE!!!!

FINAL IS THURSDAYMay 13

8:00PM-10:15PM

Page 4: BILL AND NATHAN RECORD LECTURE!!!!

FILL OUT COURSEEVALS for ALL YOUR

COURSES!!!

Page 5: BILL AND NATHAN RECORD LECTURE!!!!

Review for Final

Page 6: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 7: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 8: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 9: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 10: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 11: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 12: BILL AND NATHAN RECORD LECTURE!!!!

Rules1. Begin Final ON Gradescope: Tuesday May 13,

8:00PM-10:15PM. (IF this is a problem for you contact meASAP!!)

2. Resources Final is open-everything. The web, my notes, myHW solutions, all fine to use. Cannot ask any other human.Can talk to your cat. Honor System. I trust and respect you(how much do I respect you–see next slide).

3. Caveat You must hand in your own work and you mustunderstand what you hand in.

4. Warning Mindlessly copying does not work.

5. Neat LaTex is best. Good handwriting okay. Draw Aut, oruse LateX tool posted.

6. Our Intent This is exam I intended to give out originally.The extra time is meant for you to format and put in LaTeX.

7. Scope of the ExamShort Answer HWs and lectures.

Long Answer This Presentation.

Page 13: BILL AND NATHAN RECORD LECTURE!!!!

RESPECT

I RESPECT you as much as

we all RESPECT the hardness of proving lower bounds.

(Thats a lot!)

Page 14: BILL AND NATHAN RECORD LECTURE!!!!

RESPECT

I RESPECT you as much as

we all RESPECT the hardness of proving lower bounds.

(Thats a lot!)

Page 15: BILL AND NATHAN RECORD LECTURE!!!!

RESPECT

I RESPECT you as much as

we all RESPECT the hardness of proving lower bounds.

(Thats a lot!)

Page 16: BILL AND NATHAN RECORD LECTURE!!!!

Turing Machines

1. For this review we omit definitions and conventions.

2. There is a JAVA program for function f iff there is a TM thatcomputes f .

3. Everything computable can be done by a TM.

Page 17: BILL AND NATHAN RECORD LECTURE!!!!

Decidable Sets

Def A set A is DECIDABLE if there is a Turing Machine M suchthat

x ∈ A→ M(x) = Y

x /∈ A→ M(x) = N

Page 18: BILL AND NATHAN RECORD LECTURE!!!!

Terrible Def of DTIME

Def Let T (n) be a computable function (think increasing). A is inDTIME(T (n)) if there is a TM M that decides A and also, for allx , M(x) halts in time ≤ O(T (|x |)).Terrible Def since depends to much on machine model.

I Prove theorems about DTIME(T (n)) where the model doesnot matter. (Time hierarchy theorem–We did not do this)).

I Define time classes that are model-independent (P, NP stuff)

Page 19: BILL AND NATHAN RECORD LECTURE!!!!

P, NP, Reductions

Page 20: BILL AND NATHAN RECORD LECTURE!!!!

P and EXP

Def

1. P = DTIME(nO(1)).

2. EXP = DTIME(2nO(1)

).

3. PF is the set of functions that are computable in poly time.

Page 21: BILL AND NATHAN RECORD LECTURE!!!!

NP

Def A is in NP if there exists a set B ∈ P and a polynomial psuch that

A = {x | (∃y)[|y | = p(|x |) ∧ (x , y) ∈ B]}.

Intuition. Let A ∈ NP.

I If x ∈ A then there is a SHORT (poly in |x |) proof of thisfact, namely y , such that x can be VERIFIED in poly time.So if I wanted to convince you that x ∈ L, I could give you y .You can verify (x , y) ∈ B easily and be convinced.

I If x /∈ A then there is NO short verifiable proof that x ∈ A.

Page 22: BILL AND NATHAN RECORD LECTURE!!!!

NP

Def A is in NP if there exists a set B ∈ P and a polynomial psuch that

A = {x | (∃y)[|y | = p(|x |) ∧ (x , y) ∈ B]}.

Intuition. Let A ∈ NP.

I If x ∈ A then there is a SHORT (poly in |x |) proof of thisfact, namely y , such that x can be VERIFIED in poly time.So if I wanted to convince you that x ∈ L, I could give you y .You can verify (x , y) ∈ B easily and be convinced.

I If x /∈ A then there is NO short verifiable proof that x ∈ A.

Page 23: BILL AND NATHAN RECORD LECTURE!!!!

NP

Def A is in NP if there exists a set B ∈ P and a polynomial psuch that

A = {x | (∃y)[|y | = p(|x |) ∧ (x , y) ∈ B]}.

Intuition. Let A ∈ NP.

I If x ∈ A then there is a SHORT (poly in |x |) proof of thisfact, namely y , such that x can be VERIFIED in poly time.So if I wanted to convince you that x ∈ L, I could give you y .You can verify (x , y) ∈ B easily and be convinced.

I If x /∈ A then there is NO short verifiable proof that x ∈ A.

Page 24: BILL AND NATHAN RECORD LECTURE!!!!

NP

Def A is in NP if there exists a set B ∈ P and a polynomial psuch that

A = {x | (∃y)[|y | = p(|x |) ∧ (x , y) ∈ B]}.

Intuition. Let A ∈ NP.

I If x ∈ A then there is a SHORT (poly in |x |) proof of thisfact, namely y , such that x can be VERIFIED in poly time.So if I wanted to convince you that x ∈ L, I could give you y .You can verify (x , y) ∈ B easily and be convinced.

I If x /∈ A then there is NO short verifiable proof that x ∈ A.

Page 25: BILL AND NATHAN RECORD LECTURE!!!!

Examples of Sets in NP

SAT = {φ : (∃~y)[φ(~y) = T ]}

3COL = {G : G is 3-colorable }

CLIQ = {(G , k) : G has a clique of size k}

HAM = {G : G has a Hamiltonian Cycle}

EUL = {G : G has an Eulerian Cycle}

Note These all ask if something EXISTS. To FIND the (say)3-coloring one can make queries to (say) 3COL.Note EUL ∈ P. The rest are NPC hence likely NOT in P.

Page 26: BILL AND NATHAN RECORD LECTURE!!!!

Reductions

Def Let X ,Y be languages. A reduction from X to Y is apolynomial-time computable function f such that

x ∈ X iff f (x) ∈ Y .

We express this by writing X ≤ Y .

Reductions are transitive.Easy Lemma If X ≤ Y and Y ∈ P then X ∈ P.

Contrapositive If X ≤ Y and X /∈ P then Y /∈ P.

Page 27: BILL AND NATHAN RECORD LECTURE!!!!

Reductions

Def Let X ,Y be languages. A reduction from X to Y is apolynomial-time computable function f such that

x ∈ X iff f (x) ∈ Y .

We express this by writing X ≤ Y .

Reductions are transitive.Easy Lemma If X ≤ Y and Y ∈ P then X ∈ P.

Contrapositive If X ≤ Y and X /∈ P then Y /∈ P.

Page 28: BILL AND NATHAN RECORD LECTURE!!!!

Reductions

Def Let X ,Y be languages. A reduction from X to Y is apolynomial-time computable function f such that

x ∈ X iff f (x) ∈ Y .

We express this by writing X ≤ Y .

Reductions are transitive.Easy Lemma If X ≤ Y and Y ∈ P then X ∈ P.

Contrapositive If X ≤ Y and X /∈ P then Y /∈ P.

Page 29: BILL AND NATHAN RECORD LECTURE!!!!

Def of NP-Complete

Def A language Y is NP-complete

I Y ∈ NP

I If X ∈ NP then X ≤ Y .

Easy Lemma If Y is NP-complete and Y ∈ P then P = NP.

Page 30: BILL AND NATHAN RECORD LECTURE!!!!

Def of NP-Complete

Def A language Y is NP-complete

I Y ∈ NP

I If X ∈ NP then X ≤ Y .

Easy Lemma If Y is NP-complete and Y ∈ P then P = NP.

Page 31: BILL AND NATHAN RECORD LECTURE!!!!

SAT is NP-Complete

In 1971 Stephen Cook and Leonid Levin Independently showed:CNF-SAT is NP-complete

Thoughts on this:

1. We did this proof. It involved looking at 1-tape, 1-head,Turing Machines. It had to since SAT was the the firstNP-complete problem. You could not use some other problem.

2. Once we have SAT is NP-complete we NEVER used TMsagain. To show Y NP-complete: (1) Y ∈ NP, (2) SAT ≤ Y .Might use some other known NPC problem rather than SAT.

3. Thousands of problems are NP-complete. If any are in P thenthey are all in P.

Page 32: BILL AND NATHAN RECORD LECTURE!!!!

SAT is NP-Complete

In 1971 Stephen Cook and Leonid Levin Independently showed:CNF-SAT is NP-complete

Thoughts on this:

1. We did this proof. It involved looking at 1-tape, 1-head,Turing Machines. It had to since SAT was the the firstNP-complete problem. You could not use some other problem.

2. Once we have SAT is NP-complete we NEVER used TMsagain. To show Y NP-complete: (1) Y ∈ NP, (2) SAT ≤ Y .Might use some other known NPC problem rather than SAT.

3. Thousands of problems are NP-complete. If any are in P thenthey are all in P.

Page 33: BILL AND NATHAN RECORD LECTURE!!!!

SAT is NP-Complete

In 1971 Stephen Cook and Leonid Levin Independently showed:CNF-SAT is NP-complete

Thoughts on this:

1. We did this proof. It involved looking at 1-tape, 1-head,Turing Machines. It had to since SAT was the the firstNP-complete problem. You could not use some other problem.

2. Once we have SAT is NP-complete we NEVER used TMsagain. To show Y NP-complete: (1) Y ∈ NP, (2) SAT ≤ Y .Might use some other known NPC problem rather than SAT.

3. Thousands of problems are NP-complete. If any are in P thenthey are all in P.

Page 34: BILL AND NATHAN RECORD LECTURE!!!!

SAT is NP-Complete

In 1971 Stephen Cook and Leonid Levin Independently showed:CNF-SAT is NP-complete

Thoughts on this:

1. We did this proof. It involved looking at 1-tape, 1-head,Turing Machines. It had to since SAT was the the firstNP-complete problem. You could not use some other problem.

2. Once we have SAT is NP-complete we NEVER used TMsagain. To show Y NP-complete: (1) Y ∈ NP, (2) SAT ≤ Y .Might use some other known NPC problem rather than SAT.

3. Thousands of problems are NP-complete. If any are in P thenthey are all in P.

Page 35: BILL AND NATHAN RECORD LECTURE!!!!

SAT is NP-Complete

In 1971 Stephen Cook and Leonid Levin Independently showed:CNF-SAT is NP-complete

Thoughts on this:

1. We did this proof. It involved looking at 1-tape, 1-head,Turing Machines. It had to since SAT was the the firstNP-complete problem. You could not use some other problem.

2. Once we have SAT is NP-complete we NEVER used TMsagain. To show Y NP-complete: (1) Y ∈ NP, (2) SAT ≤ Y .Might use some other known NPC problem rather than SAT.

3. Thousands of problems are NP-complete. If any are in P thenthey are all in P.

Page 36: BILL AND NATHAN RECORD LECTURE!!!!

The Cook-Levin Thm

Page 37: BILL AND NATHAN RECORD LECTURE!!!!

What does the Proof Involve

Proof involved coding a TM into a Boolean Formula which hadparts:

1. zi ,j ,σ = T iff the jth symbol in the ith configuration is σ.

2. First config: input x , start state, SOME y of the right length.

3. Last config: accepts

4. Ci+1 follows from Ci .

Page 38: BILL AND NATHAN RECORD LECTURE!!!!

Closure of P

Page 39: BILL AND NATHAN RECORD LECTURE!!!!

Easy Closure Properties of P

Assume L1, L2 ∈ P.

1. L1 ∪ L2 ∈ P. EASY. Uses polys closed under addition.

2. L1 ∩ L2 ∈ P. EASY. Uses polys closed under addition.

3. L1 ∈ P. EASY.

4. L1L2 ∈ P. EASY. Uses p(n) poly then np(n) poly.

Page 40: BILL AND NATHAN RECORD LECTURE!!!!

Closure of P Under *

Thm If L ∈ P then L∗ ∈ P.ProofFirst lets talk about what you should not do:The technique of looking at all ways to break up x into piecestakes roughly 2n steps, so we need to do something clever.

Page 41: BILL AND NATHAN RECORD LECTURE!!!!

Dyn Prog

Dynamic Programming We solve a harder problem but get lotsof information in the process.

Original Problem Given x = x1 · · · xn want to know if x ∈ L∗

New Problem Given x = x1 · · · xn want to know:e ∈ L∗

x1 ∈ L∗

x1x2 ∈ L∗...x1x2 · · · xn ∈ L∗.Intuition x1 · · · xi ∈ L∗ IFF it can be broken into TWO pieces, thefirst one in L∗, and the second in L.

Page 42: BILL AND NATHAN RECORD LECTURE!!!!

Dyn Prog

Dynamic Programming We solve a harder problem but get lotsof information in the process.Original Problem Given x = x1 · · · xn want to know if x ∈ L∗

New Problem Given x = x1 · · · xn want to know:e ∈ L∗

x1 ∈ L∗

x1x2 ∈ L∗...x1x2 · · · xn ∈ L∗.Intuition x1 · · · xi ∈ L∗ IFF it can be broken into TWO pieces, thefirst one in L∗, and the second in L.

Page 43: BILL AND NATHAN RECORD LECTURE!!!!

Dyn Prog

Dynamic Programming We solve a harder problem but get lotsof information in the process.Original Problem Given x = x1 · · · xn want to know if x ∈ L∗

New Problem Given x = x1 · · · xn want to know:e ∈ L∗

x1 ∈ L∗

x1x2 ∈ L∗...x1x2 · · · xn ∈ L∗.Intuition x1 · · · xi ∈ L∗ IFF it can be broken into TWO pieces, thefirst one in L∗, and the second in L.

Page 44: BILL AND NATHAN RECORD LECTURE!!!!

Final Algorithm

A[i ] stores if x1 · · · xi is in L∗. M is poly-time Alg for L, poly p.

Input x = x1 · · · xnA[1] = A[2] = ... = A[n] = FALSEA[0] = TRUEfor i = 1 to n do

for j = 0 to i − 1 doif A[j ] AND M(xj+1 · · · xi ) = Y then A[i ] = TRUE

output A[n]

O(n2) calls to M on inputs of length ≤ n. Runtime ≤ O(n2p(n)).Note Key is that the set of polynomials is closed under mult byn2.

Page 45: BILL AND NATHAN RECORD LECTURE!!!!

Final Algorithm

A[i ] stores if x1 · · · xi is in L∗. M is poly-time Alg for L, poly p.

Input x = x1 · · · xnA[1] = A[2] = ... = A[n] = FALSEA[0] = TRUEfor i = 1 to n do

for j = 0 to i − 1 doif A[j ] AND M(xj+1 · · · xi ) = Y then A[i ] = TRUE

output A[n]

O(n2) calls to M on inputs of length ≤ n. Runtime ≤ O(n2p(n)).Note Key is that the set of polynomials is closed under mult byn2.

Page 46: BILL AND NATHAN RECORD LECTURE!!!!

Final Algorithm

A[i ] stores if x1 · · · xi is in L∗. M is poly-time Alg for L, poly p.

Input x = x1 · · · xnA[1] = A[2] = ... = A[n] = FALSEA[0] = TRUEfor i = 1 to n do

for j = 0 to i − 1 doif A[j ] AND M(xj+1 · · · xi ) = Y then A[i ] = TRUE

output A[n]

O(n2) calls to M on inputs of length ≤ n. Runtime ≤ O(n2p(n)).

Note Key is that the set of polynomials is closed under mult byn2.

Page 47: BILL AND NATHAN RECORD LECTURE!!!!

Final Algorithm

A[i ] stores if x1 · · · xi is in L∗. M is poly-time Alg for L, poly p.

Input x = x1 · · · xnA[1] = A[2] = ... = A[n] = FALSEA[0] = TRUEfor i = 1 to n do

for j = 0 to i − 1 doif A[j ] AND M(xj+1 · · · xi ) = Y then A[i ] = TRUE

output A[n]

O(n2) calls to M on inputs of length ≤ n. Runtime ≤ O(n2p(n)).Note Key is that the set of polynomials is closed under mult byn2.

Page 48: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP

Page 49: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Union

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∪ L2 ∈ NP.

L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1 ∪ L2 in an NP-way.L1 ∪ L2 = {x : (∃y):

I |y | = p1(|x |) + p2(|x |) + 1. y = y1$y2 where |y1| = p1(|x |)and |y2| = p2(|X |).

I (x , y1) ∈ B1 ∨ (x , y2) ∈ B2)

Witness: |y | = p1(|x |) + p2(|x |) + 1 is short.Verification: (x , y1) ∈ B1 ∨ (x , y2) ∈ B2), is quick.

Page 50: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Union

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∪ L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1 ∪ L2 in an NP-way.L1 ∪ L2 = {x : (∃y):

I |y | = p1(|x |) + p2(|x |) + 1. y = y1$y2 where |y1| = p1(|x |)and |y2| = p2(|X |).

I (x , y1) ∈ B1 ∨ (x , y2) ∈ B2)

Witness: |y | = p1(|x |) + p2(|x |) + 1 is short.Verification: (x , y1) ∈ B1 ∨ (x , y2) ∈ B2), is quick.

Page 51: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Union

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∪ L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1 ∪ L2 in an NP-way.L1 ∪ L2 = {x : (∃y):

I |y | = p1(|x |) + p2(|x |) + 1. y = y1$y2 where |y1| = p1(|x |)and |y2| = p2(|X |).

I (x , y1) ∈ B1 ∨ (x , y2) ∈ B2)

Witness: |y | = p1(|x |) + p2(|x |) + 1 is short.Verification: (x , y1) ∈ B1 ∨ (x , y2) ∈ B2), is quick.

Page 52: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Union

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∪ L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1 ∪ L2 in an NP-way.L1 ∪ L2 = {x : (∃y):

I |y | = p1(|x |) + p2(|x |) + 1. y = y1$y2 where |y1| = p1(|x |)and |y2| = p2(|X |).

I (x , y1) ∈ B1 ∨ (x , y2) ∈ B2)

Witness: |y | = p1(|x |) + p2(|x |) + 1 is short.

Verification: (x , y1) ∈ B1 ∨ (x , y2) ∈ B2), is quick.

Page 53: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Union

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∪ L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1 ∪ L2 in an NP-way.L1 ∪ L2 = {x : (∃y):

I |y | = p1(|x |) + p2(|x |) + 1. y = y1$y2 where |y1| = p1(|x |)and |y2| = p2(|X |).

I (x , y1) ∈ B1 ∨ (x , y2) ∈ B2)

Witness: |y | = p1(|x |) + p2(|x |) + 1 is short.Verification: (x , y1) ∈ B1 ∨ (x , y2) ∈ B2), is quick.

Page 54: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Intersection

Thm If L1 ∈ NP and L2 ∈ NP then L1 ∩ L2 ∈ NP.

Proof is similar to closure under ∪.

Page 55: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Concatenation

Thm If L1 ∈ NP and L2 ∈ NP then L1L2 ∈ NP.

L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1L2 in an NP-way.

{x : (∃x1, x2, y1, y2)

I x = x1x2I |y1| = p1(|x1|)I |y2| = p2(|x2|)I (x1, y1) ∈ B1

I (x2, y2) ∈ B2

Page 56: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Concatenation

Thm If L1 ∈ NP and L2 ∈ NP then L1L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1L2 in an NP-way.

{x : (∃x1, x2, y1, y2)

I x = x1x2I |y1| = p1(|x1|)I |y2| = p2(|x2|)I (x1, y1) ∈ B1

I (x2, y2) ∈ B2

Page 57: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under Concatenation

Thm If L1 ∈ NP and L2 ∈ NP then L1L2 ∈ NP.L1 = {x : (∃y1)[|y1| = p1(|x |) ∧ (x , y1) ∈ B1]L2 = {x : (∃y2)[|y2| = p2(|x |) ∧ (x , y2) ∈ B2]

The following defines L1L2 in an NP-way.

{x : (∃x1, x2, y1, y2)

I x = x1x2I |y1| = p1(|x1|)I |y2| = p2(|x2|)I (x1, y1) ∈ B1

I (x2, y2) ∈ B2

Page 58: BILL AND NATHAN RECORD LECTURE!!!!

Closure of NP under *

Thm If L ∈ NP then L∗ ∈ NP.

Similar to the Closure of NP under CONCAT.

Much easier than the proof that P is closed under *.

Page 59: BILL AND NATHAN RECORD LECTURE!!!!

Is NP closed under Complementation?

Unknown to Science!But the common opinion is NO.

Unlikely that there is a short poly-verifiable witness to G NOTbeing 3-colorable.

Page 60: BILL AND NATHAN RECORD LECTURE!!!!

Is NP closed under Complementation?

Unknown to Science!But the common opinion is NO.Unlikely that there is a short poly-verifiable witness to G NOTbeing 3-colorable.

Page 61: BILL AND NATHAN RECORD LECTURE!!!!

IND SET is NP-Complete, 3COL is NP-Complete

GOTO the slides from Stanford

Page 62: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

SAT-solvers are so good that people now use reductions to mapproblem TO SAT.

We do a reduction of CLIQ to SAT.

Does G have a clique of size k?

We rephrase that:

Let G = (V ,E ).

G has a clique of size k is EQUIVALENT TO:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

Page 63: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

SAT-solvers are so good that people now use reductions to mapproblem TO SAT.

We do a reduction of CLIQ to SAT.

Does G have a clique of size k?

We rephrase that:

Let G = (V ,E ).

G has a clique of size k is EQUIVALENT TO:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

Page 64: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

SAT-solvers are so good that people now use reductions to mapproblem TO SAT.

We do a reduction of CLIQ to SAT.

Does G have a clique of size k?

We rephrase that:

Let G = (V ,E ).

G has a clique of size k is EQUIVALENT TO:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

Page 65: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

SAT-solvers are so good that people now use reductions to mapproblem TO SAT.

We do a reduction of CLIQ to SAT.

Does G have a clique of size k?

We rephrase that:

Let G = (V ,E ).

G has a clique of size k is EQUIVALENT TO:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

Page 66: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

Given G and k We want to know:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

We formulate this as a Boolean Formula:

1. For 1 ≤ i ≤ k , 1 ≤ j ≤ n, have Boolean Vars xij . Intent:

xij =

{T if vertex i maps to vertex j

F if vertex i does not maps to vertex j(1)

2. Part of formula says xij is a bijection.

3. Part of formula says that the k points map to a clique.

Page 67: BILL AND NATHAN RECORD LECTURE!!!!

CLIQ ≤ SAT

Given G and k We want to know:There is a 1-1 function {1, . . . , k} → V such that for all1 ≤ a, b ≤ k , (f (a), f (b)) ∈ E .

We formulate this as a Boolean Formula:

1. For 1 ≤ i ≤ k , 1 ≤ j ≤ n, have Boolean Vars xij . Intent:

xij =

{T if vertex i maps to vertex j

F if vertex i does not maps to vertex j(1)

2. Part of formula says xij is a bijection.

3. Part of formula says that the k points map to a clique.

Page 68: BILL AND NATHAN RECORD LECTURE!!!!

Decidability and Undecidability

Page 69: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 70: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 71: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 72: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 73: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 74: BILL AND NATHAN RECORD LECTURE!!!!

Recall Turing Machines

1. TM’s are Java Programs.

2. We have a listing of them M1,M2, . . ..

3. If you run Me(d) it might not halt.

4. Everything computable is computable by some TM.

5. A TM that halts on all inputs is called total .

Page 75: BILL AND NATHAN RECORD LECTURE!!!!

Computable Sets

Def A set A is computable if there exists a Turing Machine Mthat behaves as follows:

M(x) =

{Y if x ∈ A

N if x /∈ A(2)

Computable sets are also called decidable or solvable. A machinesuch as M above is said to decide A.

Notation DEC is the set of Decidable Sets.

Page 76: BILL AND NATHAN RECORD LECTURE!!!!

Computable Sets

Def A set A is computable if there exists a Turing Machine Mthat behaves as follows:

M(x) =

{Y if x ∈ A

N if x /∈ A(2)

Computable sets are also called decidable or solvable. A machinesuch as M above is said to decide A.

Notation DEC is the set of Decidable Sets.

Page 77: BILL AND NATHAN RECORD LECTURE!!!!

Computable Sets

Def A set A is computable if there exists a Turing Machine Mthat behaves as follows:

M(x) =

{Y if x ∈ A

N if x /∈ A(2)

Computable sets are also called decidable or solvable. A machinesuch as M above is said to decide A.

Notation DEC is the set of Decidable Sets.

Page 78: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 79: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.

Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 80: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.

Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 81: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.

Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 82: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.

Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 83: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .

Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 84: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 85: BILL AND NATHAN RECORD LECTURE!!!!

Notation

Notation Me,s(d) is the result of running Me(d) for s steps.Me(d) ↓ means Me(d) halts.Me(d) ↑ means Me(d) does not halts.Me,s(d) ↓ means Me(d) halts within s steps.Me,s(d) ↓= z means Me(d) halts within s steps and outputs z .Me,s(d) ↑ means Me(d) has not halted within s steps.

Page 86: BILL AND NATHAN RECORD LECTURE!!!!

Noncomputable Sets

Are there any noncomputable sets?

1. Yes—ALL SETS: uncountable. DEC Sets: countable, hencethere exists an uncountable number of noncomputable sets.

2. YES—HALT is undecidable, and once you have that you havemany other sets undec.

3. YES—the problem of telling if a p ∈ Z[x1, . . . , xn] has an intsolution is undecidable.

Page 87: BILL AND NATHAN RECORD LECTURE!!!!

The HALTING Problem

Def The HALTING set is the set

HALT = {(e, d) | Me(d) halts }.

Page 88: BILL AND NATHAN RECORD LECTURE!!!!

HALT is Undecidable

Thm HALT is not computable.Proof Assume HALT computable via TM M.

M(e, d) =

{Y if Me(d) ↓N if Me(d) ↑

(3)

We use M to create the following machine which is Me .

1. Input d

2. Run M(d , d)

3. If M(d , d) = Y then RUN FOREVER.

4. If M(d , d) = N then HALT.

Me(e) ↓ =⇒ M(e, e) = Y =⇒ Me(e) ↑Me(e) ↑ =⇒ M(e, e) = N =⇒ Me(e) ↓We now have that Me(e) cannot ↓ and cannot ↑. Contradiction.

Page 89: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 90: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 91: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}

{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 92: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}

{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 93: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }

TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 94: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}

Proofs by reductions. Similar to NPC. We will not do that.

Page 95: BILL AND NATHAN RECORD LECTURE!!!!

Other Undecidable Problems

Using that HALT is undecidable we can prove the followingundecidable:

{e : Me halts on at least 12 numbers } (at most ,exactly )

{e : Me halts on an infinite number of numbers}{e : Me halts on a finite number of numbers}{e : Me does the Hokey Pokey and turns itself around }TOT = {e : Me halts on all inputs}Proofs by reductions. Similar to NPC. We will not do that.

Page 96: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable.

How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 97: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable?

Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 98: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 99: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 100: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 101: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 102: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 103: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 104: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something?

YES- NP.

Page 105: BILL AND NATHAN RECORD LECTURE!!!!

Σ1 Sets

HALT is undecidable. How undecidable? Measure with quants:

HALT = {(e, d) : (∃s)[Me,s(d) ↓]}

Let

B = {(e, d , s) : Me,s(d) ↓}

B is decidable and

HALT = {(e, d) : (∃s)[(e, d , s) ∈ B]}

B is decidable. This inspires the following definition.

Def A ∈ Σ1 if there exists decidable B such that

A = {x : (∃y)[(x , y) ∈ B]}

Does this definition remind you of something? YES- NP.

Page 106: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

A ∈ NP if there exists B ∈ P and poly p such that

A = {x : (∃y , |y | ≤ p(|x |))[(x , y) ∈ B]}

A ∈ Σ1 if there exists B ∈ DEC such that

A = {x : (∃y)[(x , y) ∈ B]}

Page 107: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

A ∈ NP if there exists B ∈ P and poly p such that

A = {x : (∃y , |y | ≤ p(|x |))[(x , y) ∈ B]}

A ∈ Σ1 if there exists B ∈ DEC such that

A = {x : (∃y)[(x , y) ∈ B]}

Page 108: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 109: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 110: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 111: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 112: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 113: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory?

Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 114: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent.

My thesis was on showingsome of those limits.

Page 115: BILL AND NATHAN RECORD LECTURE!!!!

Compare NP to Σ1

1. Both use a quantifier and then something easy. So the setsare difficult because of the quantifier.

2. 2.1 For NP easy means P and the quantifier is over an exp sizeset.

2.2 For Σ1 easy means DEC and the quantifier is over N.

3. Σ1 came first by several decades. Complexity theory borrowedideas from Computability theory for the basic definitions.

4. Are ideas from Computability theory useful in complexitytheory? Yes, to a limited extent. My thesis was on showingsome of those limits.

Page 116: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 117: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.

A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 118: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.

A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 119: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 120: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 121: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 122: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·

TOT is harder than HALT.

Page 123: BILL AND NATHAN RECORD LECTURE!!!!

Beyond Σ1

Def B is always a decidable set.

A ∈ Π1 if A = {x : (∀y)[(x , y) ∈ B]}.A ∈ Σ2 if A = {x : (∃y1)(∀y2)[(x , y1, y2) ∈ B]}.A ∈ Π2 if A = {x : (∀y1)(∃y2)[(x , y1, y2) ∈ B]}....

TOT = {x : (∀y)(∃s)[Mx ,s(y) ↓]} ∈ Π2.

Known: TOT /∈ Σ1 ∪ Π1.

Known:Σ1 ⊂ Σ2 ⊂ Σ3 · · ·Π1 ⊂ Π2 ⊂ Π3 · · ·TOT is harder than HALT.

Page 124: BILL AND NATHAN RECORD LECTURE!!!!

WS1S Formulas and Sentences

1. Variables x , y , z range over N, X ,Y ,Z range over finitesubsets of N.

2. Symbols: <, ∈ (usual meaning), S (meaning S(x) = x + 1).

3. A Formula allows variables to not be quantified over. AFormula is neither true or false. Example: (∃x)[x + y = 7].

4. A Sentence has all variables quantified over. Example:(∀y)(∃x)[x + y = 7]. So a Sentence is either true or false IFdomain is

WS1S: Weak Second order Theory of One Successor. WeakSecond order means quantify over finite sets.

Page 125: BILL AND NATHAN RECORD LECTURE!!!!

Atomic Formulas

An Atomic Formula is:

1. For any c ∈ N, x = y + c is an Atomic Formula.

2. For any c ∈ N, x < y + c is an Atomic Formula.

3. For any c, d ∈ N, x ≡ y + c (mod d) is an Atomic Formula.

4. For any c ∈ N, x + c ∈ X is an Atomic Formula.

5. For any c ∈ N, X = Y + c is an Atomic Formula.

Page 126: BILL AND NATHAN RECORD LECTURE!!!!

WS1S Formulas

Build up formulas from atomic formulas using ∧, ∨, ¬, ∃, ∀.Hence can define the set of formulas.

Can put formulas into Prenex Normal Form :

(Q1v1)(Q2v2) · · · (Qnvm)[φ(v1, . . . , vn)]

Def If φ(x1, . . . , xn,X1, . . . ,Xm) is a WS1S Formula thenTRUE (φ) is the set

{(a1, . . . , an,A1, . . . ,Am) | φ(a1, . . . , an,A1, . . . ,Am) = T}

This is the set of (x1, . . . , xn,X1, . . . ,Xm) that make φ TRUE.

Page 127: BILL AND NATHAN RECORD LECTURE!!!!

KEY THEOREM

Thm For all WS1S formulas φ the set TRUEφ is regular.

Need to clarify representation and the define stupid states to makeall of this work.

We prove this by induction on the formation of a formula. If youprefer- induction on the LENGTH of a formula.

Page 128: BILL AND NATHAN RECORD LECTURE!!!!

KEY THEOREM

Thm For all WS1S formulas φ the set TRUEφ is regular.

Need to clarify representation and the define stupid states to makeall of this work.

We prove this by induction on the formation of a formula. If youprefer- induction on the LENGTH of a formula.

Page 129: BILL AND NATHAN RECORD LECTURE!!!!

KEY THEOREM

Thm For all WS1S formulas φ the set TRUEφ is regular.

Need to clarify representation and the define stupid states to makeall of this work.

We prove this by induction on the formation of a formula. If youprefer- induction on the LENGTH of a formula.

Page 130: BILL AND NATHAN RECORD LECTURE!!!!

DECIDABILITY OF WS1S

Thm: WS1S is Decidable.Proof:

1. Given a SENTENCE in WS1S put it into the form

(Q1X1) · · · (QnXn)(Qn+1x1) · · · (Qn+mxm)[φ(x1, . . . , xm,X1, . . . ,Xn)]

2. Assume Q1 = ∃. (If not then negate and negate answer.)

3. View as (∃X )[φ(X )], a FORMULA with ONE free var.

4. Construct DFA M for {X | φ(X ) is true}.5. Test if L(M) = ∅.6. If L(M) 6= ∅ then (∃X )[φ(X )] is TRUE.

If L(M) = ∅ then (∃X )[φ(X )] is FALSE.

Page 131: BILL AND NATHAN RECORD LECTURE!!!!

Interesting Points about WS1S

1. Our algorithm has worst case 22···n

time.

2. There is a better algorithm: 22n3 log n

time. Provable that(roughly) can’t do better than that.

3. S1S is proven decidable using ω-regular. WS2S is provendecidable using Tree-Aut. S2S is proven decidable usingω-Tree-Automata. All the proofs use same structure as ours:the Truth sets are BLAH-regular and can test non-emptynessof BLAH-aut.

4. For WS1S, WS2S, S1S, can state things about low-levelverification of code (see MONA group). For S2S can stateactual Mathematical Theorems of interest. However, theprogram would take to long to use this, and it would not offermathematical insights anyway.

Page 132: BILL AND NATHAN RECORD LECTURE!!!!

Interesting Points about WS1S

1. Our algorithm has worst case 22···n

time.

2. There is a better algorithm: 22n3 log n

time. Provable that(roughly) can’t do better than that.

3. S1S is proven decidable using ω-regular. WS2S is provendecidable using Tree-Aut. S2S is proven decidable usingω-Tree-Automata. All the proofs use same structure as ours:the Truth sets are BLAH-regular and can test non-emptynessof BLAH-aut.

4. For WS1S, WS2S, S1S, can state things about low-levelverification of code (see MONA group). For S2S can stateactual Mathematical Theorems of interest. However, theprogram would take to long to use this, and it would not offermathematical insights anyway.

Page 133: BILL AND NATHAN RECORD LECTURE!!!!

Interesting Points about WS1S

1. Our algorithm has worst case 22···n

time.

2. There is a better algorithm: 22n3 log n

time. Provable that(roughly) can’t do better than that.

3. S1S is proven decidable using ω-regular. WS2S is provendecidable using Tree-Aut. S2S is proven decidable usingω-Tree-Automata. All the proofs use same structure as ours:the Truth sets are BLAH-regular and can test non-emptynessof BLAH-aut.

4. For WS1S, WS2S, S1S, can state things about low-levelverification of code (see MONA group). For S2S can stateactual Mathematical Theorems of interest. However, theprogram would take to long to use this, and it would not offermathematical insights anyway.

Page 134: BILL AND NATHAN RECORD LECTURE!!!!

Interesting Points about WS1S

1. Our algorithm has worst case 22···n

time.

2. There is a better algorithm: 22n3 log n

time. Provable that(roughly) can’t do better than that.

3. S1S is proven decidable using ω-regular. WS2S is provendecidable using Tree-Aut. S2S is proven decidable usingω-Tree-Automata. All the proofs use same structure as ours:the Truth sets are BLAH-regular and can test non-emptynessof BLAH-aut.

4. For WS1S, WS2S, S1S, can state things about low-levelverification of code (see MONA group). For S2S can stateactual Mathematical Theorems of interest. However, theprogram would take to long to use this, and it would not offermathematical insights anyway.

Page 135: BILL AND NATHAN RECORD LECTURE!!!!

Interesting Points about WS1S

1. Our algorithm has worst case 22···n

time.

2. There is a better algorithm: 22n3 log n

time. Provable that(roughly) can’t do better than that.

3. S1S is proven decidable using ω-regular. WS2S is provendecidable using Tree-Aut. S2S is proven decidable usingω-Tree-Automata. All the proofs use same structure as ours:the Truth sets are BLAH-regular and can test non-emptynessof BLAH-aut.

4. For WS1S, WS2S, S1S, can state things about low-levelverification of code (see MONA group). For S2S can stateactual Mathematical Theorems of interest. However, theprogram would take to long to use this, and it would not offermathematical insights anyway.

Page 136: BILL AND NATHAN RECORD LECTURE!!!!

Def of Randomness

Taking a cue from the above two examples, we will define theRandomness of a string x to be the size of the shortest TuringMachine (TM) that prints x .Def

1. If x ∈ {0, 1}n then C(x) is the length of the shortest TMthat, on input e, prints out x . Note that C (x) ≤ n + O(1).

2. If x ∈ {0, 1}n then C(x|y) is the length of the shortest TMthat, on input y , prints out x . Note that C (x |y) ≤ n + O(1).

3. A string is Kolmogorov random if C (x) ≥ n. A string isKolmogorov random relative to y if C (x |y) ≥ n.

Note Java-Random, Python-Random, 1-tape-TM-Random will allgive different values. But all within O(1).

Page 137: BILL AND NATHAN RECORD LECTURE!!!!

Def of Randomness

Taking a cue from the above two examples, we will define theRandomness of a string x to be the size of the shortest TuringMachine (TM) that prints x .Def

1. If x ∈ {0, 1}n then C(x) is the length of the shortest TMthat, on input e, prints out x . Note that C (x) ≤ n + O(1).

2. If x ∈ {0, 1}n then C(x|y) is the length of the shortest TMthat, on input y , prints out x . Note that C (x |y) ≤ n + O(1).

3. A string is Kolmogorov random if C (x) ≥ n. A string isKolmogorov random relative to y if C (x |y) ≥ n.

Note Java-Random, Python-Random, 1-tape-TM-Random will allgive different values. But all within O(1).

Page 138: BILL AND NATHAN RECORD LECTURE!!!!

Def of Randomness

Taking a cue from the above two examples, we will define theRandomness of a string x to be the size of the shortest TuringMachine (TM) that prints x .Def

1. If x ∈ {0, 1}n then C(x) is the length of the shortest TMthat, on input e, prints out x . Note that C (x) ≤ n + O(1).

2. If x ∈ {0, 1}n then C(x|y) is the length of the shortest TMthat, on input y , prints out x . Note that C (x |y) ≤ n + O(1).

3. A string is Kolmogorov random if C (x) ≥ n. A string isKolmogorov random relative to y if C (x |y) ≥ n.

Note Java-Random, Python-Random, 1-tape-TM-Random will allgive different values. But all within O(1).

Page 139: BILL AND NATHAN RECORD LECTURE!!!!

Def of Randomness

Taking a cue from the above two examples, we will define theRandomness of a string x to be the size of the shortest TuringMachine (TM) that prints x .Def

1. If x ∈ {0, 1}n then C(x) is the length of the shortest TMthat, on input e, prints out x . Note that C (x) ≤ n + O(1).

2. If x ∈ {0, 1}n then C(x|y) is the length of the shortest TMthat, on input y , prints out x . Note that C (x |y) ≤ n + O(1).

3. A string is Kolmogorov random if C (x) ≥ n. A string isKolmogorov random relative to y if C (x |y) ≥ n.

Note Java-Random, Python-Random, 1-tape-TM-Random will allgive different values. But all within O(1).

Page 140: BILL AND NATHAN RECORD LECTURE!!!!

Do Random Strings Exist?

Is there a string of length n that has C (x) ≥ n?

YES- there are more Strings of length n then TMs of length≤ n − 1.

Page 141: BILL AND NATHAN RECORD LECTURE!!!!

Application ofKolmogorov Complexityto Proving Languages

Not Regular

Page 142: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 143: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 144: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 145: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 146: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 147: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 148: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 149: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 150: BILL AND NATHAN RECORD LECTURE!!!!

L1 = {anbn : n ∈ N} is Not Regular

Assume L1 is regular via M = (Q, {a, b}, δ, s,F ).

Let n be a number such that C (n) is large (we say how large later).

We describe a short machine that prints out n.

This step is preprocessing. Feed an into M. It ends in state r .

Key bn is the only string x such that δ(r , anx) ∈ F .

The following program prints out n.Compute δ(r , b), δ(r , bb), · · · until find an m such thatδ(r , bm) ∈ F . Print out m.

Since the only extension of an that is in L1 is anbn, m = n. Hencethe program prints out n.

What is the length of the program? To describe the program allyou need is M (size O(1)) and some O(1) code. The program is ofsize O(1), say A.

Pick n such that C (n) > A. Then you have a program of sizeA < C (n) printing out n, which is a contradiction.

Page 151: BILL AND NATHAN RECORD LECTURE!!!!

Kolm Complexity Also Applies To

1. Can use it to show other langs not regular (I did that in class).

2. Can use it to show some langs require a large DFA, NFA,CFG, TM.

3. Can use in proves of average case analysis. If an algorithmruns in time BLAH on a Kolg random input, then its averagecase is BLAH.

Page 152: BILL AND NATHAN RECORD LECTURE!!!!

Kolm Complexity Also Applies To

1. Can use it to show other langs not regular (I did that in class).

2. Can use it to show some langs require a large DFA, NFA,CFG, TM.

3. Can use in proves of average case analysis. If an algorithmruns in time BLAH on a Kolg random input, then its averagecase is BLAH.

Page 153: BILL AND NATHAN RECORD LECTURE!!!!

Kolm Complexity Also Applies To

1. Can use it to show other langs not regular (I did that in class).

2. Can use it to show some langs require a large DFA, NFA,CFG, TM.

3. Can use in proves of average case analysis. If an algorithmruns in time BLAH on a Kolg random input, then its averagecase is BLAH.

Page 154: BILL AND NATHAN RECORD LECTURE!!!!

Kolm Complexity Also Applies To

1. Can use it to show other langs not regular (I did that in class).

2. Can use it to show some langs require a large DFA, NFA,CFG, TM.

3. Can use in proves of average case analysis. If an algorithmruns in time BLAH on a Kolg random input, then its averagecase is BLAH.

Page 155: BILL AND NATHAN RECORD LECTURE!!!!

BILL AND NATHAN RECORD LECTURE!!!!

BILL AND NATHAN RECORD LECTURE!!!

Page 156: BILL AND NATHAN RECORD LECTURE!!!!

UN-TIMED PART OFFINAL IS TUESDAY

May 11 11:00A.NO DEAD CAT

Page 157: BILL AND NATHAN RECORD LECTURE!!!!

FINAL IS THURSDAYMay 13

8:00PM-10:15PM

Page 158: BILL AND NATHAN RECORD LECTURE!!!!

FILL OUT COURSEEVALS for ALL YOUR

COURSES!!!