I'm looking over previous exam papers, and have come across this question which has confused me.
Question:
Convert the Not-All-Equal 2-SAT problem given by the clauses
{x1, x2}, {x2, x3}, {x3, x4}, {x4, x5}, {x5, x1}
to an equivalent 2-SAT problem. (Hint: the 2-SAT problem contains 10 clauses).
From my understanding, is this simply finding the negation for each literal in every clause? So for example, {x1, x2} = {-x1, -x2}
, and this is done for each clause?
Is this correct?
That is correct. Specifically, replace all clauses
(x ∨ y)
with(x ∨ y) ∧ (~x ∨ ~y)
. That literally says "x or y have to be true, and x or y have to be false", or equivalently "satisfy(x ∨ y)
while making sure that one ofx
andy
is false".To prove the equivalence, let us first assume that the NAE 2-SAT problem is satisfiable. Let A be a satisfying assignment and let
{x, y}
be one arbitrary clause. Since exactly one ofx
andy
are true, this implies that(x ∨ y) ∧ (~x ∨ ~y)
is true. Hence, the corresponding two clauses in the 2-SAT formula are satisfied. Since{x, y}
was chosen arbitrarily, we conclude that A satisfies all the clauses in the 2-SAT formula.Conversely, let us assume that the NAE 2-SAT is not satisfiable. That is, for any assignment, there exists some clause
{x, y}
for whichx
andy
are either both true or both false. Let A be an arbitrarily chosen assignment and let{x, y}
be a clause that A does not satisfy (in the NAE 2-SAT). Sincex = y
, this implies that(x ∨ y) ∧ (~x ∨ ~y)
is false (because one of the halves of the conjunction will be false). Hence, A does not satisfy the 2-SAT formula. Since A was chosen arbitrarily, we conclude that no assignment satisfies the 2-SAT formula.