Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
CS128 – Discrete Mathematics for Computer Science
Discrete Mathematics CSE 2353 Fall 2007
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
So far we have learned about:
Discrete Mathematics Math 6A Instructor: M. Welling.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
Adapted from Discrete Math
Harper Langston New York University Summer 2015
Methods of Proof & Proof Strategies
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
1 Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements.
Discrete Mathematics, Part II CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some slides.
MATH 224 – Discrete Mathematics
Review I Rosen , 3.1 Know your definitions!
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
Discrete Mathematics CS 2610 August 24, Agenda Last class Introduction to predicates and quantifiers This class Nested quantifiers Proofs.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Discrete Structures (DS)
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
DISCRETE COMPUTATIONAL STRUCTURES
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2005.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Method of proofs.  Consider the statements: “Humans have two eyes”  It implies the “universal quantification”  If a is a Human then a has two eyes.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
CS104:Discrete Structures Chapter 2: Proof Techniques.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Lecture 10 Methods of Proof CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems.
Chapter 1 Logic and proofs
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
Discrete Mathematics Margaret H. Dunham
Foundations: Sets, Logic, and Algorithms
2. The Logic of Compound Statements Summary
3. The Logic of Quantified Statements Summary
Advanced Algorithms Analysis and Design
CSNB 143 Discrete Mathematical Structures
Discrete Mathematics Logic.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
CS201: Data Structures and Discrete Mathematics I
Information Technology Department
CHAPTER 1: LOGICS AND PROOF
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Applied Discrete Mathematics Week 1: Logic
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Mathematical Reasoning
CS201: Data Structures and Discrete Mathematics I
Rules of inference Section 1.5 Monday, December 02, 2019
Presentation transcript:

Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical connectives to combine statements  Explore how to draw conclusions using various argument forms  Become familiar with quantifiers and predicates  CS  Boolean data type  If statement  Impact of negations  Implementation of quantifiers

Discrete Mathematical Structures: Theory and Applications 2 Mathematical Logic  Definition: Methods of reasoning, provides rules and techniques to determine whether an argument is valid  Theorem: a statement that can be shown to be true (under certain conditions)  Example: If x is an even integer, then x + 1 is an odd integer  This statement is true under the condition that x is an integer is true

Discrete Mathematical Structures: Theory and Applications 3 Mathematical Logic  A statement, or a proposition, is a declarative sentence that is either true or false, but not both  Lowercase letters denote propositions  Examples:  p: 2 is an even number (true)  q: 3 is an odd number (true)  r: A is a consonant (false)  The following are not propositions:  p: My cat is beautiful  q: Are you in charge?

Discrete Mathematical Structures: Theory and Applications 4 Mathematical Logic  Truth value  One of the values “truth” or “falsity” assigned to a statement  True is abbreviated to T or 1  False is abbreviated to F or 0  Negation  The negation of p, written ∼ p, is the statement obtained by negating statement p  Truth values of p and ∼ p are opposite  Symbol ~ is called “not” ~p is read as as “not p”  Example:  p: A is a consonant  ~p: it is the case that A is not a consonant  q: Are you in charge?

Discrete Mathematical Structures: Theory and Applications 5 Mathematical Logic  Truth Table  Conjunction  Let p and q be statements.The conjunction of p and q, written p ^ q, is the statement formed by joining statements p and q using the word “and”  The statement p ∧ q is true if both p and q are true; otherwise p ∧ q is false

Discrete Mathematical Structures: Theory and Applications 6 Mathematical Logic  Conjunction  Truth Table for Conjunction:

Discrete Mathematical Structures: Theory and Applications 7 Mathematical Logic  Disjunction  Let p and q be statements. The disjunction of p and q, written p v q, is the statement formed by joining statements p and q using the word “or”  The statement p v q is true if at least one of the statements p and q is true; otherwise p v q is false  The symbol v is read “or”

