Institute of Theoretical Computer Science
Emo Welzl, lecturer, and Chidambaram Annamalai, teaching assistant
Tuesday, May 3, 2016
Satisfiability of Boolean Formulas
Spring 2016
Master Solutions, Special Assignment Set 3
Exercise 1 (Packings and Coverings in the Hypercube) (50 points)
(i) The size of the given code C attains the sphere covering lower bound which states that |C| ≥
2n /vol(n, r). Thus, the hamming balls of radius r centered at the codewords of C are disjoint and
partition {0, 1}n . Let u, v ∈ C be two distinct codewords. If dH (u, v) ≤ 2r then there exists a
vertex w on the shortest path from u to v such that it has distance at most r from both u and
v which is a contradiction. Note that in the hamming metric, on a shortest path from u to v,
the distance from u increases and v decreases exactly by 1 in each step along the path. Thus,
dH (u, v) ≥ 2r + 1 for every distinct pair u, v ∈ C.
On the other hand, let u ∈ C. Suppose that every other codeword v ∈ C has distance at least
2r + 2 away from u. Then, let Sr+1 (u) denote the sphere of radius r + 1 centered around u i.e.,
Sr+1 (u) := {c ∈ {0, 1}n | dH (u, c) = r + 1}. As r + 1 ≤ n this set is non-empty (otherwise the code
C contains just one element and there is nothing to prove). Clearly no element in Sr+1 (u) lies in any
of the hamming balls of radius r centered around the codewords of C (if it belonged to the hamming
ball of radius r of some code c then by the triangle inequality dH (u, c) ≤ r + 1 + r = 2r + 1). This
means that C is not a covering code which is a contradiction. Thus, for each u ∈ C there is a v ∈ C
such that dH (u, v) ≤ 2r + 1.
(ii) If r = 0 then C = {0, 1}n and R = n and the assertion holds. Hence we may assume r ≥ 1 (and
hence R ≤ n − 1) further on.
Let z be the vertex antipodal to the center z of a smallest enclosing ball B. We know that the ball
B 0 of radius n − R − 1 centered at z is disjoint from B (note R ≤ n − 1); therefore, B 0 is disjoint
from C; that is, balls of radius n − R − 1 centered at C do not cover z and therefore r > n − R − 1
(⇔ r ≥ n − R ⇔ r + R ≥ n).
It remains to show r + R ≤ n: There must be a vertex u not covered by the balls of radius r − 1
centered at C, i.e. the ball B 00 of radius r − 1 centered at u is disjoint from C (recall r ≥ 1). Again
we move to the antipodal u of u. The ball of radius n − (r − 1) − 1 = n − r centered at u covers
the complement of B 00 (in {0, 1}n ) and thus contains C and therefore R ≤ n − r and we are done.
Remark. Note that the first paragraph above used that this is a packing, and the second paragraph
used that this is a covering.
Remark. Although we don’t use this fact, without loss of generality we may assume that the center
z of the smallest enclosing ball is 0n , and its antipodal point z is 1n , through the distance-preserving
bijective map f (x) 7→ x ⊕ z. This can help with the intuition in the proof in terms of hamming
weight.
(iii) Let C be the given covering code of radius r with a unique smallest enclosing ball B with center
c and radius R = n − r. Let u be a point at a distance R + 1 away from c (which is well
defined because r ≥ 1). By construction the code C ∪ {c} has an enclosing ball of radius R + 1
around c. Also this is the smallest enclosing ball (certainly among balls centered at c, and for
balls centered at d 6= c by the uniqueness of B). So the radius of the covering code C ∪ {u} is
n − (R + 1) = n − (n − r + 1) = r − 1.
Exercise 2 (When Almost All Assignments are Satisfying) (50 points)
(i) Let G ⊆ F be some independent set of 3-clauses in F . Choose a random assignment α ∈ {0, 1}n
uniformly at random. Then we have,
|G|
7
= Pr[α satisfies G] ≥ Pr[α satisfies F ] ≥ .
8
Therefore, |G| = O(log 1/). In particular we can take f () to be log8/7 (1/).
(ii) Take any maximal independent set of 3 clauses G in F . By the previous part of the question, |G| =
O(log n). Thus, by guessing the correct assignment α of the variables in vbl(G) (in polynomial time)
we obtain a (≤ 2)-CNF formula F [α] which we can solve using resolution (or the implication graph)
to obtain a complete satisfying assignment for F or decide that F is unsatisfiable in deterministic
polynomial time.
(iii) Let G be a (≤ 3)-CNF formula. If |vbl(G)| = i, let V 0 be an arbitrary set of i variables disjoint
from vbl(G). Now we can view G as a (≤ 3)-CNF formula over variable set V := vbl(G) ∪ V 0 ,
|V | = 2i. If G is satisfiable, then it has at least 2i = 2n/2 satisfying assignments on V . Hence,
satisfiability can be solved by applying our supposed polynomial procedure on (G, V ).
You might not be happy with the introduction of extra variables not present in the formula. Instead
of arguing whether that is formally correct in response of the statement in the exercise, let us prove
the following stronger statement:
Suppose there exists a deterministic polynomial time algorithm that – given a (≤ 3)-CNF formula
F with at least 2|vbl(F )|/2 satisfying assignments – produces one such satisfying assignment. Show
that this implies P = N P.
Let G be a (≤ 3)-CNF formula with |vbl(G)| = i. Now, for some ` ≥ 1, introduce 3` new variables
V 0 := {xj , yj , zj | 1 ≤ j ≤ `}, disjoint from vbl(G). We set F := G ∪ {{xj , yj , zj } | 1 ≤ j ≤ `}.
Observe that every assignment on vbl(G) satisfying G can be extended in exactly 7` ways to an
assignment on V satisfying F .
We summarize: F is a (≤ 3)-CNF formula with n := |vbl(F )| = i + 3` variables which is satisfiable
iff G is satisfiable, and if F is satisfiable, then we have at least 7` satisfying assignments.
Now set ` so that 7` ≥ 2n/2 = 2(i+3`)/2 . For that to be true, ` has to fulfill
7` ≥ 2(i+3`)/2 ,
i + 3`
,
` log2 7 ≥
2
i
i
`≥
=
.
2 log2 7 − 3
log2 49/8
Hence, ` ≥ i/2 will suffice (note log2 49/8 > log2 4 = 2), that is, there is a choice of ` so that F
has size polynomial in i and |G|.
Thus, if there exists a deterministic polynomial time algorithm that given an (≤ 3)-CNF formula
over n variables with at least 2n/2 satisfying assignments produces one such satisfying assignment
then we will be able to determine whether (G, vbl(G)) is satisfiable or not thereby deciding an
NP-complete problem in polynomial time.
© Copyright 2026 Paperzz