Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis) 26-10-2011.

Similar presentations


Presentation on theme: "CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis) 26-10-2011."— Presentation transcript:

1 CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis) chwong@cse.cuhk.edu.hk 26-10-2011

2 Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula

3 Proposition (Statement) A sentence that is either TURE or FALSE – 1 + 1 = 2. – 1 + 1 = 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 ?

4 He has courage! ? This man has courage!

5 I love bowling!

6 You are doing it wrong! ? Your way of pretending to be a penguin is wrong!

7 Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula

8 Logic Operators Let p and q be a proposition. Operators: – Negation – Conjunction – Disjunction – Conditional – Bi-conditional

9 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

10

11 p: 49% different is a lot ¬p: 49% different is not a lot

12 p: Elephants are larger than the moon ¬p: Elephants are smaller than or equal size to the moon

13 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.

14 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.

15 Exclusive Or (XOR) – True only when either p or q is true but not both Example – Tomorrow is Thursday or tomorrow is Friday.

16 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.)

17 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

18 Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula

19 Logical Formula Distribution Laws: De Morgan’s Laws: Absorption Laws:

20 Agenda Proposition (Statement) Logic Operators Logical formula Problems – Proofing formula – Constructing formula from truth table – Simplifying formula

21 Proofing logical equivalent 1 By truth table E.g. Show that De Morgan’s law

22 Proofing logical equivalent 2 By logical rules E.g. Show that De Morgan’s Law

23 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,,

24 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.

25 Constructing Formula 3 Find the logical formula for 1.Truth table 2.When is this formula True?

26 Constructing Formula 3 3.Simplify Distribution Laws De Morgan’s law

27 Simplifying Formula Simplify De Morgan’s law Distribution Laws

28 Summary What is proposition? Common logical operator. Proving Equivalent of formula. Constructing formula from truth table. Simplifying formula.


Download ppt "CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis) 26-10-2011."

Similar presentations


Ads by Google