Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 9: Boolean Algebra

Similar presentations


Presentation on theme: "Chapter 9: Boolean Algebra"— Presentation transcript:

1 Chapter 9: Boolean Algebra
Discrete Math for CS

2 Disjunction and Conjunction:
Our Boolean expressions will use ' to represent negation. Discrete Math for CS

3 Commutative: p ∧ q = q ∧ p and p ∨ q = q ∨ p
Reasoning Laws: Commutative: p ∧ q = q ∧ p and p ∨ q = q ∨ p Associative: p ∧ ( q ∧ r ) = ( p ∧ q ) ∧ r p ∨ ( q ∨ r ) = ( p ∨ q ) ∨ r Distributive: p ∧ ( q ∨ r ) = ( p ∧ q ) ∨(p ∧ r ) p ∨ ( q ∧ r ) = ( p ∨ q ) ∧(p ∨ r )‏ Idempotent: p ∧ p = p and p ∨ p = p Absorption: p ∧ ( p ∨ q ) = p and p ∨ ( p ∧ q ) = p De Morgan: (p ∧ q ) ' = p' ∨ q' and (p ∨ q' ) = p' ∧ q' Discrete Math for CS

4 Prove the Distributive Law
Exercise: Prove the Distributive Law p ∧ ( q ∨ r ) = ( p ∧ q ) ∨(p ∧ r )‏ Discrete Math for CS

5 Show that (p' ∧ q)' ∧ (p ∨ q) == p
Exercise: Show that (p' ∧ q)' ∧ (p ∨ q) == p (p' ∧ q)' ∧ (p ∨ q) = (p'' ∨ q') ∧ (p ∨ q)‏ = (p ∨ q') ∧ (p ∨ q)‏ = p ∨ (q' ∧ q)‏ = p ∨ 0 = p Discrete Math for CS

6 Boolean Function: A boolean function, f, on n variables p1, p2, ..., pn is a function f: Bn --> B such that f(p1, p2, ..., pn) is a Boolean expression Discrete Math for CS

7 Minterm: Suppose a Boolean expression of 3 variables, p, q and r, has only one 1 in its columns of a truth table. This expression is therefore equivalent to a conjunction of p. p', q, q', r and r' that is true for the same row and false elsewhere. p q r f(p,q,r) So f(p,q,r) is equivalent to p' ∧ q ∧ r. Def: A minterm is a Boolean expression that has precisely one 1 in the final column of its truth table. The conjunction taht is equivalent to the minterm is called the product representation of the minterm. Discrete Math for CS

8 Observation: Any minterm m(p1, p2, ..., pn) can be represented as a conjunction of the variables pi or their negations. A Boolean expression can be thought of as a disjunction of minterms. Writing it so is putting it in Disjunctive Normal Form. Discrete Math for CS

9 Write the following in Disjunctive Normal Form
Exercise: Write the following in Disjunctive Normal Form f(p,q,r) = (p ∧ q) ∨ (q' ∧ r)‏ p q r f p' ∧ q' ∧ r p ∧ q' ∧ r p ∧ q ∧ r' p ∧ q ∧ r f(p,q,r) = (p'∧q'∧r) ∨ (p∧q'∧r) ∨ (p∧q∧r') ∨ (p∧q∧r) Discrete Math for CS

10 Complete Set of Operators
A Complete Set of Operators is a set of operators in which you can express every Boolean Expression. The Disjunctive Normal Form construction shows us that (∨,∧,' ) is a Complete Set of Operators. Show (∧,' ) is a Complete Set of Operators. Discrete Math for CS

11 Show NAND is a Complete Set of Operators.
It suffices to show we can write p', p ∨ q and p ∧ q using only NAND. p' = (p ∧ p)' = p NAND p p ∨ q = (p' ∧ q')' = ((p NAND p) ∧ (q NAND q))' = ((p NAND p) NAND (q NAND q)) p ∧ q = ((p q)')' = (p NAND q) ' = (p NAND q) NAND (p NAND q)‏ Discrete Math for CS


Download ppt "Chapter 9: Boolean Algebra"

Similar presentations


Ads by Google