General Computer Science 320201 GenCS I & II Lecture ... - Kwarc
General Computer Science 320201 GenCS I & II Lecture ... - Kwarc
General Computer Science 320201 GenCS I & II Lecture ... - Kwarc
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
The first result is a very naive counting argument based on the fact that we can always realize a<br />
Boolean function via its DNF or CNF. The second result gives us a better complexity with a more<br />
involved argument. Another difference between the proofs is that the first one is constructive,<br />
i.e. we can read an algorithm that provides Boolean expressions of the complexity claimed by the<br />
algorithm for a given Boolean function. The second proof gives us no such algorithm, since it is<br />
non-constructive.<br />
An Upper Bound for the Cost of BF with n variables<br />
Idea: Every Boolean function has a DNF and CNF, so we compute its cost.<br />
Example 267 Let us look at the size of the DNF or CNF for f ∈ (B 3 → B).<br />
x1 x2 x3 f monomials clauses<br />
0 0 0 1 x 0 1 x0 2 x0 3<br />
0 0 1 1 x 0 1 x0 2 x1 3<br />
0 1 0 0 x 1 1 + x0 2 + x1 3<br />
0 1 1 0 x 1 1 + x0 2 + x0 3<br />
1 0 0 1 x 1 1 x0 2 x0 3<br />
1 0 1 1 x 1 1 x0 2 x1 3<br />
1 1 0 0 x 0 1 + x0 2 + x1 3<br />
1 1 1 1 x 1 1 x1 2 x1 3<br />
Theorem 268 Any f : B n → B is realized by an e ∈ Ebool with C(e) ∈ O(n · 2 n ).<br />
Proof: by counting (constructive proof (we exhibit a witness))<br />
P.1 either en := CNF(f) has 2n<br />
2<br />
clauses or less or DNF(f) does monomials<br />
take smaller one, multiply/sum the monomials/clauses at cost 2 n−1 − 1<br />
there are n literals per clause/monomial ei, so C(ei) ≤ 2n − 1<br />
so C(en) ≤ 2 n−1 − 1 + 2 n−1 · (2n − 1) and thus C(en) ∈ O(n · 2 n )<br />
c○: Michael Kohlhase 148<br />
For this proof we will introduce the concept of a “realization cost function” κ: N → N to save<br />
space in the argumentation. The trick in this proof is to make the induction on the arity work<br />
by splitting an n-ary Boolean function into two n − 1-ary functions and estimate their complexity<br />
separately. This argument does not give a direct witness in the proof, since to do this we have to<br />
decide which of these two split-parts we need to pursue at each level. This yields an algorithm for<br />
determining a witness, but not a direct witness itself.<br />
We can do better (if we accept complicated witness)<br />
P.2 P.3 P.4 Theorem 269 Let κ(n) := max({C(f) | f : B n → B}), then κ ∈ O(2 n ).<br />
Proof: we show that κ(n) ≤ 2 n + d by induction on n<br />
P.1.1 base case:<br />
We count the operators in all members: B → B = {f1, f0, fx1, fx1},<br />
so κ(1) = 1 and thus κ(1) ≤ 2 1 + d for d = 0.<br />
P.1.2 step case:<br />
P.1.2.1 given f ∈ (B n → B), then f(a1, . . . , an) = 1, iff either<br />
an = 0 and f(a1, . . . , an−1, 0) = 1 or<br />
an = 1 and f(a1, . . . , an−1, 1) = 1<br />
P.1.2.2 Let fi(a1, . . . , an−1) := f(a1, . . . , an−1, i) for i ∈ {0, 1},<br />
79