Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male OR I am male
Boolean Logic Paul Bui Subject: Computer Science Level: High School
Warmup Extended x = I have brown hair y = I am wearing glasses I have brown hair AND I am wearing glasses x AND y What are all the possible combinations of T/F?
Warmup Extended x = I am male y = I am wearing sneakers I am male OR I am wearing sneakers x OR y What are all the possible combinations of T/F?
Boolean Operators (T/F) xyx AND y FF FT TF TT xyx OR y FF FT TF TT xNOT x F T
Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xNOT x FT TF
Boolean Operators (1/0) xyx AND y xyx OR y xNOT x 01 10
Warmup Reviewed x = I am male I am NOT male OR I am male (NOT x) OR x What are all the possible combinations of T/F?
Questions?
Boolean Operators Symbols OperatorSymbol NOTā (overbar), a’, ~a AND· (mult. dot) OR+
Boolean Expressions Follows a logical order of operations 1. Parentheses 2. NOT operators 3. AND 4. OR Example: x + y·z
Truth Tables Write out table of all possible combinations of truth values Evaluate the boolean expression for all combinations Example x + y·z xyz FFFF FFTF FTFF FTTT TFFT TFTT TTFT TTTT
Example What is the truth table for: ~x + y? xy~x + y FFT FTT TFF TTT
Another Example What is the truth table for: x · (~y)? xyx·(~y) FFF FTF TFT TTF
Your Turn What is the truth table for the boolean expression: x + ~y + z?