Discrete Mathematical Structures: Theory and Applications 8 Mathematical Logic  Disjunction  Truth Table for Disjunction:

Discrete Mathematical Structures: Theory and Applications 9 Mathematical Logic  Implication  Let p and q be statements.The statement “if p then q” is called an implication or condition.  The implication “if p then q” is written p  q  p  q is read:  “If p, then q”  “p is sufficient for q”  q if p  q whenever p

Discrete Mathematical Structures: Theory and Applications 10 Mathematical Logic  Implication  Truth Table for Implication:  p is called the hypothesis, q is called the conclusion

Discrete Mathematical Structures: Theory and Applications 11 Mathematical Logic  Implication  Let p: Today is Sunday and q: I will wash the car. The conjunction p  q is the statement:  p  q : If today is Sunday, then I will wash the car  The converse of this implication is written q  p  If I wash the car, then today is Sunday  The inverse of this implication is ~p  ~q  If today is not Sunday, then I will not wash the car  The contrapositive of this implication is ~q  ~p  If I do not wash the car, then today is not Sunday

Discrete Mathematical Structures: Theory and Applications 12 Mathematical Logic  Biimplication  Let p and q be statements. The statement “p if and only if q” is called the biimplication or biconditional of p and q  The biconditional “p if and only if q” is written p  q  p  q is read:  “p if and only if q”  “p is necessary and sufficient for q”  “q if and only if p”  “q when and only when p”

Discrete Mathematical Structures: Theory and Applications 13 Mathematical Logic  Biconditional  Truth Table for the Biconditional:

Discrete Mathematical Structures: Theory and Applications 14 Mathematical Logic  Statement Formulas  Definitions  Symbols p,q,r,...,called statement variables  Symbols ~, ^, v, →,and ↔ are called logical connectives 1)A statement variable is a statement formula 2)If A and B are statement formulas, then the expressions (~A ), (A ^ B), (A v B ), (A → B ) and (A ↔ B ) are statement formulas  Expressions are statement formulas that are constructed only by using 1) and 2) above

Discrete Mathematical Structures: Theory and Applications 15 Mathematical Logic  Precedence of logical connectives is:  ~ highest  ^ second highest  v third highest  → fourth highest  ↔ fifth highest

Discrete Mathematical Structures: Theory and Applications 16 Mathematical Logic  Example:  Let A be the statement formula (~(p v q )) → (q ^ p )  Truth Table for A is:

Discrete Mathematical Structures: Theory and Applications 17 Mathematical Logic  Tautology  A statement formula A is said to be a tautology if the truth value of A is T for any assignment of the truth values T and F to the statement variables occurring in A  Contradiction  A statement formula A is said to be a contradiction if the truth value of A is F for any assignment of the truth values T and F to the statement variables occurring in A

Discrete Mathematical Structures: Theory and Applications 18 Mathematical Logic  Logically Implies  A statement formula A is said to logically imply a statement formula B if the statement formula A → B is a tautology. If A logically implies B, then symbolically we write A → B  Logically Equivalent  A statement formula A is said to be logically equivalent to a statement formula B if the statement formula A ↔ B is a tautology. If A is logically equivalent to B, then symbolically we write A ≡ B

Discrete Mathematical Structures: Theory and Applications 19 Mathematical Logic

Discrete Mathematical Structures: Theory and Applications 20 Mathematical Logic  Proof of (~p ^ q ) → (~(q →p ))

Discrete Mathematical Structures: Theory and Applications 21 Mathematical Logic  Proof of (~p ^ q ) → (~(q →p )) [continued]

Discrete Mathematical Structures: Theory and Applications 22 Validity of Arguments  Proof: an argument or a proof of a theorem consists of a finite sequence of statements ending in a conclusion  Argument: a finite sequence of statements.  The final statement,, is the conclusion, and the statements are the premises of the argument.  An argument is logically valid if the statement formula is a tautology.

