Truth Tables and Operations in Boolean Algebra
- A truth table allows us to evaluate all possible values for a Boolean expression.
- We will first use truth tables to show the value of the operations (think addition table or multiplication table)
- We will then use truth tables to evaluate Boolean expressions.
- There are 5 you need to memorize.
- You should put them on your cheat sheet
- But that will be slow to use.
- Fortunately they are easy.
- A truth table shows input on the left hand side, and output on the right hand side.
- Negation
- The truth table for negation (not)
- Negation flips the truth of the statement.
- Negate a true statement it becomes false
- Negate a false statement it becomes true.
- Conjunction (and)
- And connects two statements.
- The result is true only if both statements are true.
- The truth table has 2 inputs.
- And four rows.
-
p | q | p∧q |
T | T | T |
T | F | F |
F | T | F |
F | F | F |
- Disjunction (or)
- Or connects two statements.
- The result is true if one, or the other or both are true
-
p | q | p∨q |
T | T | T |
T | F | T |
F | T | T |
F | F | F |
- Conditional (if then)
- Conditional connects two statements.
- This one is a little different
-
p | q | p→q |
T | T | T |
T | F | F |
F | T | T |
F | F | T |
- Think: If you get an A, I will buy you an ice cream cone.
- Biconditionl (if and only if)
- Or connects two statements.
- The result is true if the inputs are the same.
-
p | q | p↔q |
T | T | T |
T | F | F |
F | T | F |
F | F | T |
- Think I will buy you an ice cream cone if and only if you get an A.
- Constructing A truth table
- Build the input
- For i variables, there will be 2i rows.
- 1 variable - 2 rows
- 2 variables - 4 rows
- 3 variables - 8 rows.
- I won't go higher than this.
- Start with T, work to false.
- T - F
- TT - TF - FT - FF
- TTTT - TTF - TFT - TFF - FTT - FTF - FFT - FFF
- Notice the last column alternates: T-F-T-F
- The second alternates by 2 : Tx - Tx - Fx - Fx
- The third alternates by 4 : Txx - Txx - Txx - Txx - Fxx - Fxx - Fxx - Fxx
- Build the output
- Two methods, build by order of operations
- Build under the equation.
- Do some exercises P 115
- Do some exercises P 124
- A self contradiction is a compound statement that is always false
- A tautology is a compound statement that is always true
- A implication is a conditional statement that is a tautology
- Do some exercises P 125 31-42