The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The...

9
The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Transcript of The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The...

Page 1: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

The Probabilistic Method

Joshua BrodyCS49/Math59

Fall 2015

Week 13: P, NP, SAT

Page 2: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) Θ(n+m)

(B) Θ(nm)

(C) Θ(n + mlog(n))

(D) Θ(2n)

(E) None of the above

What is the input length of SAT?(how would you efficiently encode a SAT input?)

Page 3: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) Θ(n+m)

(B) Θ(nm)

(C) Θ(n + mlog(n))

(D) Θ(2n)

(E) None of the above

What is the input length of SAT?(how would you efficiently encode a SAT input?)

Page 4: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) (x1, x2, x3, x4) = (F, F, F, F)

(B) (T, T, T, T)

(C) (T, F, T, F)

(D) (F, T, F, F)

(E) Multiple Answers Correct

Consider the following SAT instance: c1 ∧ c2 ∧ c3 ∧ c4

for the following clauses:c1 = (x1 ∨ x2 ∨ ¬x3) c2 = (¬x1 ∨ x3 ∨ x4)c3 = (¬x2 ∨ ¬x3 ∨ ¬x4) c4 = (x2 ∨ ¬x3 ∨ x4)

Which of the following are satisfying assignments?

Page 5: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) (x1, x2, x3, x4) = (F, F, F, F)

(B) (T, T, T, T)

(C) (T, F, T, F)

(D) (F, T, F, F)

(E) Multiple Answers Correct

Consider the following SAT instance: c1 ∧ c2 ∧ c3 ∧ c4

for the following clauses:c1 = (x1 ∨ x2 ∨ ¬x3) c2 = (¬x1 ∨ x3 ∨ x4)c3 = (¬x2 ∨ ¬x3 ∨ ¬x4) c4 = (x2 ∨ ¬x3 ∨ x4)

Which of the following are satisfying assignments?

Page 6: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) O(2nm)

(B) O(nm)

(C) O(nm)

(D) O(n2m)

(E) O(n + m)

Design an algorithm recognizing SAT.What is its runtime?

Page 7: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Clicker Question

(A) O(2nm)

(B) O(nm)

(C) O(nm)

(D) O(n2m)

(E) O(n + m)

Design an algorithm recognizing SAT.What is its runtime?

Page 8: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

Definition: A is polynomial-time reducible to B (A ≤P B) if A can be solved using a polynomial amount of time plus a polynomial number of solutions to B.

Polynomial Time reducibility

A

x

YES/NO

B B B

Page 9: The Probabilistic Method - Swarthmore Collegebrody/cs49/f15/slides/CS49Math5… · The Probabilistic Method Joshua Brody CS49/Math59 Fall 2015 Week 13: P, NP, SAT

The Probabilistic Method