Upcoming SlideShare
×

# Logic

3,596 views

Published on

Published in: Education, Technology, Spiritual
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
3,596
On SlideShare
0
From Embeds
0
Number of Embeds
1,506
Actions
Shares
0
62
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Logic

1. 1. Discrete Mathematics Propositional Logic Harshit KumarSlides borrowed from Wong Chung Hoi of CUHK
2. 2. Agenda• Proposition (Statement)• Logic Operators• Logical formula• Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
3. 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. 4. He has courage! ?This man has courage!
5. 5. I love bowling!
6. 6. You are doing it wrong! ?Your way of pretending to be a penguin is wrong!
7. 7. Agenda• Proposition (Statement)• Logic Operators• Logical formula• Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
8. 8. Logic Operators• Let p and q be a proposition.• Operators: – Negation – Conjunction – Disjunction – Conditional – Bi-conditional
9. 9. Negation (NOT)• 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. 10. p: 49% different is a lot¬p: 49% different is not a lot
11. 11. p: Elephants are larger than the moon¬p: Elephants are smaller than or equal size to the moon
12. 12. Conjunction (AND)• 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.
13. 13. Disjunction (OR)• 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.
14. 14. Exclusive Or (XOR)• Exclusive Or (XOR) – True only when either p or q is true but not both• Example – Tomorrow is Thursday or tomorrow is Friday.
15. 15. Conditional (If … then …)• 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.)
16. 16. Bi-Conditional (If and only if)• 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
17. 17. Agenda• Proposition (Statement)• Logic Operators• Logical formula• Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
18. 18. Logical Formula• Distribution Laws:• De Morgan’s Laws:• Absorption Laws:
19. 19. Agenda• Proposition (Statement)• Logic Operators• Logical formula• Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
20. 20. Proofing logical equivalent 1• By truth table• E.g. Show that De Morgan’s law
21. 21. Proofing logical equivalent 2• By logical rules• E.g. Show that De Morgan’s Law De Morgan’s Law
22. 22. 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 , ,
23. 23. 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.
24. 24. Constructing Formula 3• Find the logical formula for 1. Truth table 2. When is this formula True?
25. 25. Constructing Formula 33. Simplify De Morgan’s law Distribution Laws Distribution Laws Distribution Laws De Morgan’s law
26. 26. Simplifying Formula• Simplify De Morgan’s law Distribution Laws
27. 27. Summary• What is proposition?• Common logical operator.• Proving Equivalent of formula.• Constructing formula from truth table.• Simplifying formula.