COMP 1380 Discrete Structures I Thompson Rivers University

Slides:



Advertisements
Similar presentations
Discrete Mathematics Lecture 1 Logic of Compound Statements
Advertisements

Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Chapter 1 The Logic of Compound Statements. Section 1.3 Valid & Invalid Arguments.
CS128 – Discrete Mathematics for Computer Science
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Introduction to Logic Logical Form: general rules
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
Copyright © Cengage Learning. All rights reserved.
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Discrete Mathematics and Its Applications
Review I Rosen , 3.1 Know your definitions!
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
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.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and Proofs
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
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.
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Chapter 1 Logic and proofs
Logic.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Valid and Invalid Arguments
Propositional Logic.
The Foundations: Logic and Proofs
Advanced Algorithms Analysis and Design
DISCRETE MATHEMATICS CHAPTER I.
Discrete Mathematics Lecture 1 Logic of Compound Statements
CSNB 143 Discrete Mathematical Structures
CSE15 Discrete Mathematics 01/30/17
Discrete Mathematics Logic.
Discrete Mathematics Logic of Compound Statements
COMP 1380 Discrete Structures I Thompson Rivers University
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
MATH 245 Spring 2009 This is mathematics for computer science
(CSC 102) Discrete Structures Lecture 2.
Discrete Mathematics Lecture # 2.
Copyright © Cengage Learning. All rights reserved.
Chapter 8 Logic Topics
Proposition logic and argument CISC2100, Spring 2017 X.Zhang
Propositional Equivalences
CS100: Discrete structures
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CS 220: Discrete Structures and their Applications
CS201: Data Structures and Discrete Mathematics I
CS 220: Discrete Structures and their Applications
Applied Discrete Mathematics Week 1: Logic
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Discrete Mathematics and Its Applications Kenneth H
Discrete Mathematics Logic.
MAT 3100 Introduction to Proof
Chapter 7. Propositional and Predicate Logic
Statements of Symbolic Logic
Foundations of Discrete Mathematics
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Valid and Invalid Arguments
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

COMP 1380 Discrete Structures I Thompson Rivers University Logic and Truth Tables COMP 1380 Discrete Structures I Computing Science Thompson Rivers University

Course Contents Speaking Mathematically – .5 weeks Number Systems and Computer Arithmetic – 2 weeks Logic and Truth Tables – 1 week Boolean Algebra and Logic Gates – 1 week Vectors and Matrices – 2 weeks Sets and Counting – 1.5 weeks Probability Theory and Distributions – 2 weeks Statics and Random Variables – 2 weeks Not the replacement of IPv6; Inter-transition mechanism; But if IPv6 would fail TRU-COMP1380 Logic and Truth Tables

Unit Learning Objectives Recall truth tables for ~, , , , . Give a truth table for a given composite statement. Recall logical equivalences. Simplify a compound statement using logical equivalences. Infer a conclusion from a compound statement. TRU-COMP1380 Logic and Truth Tables

Unit Contents Sections 2.1 – 2.3 from the textbook Logical Form and Logical Equivalence Conditional Statements Valid and Invalid Arguments TRU-COMP1380 Logic and Truth Tables

Logical Form and Logical Equivalence Argument = premises + conclusion To have confidence in the conclusion in your argument, the premises should be acceptable on their own merits or follow from other statements that are known to be true. Logical forms for valid arguments? Examples Argument 1: If the program syntax is faulty or if program execution results in division by zero, then the computer will generate an error message. Therefore, if the computer does not generate, then the program syntax is correct and program execution does not result in division by zero. Argument 2: If x is a real number such that x < -2 or x > 2, then x2 > 4. Therefore, if x2 /> 4, then x /< -2 and x /> 2. The common logical form of both of the above arguments: If p or q, then r. Therefore, if not r, then not p and not q. [Q] Is the above logical form valid? TRU-COMP1380 Logic and Truth Tables

Definition of statement A statement (or proposition) is a sentence that is true or false but not both. Examples Two plus two equals four. 2 + 2 = 4 I am a TRU student. x + y > 0 ??? TRU-COMP1380 Logic and Truth Tables

Compound Statements Symbols used in complicated logical statements: ~ not ~p negation of p  and p  q conjunction of p and q  or p  q disjunction of p and q  exclusive or p  q Order of operations: ( ) and ~ have the precedence. ~p  q = (~p)  q ~(p  q) TRU-COMP1380 Logic and Truth Tables

Example It is not hot but it is sunny. It is neither hot nor sunny. -> It is not hot, and it is sunny. It is not hot, and it is not sunny. Let h  “it is hot” and s  “it is sunny.” Then the above statements can be translated as ~h  s ~h  ~s Suppose x is a particular real number. Let p, q, and r symbolize “0 < x,” “x < 3,” and “x = 3.” respectively. Then the following inequalities x  3 0 < x < 3 0 < x  3 can be translated as q  r p  q p  (q  r) TRU-COMP1380 Logic and Truth Tables

Truth Tables Negation Conjunction Disjunction p q p  q T ? F p q TRU-COMP1380 Logic and Truth Tables

Truth Tables Exclusive or p q p  q T F TRU-COMP1380 Logic and Truth Tables

Example ~p  q (p  q)  ~(p  q) (p  q)  ~r p q ~p  q T ? F ~T  T = ? (p  q)  ~(p  q) Can you write a truth table? When p is T and q is F? (p  q)  ~r When p is T, q is F and r is F? p q ~p  q T ? F TRU-COMP1380 Logic and Truth Tables

Logical Equivalence Example 6 > 2  2 < 6 How to prove 6 > 2  2 < 6 How to prove p  q  q  p Commutative law p  q  q  p Commutative law ~(~p)  p Double negative law ~(p  q) ≠ ~p  ~q ??? ~(p  q) ≠ ~p  ~q ??? TRU-COMP1380 Logic and Truth Tables

De Morgan’s Laws Examples ~(p  q) = ~p  ~q Can you prove it? ~(statement1  statement2) = ~statement1  ~statement2 ~(p  q) = ~p  ~q ~(statement1  statement2) = ~statement1  ~statement2 Examples ~(~p  q) = ??? ~(p  ~q) = ??? The negation of “John is 6 feet tall and he weighs at least 200 pounds.” is ... The negation of “The bus was late or Tom’s watch was slow.” is The negation of “-1 < x  4” is TRU-COMP1380 Logic and Truth Tables

Tautologies and Contradictions p  ~p = T; p  T = T Always true p  ~p = F; p  F = F Always false Some other interesting equivalences p  F = p Can you prove it? p  T = p Associative Laws (p  q)  r = p  (q  r) (p  q)  r = p  (q  r) Distributive Laws p  (q  r) = (p  q)  (p  r) Can you prove it? p  (q  r) = (p  q)  (p  r) TRU-COMP1380 Logic and Truth Tables

Prove ~(~p  q)  (p  q) = p using equivalences. ~(~p  q)  (p  q) = (~(~p)  ~q)  (p  q) = ... (p  ~q)  p = ??? Can you simplify using equivalences? ~((~p  q)  (~p  ~q)) = ??? TRU-COMP1380 Logic and Truth Tables

Conditional Statements If hypothesis (or antecedent), then conclusion (or consequent). hypothesis  conclusion Example If 4686 is divisible by 6, then 4686 is divisible by 3. Is this statement True? Let p = “4686 is divisible by 6,” and q = “4686 is divisible by 3”. Then p  q Truth table for p  q p  q ≡ ~p  q ??? p q p  q T F TRU-COMP1380 Logic and Truth Tables

p  q ≡ ~q  ~p ??? Contrapositive = ~(~(p  q)) p  q  r ≡ (p  r)  (q  r) ??? = ~(p  q)  r = ... ~(p  q) ≡ p  ~q ??? = ~(~p  q) p  q ≡ ~q  ~p ??? Contrapositive = ~(~(p  q)) TRU-COMP1380 Logic and Truth Tables

The biconditional of p and q p  q ≡ (p  q)  (q  p) p if and only if q p iff q The truth table is p q p  q T ? F TRU-COMP1380 Logic and Truth Tables

Valid and Invalid Arguments Example If (p  (q  ~r)) and (q  (p  r)), then is (p  r) valid? What do we have to do? p  r must be true for all the cases in which both of (p  (q  ~r)) and (q  (p  r)) are true. We may use the truth table to see if the statement is valid. Modus Ponents Both of p  q and p are valid, then q is valid. (p  q )  p = (~p  q )  p = (F  q )  T = q, or by truth table Therefore q must be T when (p  q ) and p are T. If x is a human, then x is mortal. (It is like a rule.) Dave is a human. (It is like observation.) Therefore Dave is mortal. (It is like a conclusion.) TRU-COMP1380 Logic and Truth Tables

Modus Tollens If p  q and ~q are valid, then ~p is valid. How to prove? If x is human, then x is mortal. (rule) But Zeus is not mortal. (observation) Therefore ... (conclusion) If x is divisible by 6, the x is divisible by 3. (rule) (Instantiation: …) 14 is not divisible by 3. (fact) If a city is big, then the city has tall buildings. Because Kamloops have a tall building, Kamloops is a big city. Is this argument valid? TRU-COMP1380 Logic and Truth Tables

Generalization Specialization Elimination Transitivity p, then p  q How to prove? Specialization p  q, then p How to prove? Elimination p  q and q, then p How to prove? Transitivity If p  q and q  r are valid, then p  r is valid. How to show? Contradiction Rule If p  F is valid, then ~p is valid. How to show? If ~p  F is valid, then p is valid. The logical heart of the method of proof by contradiction. If an assumption leads to a contradiction, then that assumption must be false. p q p  q T F TRU-COMP1380 Logic and Truth Tables