function
rule/map, domain/input, range/output
set of boolean n-tuples
boolean function
p | q | r | f(p,q,r) |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
~ | negation | ||
∧ | and | conjunction | min |
∨ | or | disjunction | max |
⊕ | xor | exclusive or | not equal |
p | q | ∧ | ∨ | ⊕ |
0 | 0 | 0 | 0 | 0 |
0 | 1 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 |
( ) | ~ | ∧ | ∨ |
consider n-variable truth table
2n rows
each row, 2 choices for f( ) entry
so num. diff't f( ) columns = 2(2n)
f( ) = 0, 1
f(x) = 0, x, negations
f(x,y) = 0, x, y, x∧y, x∨y, x⊕y, ~x∨y, x∨~y, negations
~~p = p | double negation |
p ◊ p = p | idempotent |
p ◊ q = q ◊ p | commutative |
p ◊ (p ∗ q) = p | absorption |
p∧~p = 0 p∨~p = 1 | negation |
~(p ◊ q) = ~p ∗ ~q | DeMorgan |
(p ◊ q) ◊ r = p ◊ (q ◊ r) | associative |
p ◊ (q ∗ r) = (p ◊ q) ∗ (p ◊ r) | distributive |
p∧0 = 0 p∧1 = p p∨0 = p p∨1 = 1 | bound |
◊ = ∧/∨ ∗ = ∨/∧ respectively
any bool. fn. can be expressed using variables and
~, ∧, ∨
~, ∧
~, ∨
case f( ) = 0: then f( ) = p∧~p = ~~(p∧~p) = ~(~p∨p)
case f( ) = 1: exercise
so f( ) has a tabular representation, say
so f( ) = (x1 ∨ x2 ∨ … ∨ xk) where xj ↔ j'th input that gives output 1
notice that this is a disjunctive normal form (DNF) representation
so to finish the proof …
either ∨/∧ using ~~ and deMorgan
QED
get DNF rep'n from truth table, so …
a = (~p ∧ ~q ∧ r)
b = (~p ∧ q ∧ r)
c = ( p ∧ q ∧ ~r)
= a ∨ b ∨ c
= (~p ∧ ~q ∧ r) ∨ (~p ∧ q ∧ r) ∨ (p ∧ q ∧ ~r)
= a ∨ b ∨ c
= ~~(a ∨ b ∨ c)
= ~( ~a ∧ ~b ∧ ~c)
= ~( ~(~p ∧ ~q ∧ r) ∧
~(~p ∧ q ∧ r) ∧
~( p ∧ q ∧ ~r)
= a ∨ b ∨ c
= ~~a ∨ ~~b ∨ ~~c
= ~~(~p ∧ ~q ∧ r) ∨
~~(~p ∧ q ∧ r) ∨
~~( p ∧ q ∧ ~r)
= ~( p ∨ q ∨ ~r) ∨
~( p ∨ ~q ∨ ~r) ∨
~(~p ∨ ~q ∨ r)
a1 ∨ a2 ∨ … ∨ at
where each aj is ∧ of ≥ 1 (negated) variable
a1 ∧ a2 ∧ … ∧ at
where each aj is ∨ of ≥ 1 (negated) variable
converts function into dnf
tabular of ~f( ), dnf of ~f( ), use f( ) = ~~f( ) and deMorgan
= v ∨ w ∨ x ∨ y ∨ z
v = (~p ∧ ~q ∧ ~r)
w = (~p ∧ q ∧ ~r)
x = (p ∧ ~q ∧ ~r)
y = (p ∧ ~q ∧ r)
z = (p ∧ q ∧ r), so
= ~(v ∨ w ∨ x ∨ y ∨ z)
= ~v ∧ ~w ∧ ~x ∧ ~y ∧ ~z
= (p ∨ q ∨ r) ∧ ~w ∧ ~x ∧ ~y ∧ ~z
= . . .