1 / 48

Propositional Logic

Propositional Logic. Sec. 1.1-1.3 12-May. 1. Is the reasoning in your argument valid?. All MSU students are brilliant. You are an MSU student. Therefore, you are brilliant.

selma
Download Presentation

Propositional Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Propositional Logic Sec. 1.1-1.3 12-May Propositional Logic 1

  2. Is the reasoning in your argument valid? • All MSU students are brilliant. You are an MSU student. Therefore, you are brilliant. • If space creatures were kidnapping people and examining them, the space creatures would probably hypnotically erase the memories of the people they examined. These people would thus suffer from amnesia. But in fact many people do suffer from amnesia. This tends to prove they were kidnapped and examined by space creatures. http://www.don-lindsay-archive.org/skeptic/arguments.html • Goal: Learn how to represent such an argument unambiguously, and to determine if it is valid or fallacious. 2 Propositional Logic

  3. Propositions • Definition: A proposition is a statement that is either true or false Egypt is in Africa. Your driver’s side door is not shut. 7*119 is an even integer. Global warming is irreversible. • Truth Values true, false 1, 0 yes, no 3 Propositional Logic

  4. Which are propositions? Their truth values? • 2 + 2 = 4 • It is a proposition. Its truth value is True • 1 = 0 • It is a proposition. Its truth value is False • It will rain tomorrow in East Lansing. • It is a proposition. We’ll know its truth value tomorrow! • Go Green! • Not a proposition • 5 • Not a proposition 4 Propositional Logic

  5. Example • This proposition is false. • Not a proposition • This proposition is true. • Not a proposition • These are examples of self-referential statements; they are not considered propositions 5 Propositional Logic

  6. Notation • We shall use the letters p, q, r, s and so on to stand for propositions. • We write:p: “Lansing is the capital of Michigan.”q: “Horses have nine lives.” • Read it as • p is the proposition “Lansing is the capital of Michigan.” • q stands for “Horses have nine lives.” 6 Propositional Logic

  7. Compound Propositions • New propositions can be formed from existing propositions using logical operators: • Negation ¬ • Conjunction (and) ∧ • Disjunction (or) ∨ • Exclusive OR  • Conditional/Implication  • Biconditional 7 Propositional Logic

  8. Negation • Definition: Letp be a proposition. The negation of p, denoted ¬p, is the proposition that is true, if p is false, and false, if p is true. • Read as ‘It is not the case that p.’ • Example • p: “Lansing is the capital of Michigan” • ¬p: “It is not the case that Lansing is the capital of Michigan” i.e., “Lansing is not the capital of Michigan.” • q: “Fish are mammals.” • ¬q: “It is not the case that fish are mammals” i.e., “Fish are not mammals.” 8 Propositional Logic

  9. Truth Table • Shows the relationship between the value of a compound proposition and its sub-propositions. • Truth table of ¬p 9 Propositional Logic

  10. Conjunction • Definition: Let p and q be propositions. The conjunction of p and q, denoted p  q, is the proposition that is: • true when both p and q are true, and • false otherwise • Example: Let p: “the butler did it” q: “the cook did it.” • What does p  q say? • Solution: “Both the butler and the cook did it.” 10 Propositional Logic

  11. Truth Table for pq 11 Propositional Logic

  12. Disjunction • Definition: Let p and q be propositions. The disjunction of p and q, denoted pq, is the proposition that is: • false when both p and q are false, and true otherwise. • Example: • Let p: “the butler did it” q: “the cook did it.” • What does pq say? • Solution: “Either the butler or the cook did it (or both).” Note: In natural language, “or” can be ambiguous; but not in logic! 12 Propositional Logic

  13. Truth Table for p  q Note the difference between inclusive and exclusive OR in English 13 Propositional Logic

  14. Exclusive OR • Definition: Let p and q be propositions. The Exclusive OR of p and q, written p  q, is the proposition that is true when exactly one ofp and q istrue; and is false, otherwise. • Examples: • “A student in CSE 260 is enrolled in either Section 1 or Section 2”. • “A positive integer is either odd or even.” 14 PROPOSITIONAL LOGIC

  15. Truth table for p q 15 PROPOSITIONAL LOGIC

  16. Conditional Proposition (Implication) • Definition: Let p and q be propositions. The conditional proposition, also called implication,pqis the proposition that is: • false when p istrue and q is false, and true otherwise. 16 Propositional Logic

  17. Conditional Proposition (Implication) • Examples: • “If you have a BS with a major in CSE from MSU, then you know some propositional logic.” • “If you know some propositional logic, then you have a BS with a major in CS from MSU.” 17 Propositional Logic

  18. More on pq The implies operator interpreted as a guarantee: • If pq is true andif p is true, then q is guaranteed to also be true. • But, if pq is true and p is false, then we cannot conclude anything about the value of q. • Ex: Let p = “It is raining”, q = “There are clouds in the sky” • Then pq stands for: “If it is raining then there are clouds in the sky.” 18 Propositional Logic

  19. More on pq • There does not need to be a cause and effect relationship for pq to be true. • “If I can walk then snow is cold.” • “If pigs can fly, then I am the master of the universe.” 19 Propositional Logic

  20. More on pq … • Terminologies used to express pq: • If p then q • p implies q • p only if q • p is a sufficient condition for q • q follows from p • q is a necessary condition for p • q if p • q when p • q whenever p • q unless ¬p 20 Propositional Logic

  21. More on pq … • Other propositions related to pq: • qp is called the converse; • If there are clouds in the sky then it is raining . • ¬p¬q is called the inverse; • If it is not raining then there are no clouds in the sky • ¬q¬p is the contrapositive. • If there no clouds in the sky then it is not raining. 21 Propositional Logic

  22. Biconditional • Definition: Let p and q be propositions. The biconditional pq is the proposition that is true whenp and q have the same truth values, and false otherwise. 22 PROPOSITIONAL LOGIC

  23. Biconditional • The biconditional pq is read as ‘p if and only ifq’ or ‘p precisely if q’ • You can log into your CSE computer account if and only if you enter your user name and password correctly. • Execution reaches line 25 of this program precisely if the values of X and Y are both positive. • Note:pq is true if and only if both of the implications pq and qp are true. 23 PROPOSITIONAL LOGIC

  24. Summary of logical operations How many logical operators can we define? 24 PROPOSITIONAL LOGIC

  25. Application sidebar • Computer circuitry is built to implement logical combinations of bits. • Majors will learn to implement all of the above operations – using transistors and C/C++. • All the above operations can be expressed using just a single operation: NAND¬ (pq) • All the above operations can also be expressed using only the operation: NOR¬ (pq) PROPOSITIONAL LOGIC

  26. Status check • So, we all know the “basic connectives” or “basic operators” • There are 16 boolean functions/operations with two propositions. • BIG IDEA: all boolean functions/operations of two arguments/operands can be constructed using only not, and, or • BIG IDEA: since we can replace not, and, or with NAND (or NOR) all of these functions can be constructed with NAND (or NOR) only PROPOSITIONAL LOGIC

  27. Well-formed Formulas • A well-formed formula (wff) can be generated by using one or more of the following rules finitely many times • A propositional variable standing alone is a wff. • T is a wff and F is a wff. • If f is a wff, so are¬ f and ( f ). • If f and g are wffs, so are:fgfgf gf  g . . . • Example: • If p, q, and r are propositional variables, then the following are both propositional formulas (i.e., wffs): p  ¬ q  r pq  ¬ q  (r q) PROPOSITIONAL LOGIC

  28. Precedence of Logical Operators Example: • p  ¬ q  r • p  ((¬ q ) r) Exercise #1: What about • p  ¬ q  r • (p  (¬ q))  r • p  ¬ q  r  ¬ q • p  ((¬ q)  r)  (¬ q) A compiler implements an algorithm for checking if a string represents a wff. It creates an “expression tree” representing a wff and the order of operations to be used to compute the wff’s value for some truth assignments. 28 PROPOSITIONAL LOGIC

  29. Tautology, Contradiction, Contingency • Tautology: A wff (proposition) that is true regardless of the truth values of its propositional variables (atomic propositions). • A tautology is true by virtue of logic. • Contradiction: A wff (proposition) that is false regardless of the truth values of its propositional variables (atomic propositions). • A contradiction is false by virtue of logic. • Contingency: A wff (proposition) that is not a tautology and also not a contradiction. 29 PROPOSITIONAL LOGIC

  30. Example • ¬ pis a contingency. • p¬p is a tautology. • p ¬p is a contradiction. 30 PROPOSITIONAL LOGIC

  31. Exercise #2 Classify each of the following propositions as a tautology, a contradiction, or a contingency: • “This instruction produced a run-time error.” • A contingency • “Either this instruction produced a run-time error or it did not produce a run-time error.” • A tautology. • “Either this instruction produced a run-time error or another instruction produced a run-time error.” • A contingency • “This instruction produced a run-time error, but it did not produce a run-time error.” • A contradiction. 31 PROPOSITIONAL LOGIC

  32. Propositional Equivalences • Definition: Two wffs f and g are logically equivalent, if they have the same truth values in all possible cases. • In this case, we write:f ≡ g • Note: f≡g if and only if fgis . . . a tautology. 32 PROPOSITIONAL LOGIC

  33. How to show logical equivalences? • By means of a Truth Table. • Already did a few examples • If n propositions, then 2n rows of truth table • By derivation, using known logical equivalences. 33 PROPOSITIONAL LOGIC

  34. Some Important Equivalences 34 PROPOSITIONAL LOGIC

  35. Some Important Equivalences See tables 6,7,8 in the Rosen text, pages 27 and 28. 35 PROPOSITIONAL LOGIC

  36. Example: ¬ (p  q) ≡ ¬ p ¬ q 36 PROPOSITIONAL LOGIC

  37. Example: ¬ (p  q) ≡ ¬ p ¬ q 37 PROPOSITIONAL LOGIC

  38. Example: ¬ (p  q) ≡ ¬ p ¬ q 38 PROPOSITIONAL LOGIC

  39. Example: ¬ (p  q) ≡ ¬ p ¬ q 39 PROPOSITIONAL LOGIC

  40. Example: p  (q  r) ≡ (p  q)  (p  r) A final column, for p  (q  r)  (p  q)  (p  r), is not strictly needed. It sufficesto notice that the 5th and 8th columns are identical. 41 PROPOSITIONAL LOGIC

  41. Exercise #3: Which of these conditionals are equivalent? 42 PROPOSITIONAL LOGIC

  42. Exercise #3: Which of these conditionals are equivalent? 43 PROPOSITIONAL LOGIC

  43. Exercise #3: Which of these conditionals are equivalent? 44 PROPOSITIONAL LOGIC

  44. Exercise #3: Which of these conditionals are equivalent? 45 PROPOSITIONAL LOGIC

  45. Show that ¬ (p (¬p  q)) ≡ ¬p ¬q ¬ (p (¬p  q)) ≡ ¬p¬ (¬p q) De Morgan’s law ≡ ¬p (¬ (¬p)  ¬q) De Morgan’s law ≡ ¬p (p ¬q) Double negation ≡ (¬pp)  (¬p ¬q) Distributive law ≡ F (¬p ¬q) Contradiction ≡(¬p ¬q)  F Commutative ≡ ¬p ¬q Identity law 46 PROPOSITIONAL LOGIC

  46. Example • Show that (pq)→ (pq) is a tautology using a derivation. • In other words, show: [(pq)→ (pq)] ≡T (pq)→ (pq) ≡ ¬ (pq)(pq)Implication ≡ (¬p ¬q)(pq)De Morgan’s law ≡ (¬p p)(¬q q)Assoc. & Comm. ≡ T TTautology ≡ TDomination 47 PROPOSITIONAL LOGIC

  47. Logic • Logic is the underpinning of all reasoned argument. The Greeks recognized its role in mathematics and philosophy, and studied it extensively. • Aristotle, in his Organon, wrote the first systematic treatise on logic. His work in particular had a heavy influence on philosophy, science and religion through the Middle Ages. • But Aristotle's logic was logic expressed in ordinary language, so was still subject to the ambiguities of natural languages. • Philosophers began to want to express logic more formally and symbolically, in the way that mathematics is written (Leibniz, in the 17th century, was probably the first to envision and call for such a formalism). • It was with the publication in 1847 of G. Boole's The Mathematical Analysis of Logic and A. DeMorgan's Formal Logic that symbolic logic came into being, and logic became recognized as part of mathematics. This also marked the recognition that mathematics is not just about numbers (arithmetic) and shapes (geometry), but encompasses any subject that can be expressed symbolically with precise rules of manipulation of those symbols. 48 Propositional Logic

  48. Logic… • Since Boole and DeMorgan, logic and mathematics have been inextricably intertwined. • Logic is part of mathematics, but at the same time it is the language of mathematics. • In the late 19th and early 20th century it was believed that all of mathematics could be reduced to symbolic logic and made purely formal. This belief, though still held in modified form today, was shaken by K. Gödel in the 1930's, when he showed that there would always remain truths that could not be derived in any such formal system. Mathematician Hilbert was crushed! • The study of symbolic logic is usually broken into several parts. The first and most fundamental is the propositional logic, and on top of this is the predicate logic, which is the language of mathematics. Source: http://people.hofstra.edu/faculty/Stefan_Waner/RealWorld/logic/logicintro.html 49 Propositional Logic

More Related