CS 228 Tut3 Sol
CS 228 Tut3 Sol
Problem Sheet 3
S. Krishna
1. For each of the following conditions, give an example of an unsatisfiable set of formulae, Γ
that meets the condition.
(a) Each member of the set is—by itself—satisfiable.
(b) For any two members γ1 and γ2 of Γ, the set {γ1 , γ2 } is satisfiable.
(c) For any three members γ1 , γ2 , and γ3 of Γ, the set {γ1 , γ2 , γ3 } is satisfiable.
Solution
(a) Γ = {p, ¬p}
2. Let α be a wff whose only connective symbols are ∧, ∨, and ¬. Let α∗ be the result of
interchanging ∧ and ∨ and replacing each propositional variable by its negation. Show that
α∗ is tautologically equivalent to ¬α. Observe that this result is a generalization and a stronger
form of De Morgan’s laws, which deal with the negation of conjunctions and disjunctions.
Solution
We will prove this via structural induction.
Base Case:
Consider the simplest wff, where α is a sentence symbol p. Then, α∗ = ¬p, and hence,
α∗ ≡ ¬α.
Inductive Step:
Say ϕ, ψ are formulae which such that ϕ∗ ≡ ¬ϕ and ψ∗ ≡ ¬ψ. Consider the following
cases:
1
law, α∗ ≡ ¬α.
3. Let F and G be two sets of formulae. We say F ≡ G iff for any assignment α, α |= F iff
α |= G (α |= F iff α |= Fi for every Fi ∈ F). Prove or disprove: For any F and G, F ≡ G iff
Solution
Consider F = {p} and G = {p, ⊤}, where p is an atomic proposition. Observe that
F ≡ G. (Why?) Now, we shall show that (a) is false, hence giving a counterexample.
Take G = ⊤. Clearly, ⊤ ⊭ p and hence there does not exist a F ∈ F such that G |= F
Solution
We are given that F is inconsistent (F ⊢ ⊥). Let F ′ ⊆ F be the finite set of formulae
in F used in a proof deducing ⊥. Thus, F ′ is a finite subset of F such that F ′ ⊢ ⊥.
Hence, we showed that there exists a formula F ∈ F such that {F } ⊢ ⊥ and hence for
any formula G ∈ F, {F } ⊢ ¬G since ⊥ ⊢ ¬G.
5. Suppose |= (F → G) and F is satisfiable and G is not valid. Show that there exists a formula
H such that the atomic propositions in H are in both F and G and |= F → H and |= H → G.
2
Solution
We denote the list of propositional variables that occur only in F as p⃗, the list of
variables common to F and G as ⃗q, and those only in G as ⃗r. Let np , nq , nr be the
number of variables in p⃗, ⃗q, ⃗r, respectively.
Define H as follows: _
H= F [ p⃗ = α
⃗ ].
⃗ ∈{⊥,⊤}np
α
where, F [ p⃗ = α
⃗ ] denotes the formula obtained by replacing all occurrences of pi by
αi , and then simplifying the resultant formula. By simplification, we mean the obvious
ones like α ∧ ⊤ = α, α ∨ ⊤ = ⊤, α ∧ ¬⊤ = ⊥, α ∨ ¬⊤ = α for all sub-formulas α of F .
Similarly for ⊥.
(a) |= F → H:
(b) |= H → G:
6. Consider the parity function, PARITY : {0, 1}n → {0, 1}, where PARITY evaluates to 1 iff an
odd number of inputs is 1. In all of the CNFs below, we assume that each clause contains
any variable at most once, i.e. no clause contains expressions of the form p ∧ ¬p or p ∨ ¬p.
Furthermore, all clauses are assumed to be distinct.
3
(a) Prove that any CNF representation of PARITY must have n literals (from distinct vari-
ables) in every clause.
(b) Prove that any CNF representation of PARITY must have at least 2n−1 clauses.
Solution
Let PARITY := m
V Wni
i=1 j=1 ℓij be the CNF representation of PARITY, where ni is the
number of literals in the i−th clause, and m is the number of clauses. We want to
prove that ni = n for every i, and m ≥ 2n − 1.
(a) Suppose ni < n for some i. Negate the entire formula to convert the CNF into a
DNF. Now, choose an assignment of literals in the i−th cube (of the DNF) such
that the cube, and hence the whole DNF formula, evaluates to 1. Now, consider
a variable v, which doesn’t appear in the i−th cube, and flip its value. The LHS
then becomes 0. However, the i−th clause stays 1, leading to a contradiction.
(b) Once again, consider the DNF. Note that a conjunction of n literals is satisfied
by a unique assignment of variables, and thus, the clauses in the DNF actually
encode the assignments that satisfy the formula. Since PARITY is satisfied by
2n−1 clauses, we’re done.
Solution
If a variable occurs only positively or only negatively in F , then we can delete the
clauses containing that variable without affecting the satisfiability of F . Thus, we
can assume that all variables have one negative occurrence and one positive occurrence.
In summary, we can eliminate each variable from F without affecting satisfiability and
without increasing the size of the overall formula. It follows that satisfiability can be
decided in polynomial time.
4
8. Say that a set Σ1 of wffs is equivalent to a set Σ2 of wffs iff for any wff α, we have Σ1 |= α
iff Σ2 |= α. A set Σ is independent iff no member of Σ is tautologically implied by the
remaining members in Σ. Show that a finite set of wffs has an independent equivalent subset
by describing an algorithm to compute this independent equivalent subset. Prove that your
algorithm returns a subset that is independent and equivalent.
Solution
The key idea is to keep removing the formulae in Σ, which are tautologically implied
by others, till there aren’t any. This is given in Algorithm 1.
Notice that since Σ is finite, the algorithm terminates after finite number of iterations.
Also, the algorithms terminates only when there does not exist a σ ∈ Σ′ such that
Σ \ {σ} |= σ, i.e, the set Σ′ returned at the end will be independent. Clearly Σ′ ⊆ Σ.
We are only left to show that Σ′ is equivalent to Σ.