Discrete Mathematical Structures: Theory and Applications 23 Validity of Arguments - Example P QR PremisesValid TTTTTTTT TTFTFFFT TFTFTFTT TFFFTFFT FTTTTTTT FTFTFFTT FFTTTTTT FFFTTTTT

Discrete Mathematical Structures: Theory and Applications 24 Validity of Arguments  Valid Argument Forms  Modus Ponens (Method of Affirming) P Q Premises Conclusion Q Valid TTTTTT TFFFFT FTTFTT FFTFFT

Discrete Mathematical Structures: Theory and Applications 25 Validity of Arguments  Valid Argument Forms  Modus Tollens (Method of Denying) P Q Premises Conclusion Valid TTT F FFT TFF T FFT FTT F FTT FFT T TTT

Discrete Mathematical Structures: Theory and Applications 26 Validity of Arguments  Valid Argument Forms  Disjunctive Syllogisms

Discrete Mathematical Structures: Theory and Applications 27 Validity of Arguments  Valid Argument Forms  Hypothetical Syllogism (proven earlier)  Dilemma

Discrete Mathematical Structures: Theory and Applications 28 Validity of Arguments  Valid Argument Forms  Conjunctive Simplification

Discrete Mathematical Structures: Theory and Applications 29 Validity of Arguments  Valid Argument Forms  Disjunctive Addition

Discrete Mathematical Structures: Theory and Applications 30 Validity of Arguments  Valid Argument Forms  Conjunctive Addition

Discrete Mathematical Structures: Theory and Applications 31 Validity of Arguments – Formal Derivation  Prove  Formal Derivation Rule Comment 1. P  Q Premise 2. Q  R Premise 3. P Assumption Assume P 4. Q 1,3, MP 5. R 2,4, MP R is now proved 6. P  R DT Discharge P, ie, P is no longer to be used, and conclude that P  R  Uses Deduction Theorem (DT)

Discrete Mathematical Structures: Theory and Applications 32 Quantifiers and First Order Logic  Have dealt with Propositional Logic (Calculus) so far  Propositional variables, constants, expressions  Dealt with truth or falsity of expressions as a whole  Consider: 1. All cats have tails 2. Tom is a cat 3. Tom has a tail  Cannot conclude 3, given 1 and 2 using propositional logic  Predicate Calculus – allows us to identify individuals such as Tom together with properties and predicates.

Discrete Mathematical Structures: Theory and Applications 33 Quantifiers and First Order Logic  Predicate or Propositional Function  Let x be a variable and D be a set; P(x) is a sentence  Then P(x) is called a predicate or propositional function with respect to the set D if for each value of x in D, P(x) is a statement; i.e., P(x) is true or false  Moreover, D is called the domain of the discourse and x is called the free variable

Discrete Mathematical Structures: Theory and Applications 34 Quantifiers and First Order Logic Propositional function example #1 Let P(x) be the statement: x is an odd integer Let D be the set of all positive integers. Then P is a propositional function with domain of discourse D. For each x in D, P(x) is a proposition, i.e. a sentence which is either true or false. P(1): 1 is an odd integer – True P(14): 14 is an odd integer - False

Discrete Mathematical Structures: Theory and Applications 35 Quantifiers and First Order Logic Propositional function example #2 Let P(x) be the statement: the baseball player hit over.300 in 2003 Let D be the set of all baseball players. Then P is a propositional function with domain of discourse D. For each x in D, P(x) is a proposition, i.e. a sentence which is either true or false. P(Barry Bonds): Barry Bonds hit over.300 in True P(Alex Rodriguez): Alex Rodriguez hit over.300 in False

Discrete Mathematical Structures: Theory and Applications 36 Quantifiers and First Order Logic  Predicate or Propositional Function  Example:  Q(x,y) : x > y, where the Domain is the set of integers  Q is a 2-place predicate  Q is T for Q(4,3) and Q is F for Q (3,4)

