Title: Boolean Algebra
1Boolean Algebra
2AND
- (today is Monday) AND (it is raining)
- (today is Monday) AND (it is not raining)
- (today is Friday) AND (it is raining)
- (today is Friday) AND (it is not raining)
3OR
- (today is Monday) OR (it is raining)
- (today is Monday) OR (it is not raining)
- (today is Friday) OR (it is raining)
- (today is Friday) OR (it is not raining)
4NOT
- (today is Monday) OR NOT (it is raining)
- (today is Monday) OR (it is raining)
- (today is Friday) AND NOT(it is raining)
- (today is Friday) AND (it is raining)
- (today is Monday) AND NOT(it is raining)
- (today is Monday) AND (it is raining)
- (today is Friday) OR NOT (it is raining)
- (today is Friday) OR (it is raining)
5IMPLIES (A ? B)
- A ?B is False only when A is True and B is False.
- In other words, A ? B is True except when the
premise (A) is True and the conclusion (B) is
False. - A ? B is logically equivalent to
- (NOT A) OR B
6Truth Table (AND, OR, NOT)
7Truth Table (AND, OR, NOT)
8Truth Table (AND, OR, NOT)
9Truth Table (AND, OR, NOT)
10Truth Tables
- A AND B is True only when both A and B are true.
- A OR B is always True unless both A and B are
false. - NOT A changes the value from True to False or
False to True.
11IMPLIES (A ? B)
12Writing AND, OR, NOT
- A AND B A B AB
- A OR B A V B AB
- NOT A A A
- TRUE T 1
- FALSE F 0
13Example
- Write the truth table for A(A B) AB
(section 7.5, AE, p 308, exercise 3a) - First, write in words A AND (NOT A OR B) OR (A
AND NOT B) - Then do a truth table with the following columns
A, B, NOT A, NOT B, NOT A OR B, A AND NOT B, A
AND (NOT A OR B), whole expression.
14X A (A B) AB
15Exercise
- Write the truth table for (A A) B
- First, write in words.
- Then do a truth table.
16Solution to (A A) B
17Boolean Algebra
- Boolean Algebra is made up of two constants (True
and False) - Several operators - AND, OR, NOT, XOR, NOR, NAND
- XOR either a or b but not both
- NOR NOT OR
- NAND NOT AND
18Boolean Algebra
- The in Boolean Algebra means equivalent
- Two statements are equivalent if they have the
same truth table. - For example,
- True True,
- a a,
19Boolean Algebra - Identities
- A OR True True
- A OR False A
- A OR A A
- A OR B B OR A
- (commutative)
- A AND True A
- A AND False False
- A AND A A
- A AND B B AND A
- (commutative)
20Associative and Distributive Identities
- A AND (B AND C) (A AND B) AND C
- A OR (B OR C) (A OR B) OR C
- A OR (B AND C) (A OR B) AND (A OR C)
- A AND (B OR C) (A AND B) OR (A AND C)
- Exercise using truth tables prove -
- A AND (A OR B) A
21Solution A AND (A OR B) A
22Using Identities
- A OR (B AND C) (A OR B) AND (A OR C)
- A AND (B OR C) (A AND B) OR (A AND C)
- A AND (A OR B) A
- A OR A A
- Exercise - using identities prove
- A OR (A AND B) A
- A AND (A OR B) A
- A OR (A AND B) (A OR A) AND (A OR B)
23Identities with NOT
- NOT (NOT A) A
- A OR NOT A True
- A AND NOT A False
- On and on and on and on
24DeMorgans Laws
- NOT (A OR B) NOT A AND NOT B
- (A B) (A) (B)
- NOT (A AND B) NOT A OR NOT B
- (AB) A B
- Exercise - Simplify the following with identities
- NOT (NOT A AND B)
25Solving a Truth Table
26Solving a Truth Table
27Exercise 1 Solving a Truth Table
28Exercise1 Solving a Truth Table
29Exercise2 Solving a Truth Table