discrete mathematics cs 2610 september 26. 2 equal boolean functions two boolean functions f and g...
TRANSCRIPT
![Page 1: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/1.jpg)
Discrete Mathematics CS 2610
September 26
![Page 2: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/2.jpg)
2
Equal Boolean Functions
Two Boolean functions F and G of degree n are equal iff for all (x1,..xn) Bn, F (x1,..xn) = G (x1,..xn)
Example: F(x,y,z) = x(y+z), G(x,y,z) = xy + xz, and F=G (recall the “truth” table we put on the board yesterday)Also, note the distributive property:
x(y+z) = xy + xz via the distributive law
![Page 3: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/3.jpg)
3
Boolean Functions
Two Boolean expressions e1 and e2 that represent the exact same function F are called equivalent
F(x1,x2,x3)
1110
1010
0100
1000
x3x2x1
0001
0101
0011
1111
F(x1,x2,x3) = x1(x2+x3)+x1x2x3
F(x1,x2,x3) = x1x2+x1x3+x1x2x3
![Page 4: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/4.jpg)
4
Boolean Functions
More equivalent Boolean expressions: (x + y)z = xyz + xyz + xyz (x + y)z = xz + yz distributive = x1z + 1yz identity = x(y + y)z + (x + x)yz unit = xyz + xyz + xyz + xyz distributive = xyz + xyz + xyz idempotent
We’ve expanded the initial expression into its sum of products form.
![Page 5: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/5.jpg)
5
Boolean Functions
More equivalent Boolean expressions: xy + z = ?? = xy1 + 11z identity = xy(z + z) + (x + x)1z unit = xyz + xyz + x1z + x1z distributive = xyz + xyz + x(y + y)z + x(y + y)z unit = xyz + xyz + xyz + xyz + xyz + xyz
distributive = xyz + xyz + xyz + xyz + xyz
idempotent
The example from yesterday.
![Page 6: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/6.jpg)
6
Representing Boolean Functions
How to construct a Boolean expression that represents a Boolean Function ?
1110
1010
0100
0000
zyx
0001
1101
0011
1111
F
(-x)(y)(-z) + (-x)yz + x(-y)z + xyz
F(x, y, z) = 1 if and only if:
![Page 7: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/7.jpg)
7
Representing Boolean Functions
How to construct a Boolean expression that represents a Boolean Function ?
1110
1010
0100
1000
zyx
0001
0101
0011
1111
FF(x, y, z) =
x·y·z +
x·y·z +
x·y·z +
x·y·z
![Page 8: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/8.jpg)
8
Boolean Identities
Double complement:x = x
Idempotent laws:x + x = x, x · x = x
Identity laws:x + 0 = x, x · 1 = x
Domination laws:x + 1 = 1, x · 0 = 0
Commutative laws:x + y = y + x, x · y = y ·
x
Associative laws:x + (y + z) = (x + y) + zx · (y · z) = (x · y) · z
Distributive laws:x + y·z = (x + y)·(x + z)x · (y + z) = x·y + x·z
De Morgan’s laws:(x · y) = x + y, (x + y) =
x · yAbsorption laws:x + x·y = x, x · (x + y) =
x
the Unit Property: x + x = 1 and Zero Property: x ·x = 0
![Page 9: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/9.jpg)
9
Boolean Identities
Absorption law:
Show that x·(x + y) = x
1) x·(x + y) = (x + 0) ·(x + y) identity2) = x + 0 ·y distributive3) = x + y· 0 commutative4) = x + 0 domination5) = x identity
![Page 10: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/10.jpg)
10
Dual Expression (related to identity pairs)
The dual ed of a Boolean expression e is obtained by exchanging + with , and 0 with 1 in e.
Example:e = xy + zwe = x + y + 0
Duality principle: e1e2 iff e1de2
d
x (x + y) = x iff x + xy = x (absorption)
ed =(x + y)(z + w)
ed = x · y · 1
![Page 11: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/11.jpg)
11
Dual Function
The dual of a Boolean function F represented by a Boolean expression is the function represented by the dual of this expression.
The dual function of F is denoted by Fd
The dual function, denoted by Fd, does not depend on the particular Boolean expression used to represent F.
![Page 12: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/12.jpg)
12
Recall: Boolean Identities
Double complement:x = x
Idempotent laws:x + x = x, x · x = x
Identity laws:x + 0 = x, x · 1 = x
Domination laws:x + 1 = 1, x · 0 = 0
Commutative laws:x + y = y + x, x · y = y ·
x
Associative laws:x + (y + z) = (x + y) + zx · (y · z) = (x · y) · z
Distributive laws:x + y·z = (x + y)·(x + z)x · (y + z) = x·y + x·z
De Morgan’s laws:(x · y) = x + y, (x + y) =
x · yAbsorption laws:x + x·y = x, x · (x + y) =
x
the Unit Property: x + x = 1 and Zero Property: x ·x = 0
![Page 13: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/13.jpg)
13
Boolean Expressions Sets Propositions
Identity Lawsx 0 = x, x 1 = xComplement Lawsx x = 1, x x = 0
Associative Laws(x y) z = x (y z)(x y) z = x (y z)
Commutative Laws x y = y x, x y = y xDistributive Lawsx ( y z) = (x y) (x z)x ( y z) = (x y) (x z)
A Boolean Algebra is a set B with operations , , and elements 0 and 1 such that the above properties hold for all x, y, and z in B.
![Page 14: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/14.jpg)
14
DNF: Disjunctive Normal Form
A literal is a Boolean variable or its complement.A minterm of Boolean variables x1,…,xn is a Boolean product of n literals y1…yn, where yi is either the literal xi or its complement xi.
Example:x y z + x y z + x y z
Disjunctive Normal Form: sum of products
minterms
We have seen how to develop a DNF expression for a function if we’re given the function’s “truth” table.
![Page 15: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/15.jpg)
15
CNF: Conjunctive Normal Form
A literal is a Boolean variable or its complement.A maxterm of Boolean variables x1,…,xn is a Boolean sum of n literals y1…yn, where yi is either the literal xi or its complement xi.
Example:(x +y + z) (x + y + z)
(x + y +z)
Conjuctive Normal Form: product of sums
maxterms
![Page 16: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/16.jpg)
16
Conjunctive Normal FormTo find the CNF representation of a Boolean function F1. Find the DNF representation of its complement F
2. Then complement both sides and apply DeMorgan’s laws to get F:
1110
1010
0100
1000
zyx
0001
0101
0011
1111
F
0
0
1
0
1
1
1
0
F
How do you build the CNF directly from the table ?
F = x·y·z + x·y·z + x·y·z + x·y·z
= (x+y+z) · (x+y+z) · (x+y+z) · (x+y+z)
F = (x·y·z) · (x·y·z) · (x·y·z) · (x·y·z)
![Page 17: Discrete Mathematics CS 2610 September 26. 2 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n ) B](https://reader036.vdocuments.us/reader036/viewer/2022082417/5697bf741a28abf838c7f982/html5/thumbnails/17.jpg)
17
Functional CompletenessSince every Boolean function can be expressed in terms of ,+,¯, we say that the set of operators {,+,¯} is functionally complete.
{+, ¯} is functionally complete
{, ¯} is functionally complete (note: x + y = xy)
NAND | and NOR ↓ are also functionally complete, each by itself (as a singleton set).
Recall x NAND y is true iff x or y (or both) are false and x NOR y is true iff both x and y are false.
xy = (x+y)