Discrete Mathematical Structures: Theory and Applications 37 Quantifiers and First Order Logic  Universal Quantifier  Let P(x) be a predicate and let D be the domain of the discourse. The universal quantification of P(x) is the statement:  For all x, P(x) or  For every x, P(x)  The symbol is read as “for all and every”   Two-place predicate:

Discrete Mathematical Structures: Theory and Applications 38 Quantifiers and First Order Logic  Universal Quantifier Examples  Consider the statement  It is true if P(x) is true for every x in D  It is false if P(x) is false for at least one x in D  Consider with D being the set of all real numbers.  The statement is true because for every real number x, it is true that the square of x is positive or zero.  Consider that with D being the set of real numbers is false. Why?

Discrete Mathematical Structures: Theory and Applications 39 Quantifiers and First Order Logic  Existential Quantifier  Let P(x) be a predicate and let D be the domain of the discourse. The existential quantification of P(x) is the statement:  There exists x, P(x)  The symbol is read as “there exists”   Bound Variable  The variable appearing in: or

Discrete Mathematical Structures: Theory and Applications 40 Quantifiers and First Order Logic  Existential Quantifier Example  Consider  It is true since there is at least one real number x for which the proposition is true. Try x=2  Suppose that P is a propositional function whose domain of discourse consists of the elements d1,…,dn. The following pseudocode determines whether is true.

Discrete Mathematical Structures: Theory and Applications 41 Quantifiers and First Order Logic  Negation of Predicates (DeMorgan’s Laws)   Example:  If P(x) is the statement “x has won a race” where the domain of discourse is all runners, then the universal quantification of P(x) is, i.e., every runner has won a race. The negation of this statement is “it is not the case that every runner has won a race. Therefore there exists at least one runner who has not won a race. Therefore: and so,

Discrete Mathematical Structures: Theory and Applications 42 Quantifiers and First Order Logic  Negation of Predicates (DeMorgan’s Laws) 

Discrete Mathematical Structures: Theory and Applications 43 Quantifiers and First Order Logic  Formulas in Predicate Logic  All statement formulas are considered formulas  Each n, n =1,2,...,n-place predicate P( ) containing the variables is a formula.  If A and B are formulas, then the expressions ~A, (A ∧ B), (A ∨ B), A →B and A↔B are statement formulas, where ~, ∧, ∨, → and ↔ are logical connectives  If A is a formula and x is a variable, then ∀ x A(x) and ∃ x A(x) are formulas  All formulas constructed using only above rules are considered formulas in predicate logic

Discrete Mathematical Structures: Theory and Applications 44 Quantifiers and First Order Logic  Additional Rules of Inference  If the statement ∀ x P(x) is assumed to be true, then P(a) is also true,where a is an arbitrary member of the domain of the discourse. This rule is called the universal specification (US)  If P(a) is true, where a is an arbitrary member of the domain of the discourse, then ∀ x P(x) is true. This rule is called the universal generalization (UG)  If the statement ∃ x P (x) is true, then P(a) is true, for some member of the domain of the discourse. This rule is called the existential specification (ES)  If P(a) is true for some member a of the domain of the discourse, then ∃ x P(x) is also true. This rule is called the existential generalization (EG)

Discrete Mathematical Structures: Theory and Applications 45 Quantifiers and First Order Logic  Counterexample  An argument has the form ∀ x (P(x ) → Q(x )), where the domain of discourse is D  To show that this implication is not true in the domain D, it must be shown that there exists some x in D such that (P(x ) → Q(x )) is not true  This means that there exists some x in D such that P(x) is true but Q(x) is not true. Such an x is called a counterexample of the above implication  To show that ∀ x (P(x) → Q(x)) is false by finding an x in D such that P(x) → Q(x) is false is called the disproof of the given statement by counterexample

Discrete Mathematical Structures: Theory and Applications 46 Logic and CS  Logic is basis of ALU  Logic is crucial to IF statements  AND  OR  NOT  Implementation of quantifiers  Looping  Database Query Languages  Relational Algebra  Relational Calculus  SQL