Discrete Mathematics (2009 Spring) Foundations of Logic (S1.1'S1.4, 4 Hours)

Discrete Mathematics (2009 Spring) Foundations of Logic (S1.1'S1.4, 4 Hours)

Discrete Mathematics Discrete Mathematics (2009 Spring) Foundations of Logic (§1.1-§1.4, 4 hours) Chih-Wei Yi Dept. of Computer Science National Chiao Tung University March 1, 2010 Discrete Mathematics Foundations of Logic Foundations of Logic Mathematical Logic is a tool for working with complicated compound statements. It includes: A language for expressing them. A concise notation for writing them. A methodology for objectively reasoning about their truth or falsity. It is the foundation for expressing formal proofs in all branches of mathematics. Discrete Mathematics Foundations of Logic Overview Propositional logic (§1.1-§1.2): Basic de…nitions (§1.1) Equivalence rules & derivations (§1.2) Predicate logic (§1.3-§1.4) Predicates Quanti…ed predicate expressions Equivalences & derivations Discrete Mathematics Foundations of Logic §1.1 Propositional Logic §1.1 Propositional Logic Discrete Mathematics Foundations of Logic §1.1 Propositional Logic De…nition of a Proposition De…nition A proposition (p, q, r, ...) is a declarative sentence with a de…nite meaning, having a truth value that’seither true (T ) or false (F ) (never both, neither, or somewhere in between). However, you might not know the actual truth value, and it might be situation-dependent. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Examples of Propositions Example The following statements are propositions: “It is raining.” (In a given situation.) “Washington D.C. is the capital of China.” “1 + 2 = 3” But, the followings are NOT propositions: “Who’sthere?” (interrogative, question) “La la la la la.” (meaningless interjection) “Just do it!” (imperative, command) “1 + 2” (expression with a non-true/false value) Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Propositional Logic Propositional Logic is the logic of compound statements built from simpler statements using so-called Boolean connectives. Some applications in computer science: Design of digital electronic circuits. Expressing conditions in programs. Queries to databases & search engines. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Operators / Connectives An operator or connective combines one or more operand expressions into a larger expression (e.g., “+” in numeric exprs). Unary operators take 1 operand (e.g., 3); binary operators take 2 operands (e.g., 3 4). Propositional or Boolean operators operate on propositions or truth values instead of on numbers. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Some Popular Boolean Operators Formal Name Nickname Arity Symbol Negation operator NOT Unary Conjunction operator AND Binary : Disjunction operator OR Binary ^ Exclusive-OR operator XOR Binary _ Implication operator IMPLIES Binary Biconditional operator IFF Binary ! ! Discrete Mathematics Foundations of Logic §1.1 Propositional Logic The Negation Operator The unary negation operator " " (NOT) transforms a prop. into its logical negation. : For example, if p = “I have brown hair.”, then p = “I do not have brown hair.”. : Truth table for NOT: Operand Result column column T : True; F : False p Øp “: ” means “is de…ned as” T F F T Discrete Mathematics Foundations of Logic §1.1 Propositional Logic The Conjunction Operator The binary conjunction operator “ ” (AND) combines two propositions to form their logical conjunction.^ Example p =“I will have salad for lunch.” q =“I will have steak for dinner.” p q =“I will have salad for lunch and I will have steak for dinner.”^ Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Conjunction Truth Table Note that a conjunction p1 p2 pn of n propositions will have 2n rows in its truth^ table.^ ^ and operations together are su¢ cient to express any Boolean: ^ truth table with only 1 True value. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic The Disjunction Operator The binary disjunction operator “ ” (OR) combines two propositions to form their logical disjunction._ Example p =“My car has a bad engine.” q =“My car has a bad carburetor.” p q =“Either my car has a bad engine, or my car has a bad carburetor.”_ Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Disjunction Truth Table Note that p q means that p is true, or q is true,or both are true! _ So, this operation is also called inclusive or, because it includes the possibility that both p and q are true. and operations together are su¢ cient to express any Boolean: _ truth table with only 1 False value. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Precedence of Logical Operators Use parentheses to group sub-expressions, for example “I just saw my old f riend, and either he’s grown or I’ve shrunk.”= f (g s). ^ _ (f g) s would mean something di¤erent. f ^g _s would be ambiguous. ^ _ By convention, " " takes precedence over both “ ” and “ ”. : ^ _ s f means ( s) f , not (s f ). : ^ : ^ : ^ “The lawn was wet this morning, and it didn’train last night.” “Either the lawn wasn’twet this morning,or it rained lastnight, or thes prinklers came on lastnight.” Discrete Mathematics Foundations of Logic §1.1 Propositional Logic A Simple Exercise Let p =“It rained last night.”, q =“The sprinklers came on last night.”, and r =“The lawn was wet this morning.” Translate each of the following into English: p : “It didn’train lastnight.” r p ^ : r p q : _ _ “Either the lawn wasn’twet this morning,or it rained lastnight, or thes prinklers came on lastnight.” Discrete Mathematics Foundations of Logic §1.1 Propositional Logic A Simple Exercise Let p =“It rained last night.”, q =“The sprinklers came on last night.”, and r =“The lawn was wet this morning.” Translate each of the following into English: p : “It didn’train lastnight.” r p ^ : “The lawn was wet this morning, and it didn’train last night.” r p q : _ _ Discrete Mathematics Foundations of Logic §1.1 Propositional Logic A Simple Exercise Let p =“It rained last night.”, q =“The sprinklers came on last night.”, and r =“The lawn was wet this morning.” Translate each of the following into English: p : “It didn’train lastnight.” r p ^ : “The lawn was wet this morning, and it didn’train last night.” r p q : _ _ “Either the lawn wasn’twet this morning,or it rained lastnight, or thes prinklers came on lastnight.” Discrete Mathematics Foundations of Logic §1.1 Propositional Logic The Exclusive OR Operator The binary exclusive-or operator “ ” (XOR) combines two propositions to form their logical “exclusive or” (exjunction?). p =“I will earn an A in this course,” q =“I will drop this course,” p q =“I will either earn an A for this course, or I will drop it (but not both!)” Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Exclusive-OR Truth Table Note that p q means that p is true, or q is true, but not both! This operation is called exclusive or, because it excludes the possibility that both p and q are true. “ “ and “ ” together are not universal. : Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Natural Language is Ambiguous Note that English “or” can be ambiguous regarding the “both” case! “Pat is a singer or Pat is a writer.” - “Pat is a man or Pat is a woman.” - _ Need context to disambiguate the meaning! For this class, assume “or” means inclusive. Discrete Mathematics Foundations of Logic §1.1 Propositional Logic The Implication Operator The implication statement "p implies q" is denoted by In other words, if p is true, then q is true; but if p is not true, then q could be either true or false. Example Let p =“You study hard.” and q =“You will get a good grade.”. Then, p q =“If you study hard, then you will get a good grade.” (else,! it could go either way) Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Implication Truth Table p q is false only when p is true but q is not true. ! p q does not say that p causes q! ! p q does not require that p or q are ever true! e.g. “(1=0)! pigs can ‡y”is TRUE! ! False True True Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? True “If Tuesday is a day of the week, then I am a penguin.” True or False? “If 1+1=6, then Bush is president.” True or False? “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False? True True Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? True “If Tuesday is a day of the week, then I am a penguin.” True or False? False “If 1+1=6, then Bush is president.” True or False? “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False? True Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? True “If Tuesday is a day of the week, then I am a penguin.” True or False? False “If 1+1=6, then Bush is president.” True or False? True “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False? Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? True “If Tuesday is a day of the week, then I am a penguin.” True or False? False “If 1+1=6, then Bush is president.” True or False? True “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False? True Discrete Mathematics Foundations of Logic §1.1 Propositional Logic Why Does This Seem Wrong? Consider a sentence like, “If I wear a red shirt tomorrow, then the U.S.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    83 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us