算法和计算复杂度 3 Boolean Circuits
Non-uniform model of computation: Boolean circuit model.
In contrast to uniform model like Turing machine.
Boolean circuit: Fixed number of inputs. To study computation of arbitrary inputs, we need a family of Boolean circuits.
Some Definitions
📖Definition of Boolean circuit. A Boolean circuit with inputs and outputs consists of:
- A directed acyclic graph where the in-degree of every node is at most .
- A labeling of all nodes with \ell(g)\in\{0,1,x_1,\cdots,x_n,\overline{x_1},\cdots,\overline{x_n},\and,\or,\neg\}.
- A choice of output gates .
The nodes of is the gates of , the arcs of is the wires of .
Nodes with in-degree are input gates.
The size of is the number of gates.
Fanin of a gate is its in-degree, fanout is its out-degree.
Labeling function should satisfy: For all gates :
- If the fanin is , then \ell(g)\in\{0,1,x_1,\cdots,x_n,\overline{x_1},\cdots,\overline{x_n},\and,\or,\neg\}.
- If the fanin is , then .
- If the fanin is , then \ell(g)\in\{\and,\or\}.
A Boolean circuit with inputs and outputs computes a Boolean function .
Implicit negation such as can be made explicit by introducing a new gate, thereby at most doubling the size of the circuit.
📖Definition of family of Boolean circuits. A family of Boolean circuits, where is a circuit with inputs computes the Boolean function given by . We say that computes the language if computes the characteristic function of given by iff .
直白一点:我们说一个布尔电路族 计算~~(接受?)~~语言 ,当且仅当该布尔电路族的输入 属于语言 时,输出结果为 。
If we want to apply non-Boolean alphabet, we just encode these letters into for some fixed .
📖Definition of . Let . is the class of languages computed by family of Boolean circuit of size ,
We interested in class of languages computed by a family of polynomial size.
📖Definition of log-space/polynomial-time uniform. Let be a family of Boolean circuits of size . We say that the family is log-space uniform if the function is computable in space . The family is polynomial-time uniform if the function is computable in time .
📖Definition of complexity classes of languages computed by families of Boolean circuits. Let .
- is the class of languages computed by log-space uniform families of Boolean circuits of size .
- is the class of languages computed by polynomial-time uniform families of Boolean circuits of size .
Boolean Formulas
📖Definition of Boolean formulas. A Boolean formula (aka de Morgan formula) is a Boolean circuit where the underlying directed graph is a tree.
合取范式 conjunctive normal form CNF
析取范式 disjunctive normal form DNF
🎯Theorem 14. Any Boolean function is computed by a CNF with clauses of length and a DNF with terms of length where
The Shannon Function
The smallest size in which any Boolean function on variables can be computed by a Boolean circuit of size .
The function is called the Shannon function.
By DNF/CNF formulas, we have trivial bound .
Shannon proved that .
🎯Theorem 15 (Lower Bound on Circuit Size). for . In fact, the fraction of Boolean functions computed by Boolean circuits of size at most is at most for .
For a given number of inputs : first give an upper bound on number of Boolean circuits with inputs and output, with at most gates. Consider an acyclic ordering of the gates of the circuit and assume the last gate is the output gate.
Different types of gate: input gates have probabilities, negation with one input , and/or with two inputs . Thus we have at most options for every gate, meaning that we have at most many circuits with at most gates.
For we have
Each of these at most circuits computes precisely one Boolean function. There are exactly different Boolean functions on inputs.
Thus if , there must be a Boolean function that is not computed by a Boolean circuit of size . (By pigeon hole theorem)
Let , which satisfies , we have
It follows that less than Boolean functions on inputs are computed by Boolean circuits of size at most .
Turing Machines versus Boolean Circuits
Oblivious Turing machine can efficiently be converted to a family of Boolean circuits.
🤔Proposition 1. Let and suppose is computed by a time-bounded oblivious Turing machine. Then .
Any configuration of oblivious Turing machine on input can be encoded by a binary string of length s.t. every symbol of every work tape corresponds to a fixed number of positions of the encoding.
We can build the Boolean circuit for input length in steps. Proof by induction.
Proposition 1 and Theorem 4 result in some inclusion relation.
🎯Theorem 16. for .
Turing machine is supplied with an advice string in addition to the input, where the advice string is specific to the input length.
📖Definition of Advice classes. Let be a class of languages and a function. Define to be the class of languages for which there exist satisfying that for all input lengths , there is an advice string of length s.t. for all of length , we have iff . For a family of functions , we let .
🎯Theorem 17. Let . Then .
The advice string (length ) is an encoding of the circuit , which is a string of length .
Assume that the gates of are given in the encoding in acyclic order. On input of length and advice , a Turing machine can evaluate on input , evaluating the gates in the given acyclic ordering and storing all intermediate outputs.
To evaluate each gate we need to retrieve the computed value of its inputs, which will take time. Doing this for all gates leads to .
🎯Corollary 1. Let . Then
Proof by Definition of advice class and Theorem 17.
🎯Theorem 18. Let and suppose the function is computable in space . Then .
🎯Theorem 19. Let . Then .
🎯Corollary 2. Let and suppose that function is computable in space . Then .
In particular, we have .