CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis)
Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
Proposition (Statement) A sentence that is either TURE or FALSE – = 2. – = 3. – Let’s end the tutorial now. – This tutorial is boring. – Wake up and listen to me! – There are no aliens. – x > 0. – He is handsome. Tautology – proposition that is always true Contradiction – proposition that is always false ?
He has courage! ? This man has courage!
I love bowling!
You are doing it wrong! ? Your way of pretending to be a penguin is wrong!
Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
Logic Operators Let p and q be a proposition. Operators: – Negation – Conjunction – Disjunction – Conditional – Bi-conditional
Negation (NOT) – Flip the truth value. Example: – p: My car is blue. ¬p: My car is not blue. – p: Peter is good.¬p: Peter is not good. – p: 10 > 15.¬p: 10 < 15 or 10 = 15
p: 49% different is a lot ¬p: 49% different is not a lot
p: Elephants are larger than the moon ¬p: Elephants are smaller than or equal size to the moon
Conjunction (AND) – True only when p and q are True Example: – Quiz one is easy and quiz two is difficult. – Peter is so handsome and smart. – Peter is so handsome and Peter is so smart.
Disjunction (OR) – True when either p or q or both are true. Example – I will go with my sister or I will go with my brother.
Exclusive Or (XOR) – True only when either p or q is true but not both Example – Tomorrow is Thursday or tomorrow is Friday.
Conditional (If … then …) – “If p then q” can only be disproved to be false when p really happens but q doesn’t. – p is sufficient condition q. – q is necessary condition p. – “p if q” = “if q then p” – “p only if q” = “if p then q” Example – If tomorrow is hot, I will go swimming. (If tomorrow is cold, you can’t disprove the statement.)
Bi-Conditional (If and only if) – “p if and only if q” can only be disproved when p happens but not q or vice versa. – p (q) is necessary and sufficient condition for q (p) – Example: – A computer program is correct if and only if it produces correct answer for all possible sets of input data
Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
Logical Formula Distribution Laws: De Morgan’s Laws: Absorption Laws:
Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
Proofing logical equivalent 1 By truth table E.g. Show that De Morgan’s law
Proofing logical equivalent 2 By logical rules E.g. Show that De Morgan’s Law
Constructing Formula 1 By using only Find the logical formula for 1.Truth table 2.When will this formula be True? 3.Simplify Exercise: Try to construct an logical formula for,,
Constructing Formula 2 Find the logical formula for 1.Truth table 2.When will this formula be True? 3.Simplify Exercise: Verify the above formula.
Constructing Formula 3 Find the logical formula for 1.Truth table 2.When is this formula True?
Constructing Formula 3 3.Simplify Distribution Laws De Morgan’s law
Simplifying Formula Simplify De Morgan’s law Distribution Laws
Summary What is proposition? Common logical operator. Proving Equivalent of formula. Constructing formula from truth table. Simplifying formula.