Exercises 10 - CPSC 413 F18.pdf

# 2sat input a φ in which each clause has exactly 2

• 3

This preview shows pages 1–3. Sign up to view the full content.

2SAT Input: A φ in which each clause has exactly 2 distinct literals Output: “Yes”, if there exists an assignment that satisfies φ . “No” otherwise. 1. Give a satisfying assignment to φ 2 . 2. Give an example of a 2SAT formula that is not satisfiable.

This preview has intentionally blurred sections. Sign up to view the full version.

3. Formulas This exercise contains no questions, but instead some terminology we will be using while discussing NP and reducibility. A formula is an expression like the following, φ 1 = ( x 1 x 4 ) ( x 1 x 2 x 3 x 4 ) ( x 1 x 2 x 3 ) ( x 2 x 3 x 4 ) ( x 4 ) ( x 1 x 3 x 4 ) . This is a formula over the 4 variables x 1 , x 2 , x 3 , x 4 . The notation x 1 denotes the logical negation of x 1 . The 8 expressions x 1 , x 1 , x 2 , x 2 , x 3 , x 3 , x 4 , x 4 are called literals . A literal is either a variable x i or the negation of a variable x i . The formula φ 1 contains 6 clauses . The first clause is ( x 1 x 4 ) and the last is ( x 1 x 3 x 4 ). We assign either true or false to each of the four variables. Let us consider the assignment A 1 = ( x 1 , x 2 , x 3 , x 4 ) = (0 , 1 , 1 , 0), where 1 is shorthand for true and 0 shorthand for false . We can evaluate formula φ 1 on assignment A 1 : φ 1 ( A 1 ) = (0 1) (0 0 0 1) (1 1 0) (0 1 0) 1 (1 0 1) = 1 1 1 1 1 1 = 1 . Here a b is the logical or of a and b , and a b is the logical and of a and b . We conclude that formula φ 1 evaluates to true on the assignment A 1 . We say that a formula φ is satisfiable if there exists an assignment A for which φ ( A ) evaluates to true . Formula φ 1 is satisfiable since φ 1 ( A 1 ) evaluates to true . 4. One-in-Three SAT gadget Consider the following formula φ g in the three Boolean variables x 1 , x 2 , x 3 , φ g = ( x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) .
This is the end of the preview. Sign up to access the rest of the document.
• Fall '13
• GeoffCruttwell
• Dynamic Programming, Quantification, vertex cover, independent set, NP-complete

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern