Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 or solving problems, creativity and insight are needed, which cannot be taught Chapter 1

2 Discrete Math by R.S. Chang, Dept. CSIE, NDHU2 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables statements (propositions): declarative sentences that are either true or false--but not both. E.g., Margaret Mitchell wrote Gone with the Wind. 2+3=5 Kuala Lumpur is a capital city of Malaysia not statements: What a beautiful morning! Get up and do your exercises.

3 Discrete Math by R.S. Chang, Dept. CSIE, NDHU3 Chapter 1. Fundamentals of Logic ä 2 + 3 = 7 ä X + 1 = 5 ä 3 + 1 ä Go away! ä TSK1223 is course code for discrete math ä I wear a red shirt ä 2 + 2 = 4 Proposition with truth value (F) Not a proposition Proposition with truth value (T) Proposition with truth value (F) Proposition with truth value (T) Exercise:

4 Discrete Math by R.S. Chang, Dept. CSIE, NDHU4 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables primitive and compound statements combined from primitive statements by logical connectives or by negation ( ) p: Margaret Mitchell wrote Gone with the Wind. q: 2+3=5 r: Kuala Lumpur is a capital city of Malaysia The preceding statements represented by letters p, q, r are considered to be primitive statements. There is no way to break them down into anything simpler

5 Discrete Math by R.S. Chang, Dept. CSIE, NDHU5 Chapter 1. Fundamentals of Logic logical connectives: (a) conjunction (AND): (b) disjunction(inclusive OR): (c) exclusive or: (d) implication: (if p then q) (e) biconditional: (p if and only if q, or p iff q)

6 Discrete Math by R.S. Chang, Dept. CSIE, NDHU6 Let p and q be propositions. The conjunction of p and q is denoted by p ^ q, which is read “p and q” True only both p and q are true and false otherwise. E.g.,: x : I am a women y : I have one daughter I am a women and I have one daughter Conjunction(AND): p  q Chapter 1. Fundamentals of Logic

7 Discrete Math by R.S. Chang, Dept. CSIE, NDHU7 7 Disjunction(inclusive OR): p  q ä Disjunction of p and q, is denoted by p v q which is read “p or q”. ä or is used in inclusive way – The proposition is false only when both p and q are false, otherwise it is true. ä The exclusive or is denoted by p v q. ä The compound proposition is true only p or q is true but not both are true or false. p : I am a girl q : I am a boy

8 Discrete Math by R.S. Chang, Dept. CSIE, NDHU8 8 ä We say “p implies q” ä p → q ä Alternatively ä If p, then q ä p is sufficient for q ä p is a sufficient condition for q ä q is necessary for p ä q is necessary condition for p ä p only if q Implication: p  q (if p then q)

9 Discrete Math by R.S. Chang, Dept. CSIE, NDHU9 9 1.1: Logical Form p → q ä The proposition p is called hypothesis of the implication whereas q is called the conclusion. ä This compound proposition does not need any causal relationship between the statements for the implication to be true. ä Example: y : I go to school everyday. q : I score A y → q “If I go to school everyday then I score A” Implication:(continue)

10 Discrete Math by R.S. Chang, Dept. CSIE, NDHU10 ä Is denoted by p ↔ q or p iff q ä ↔ : which is read “if and only if” ä p ↔ q  (p → q) ^ (q → p) ä Example: y : I go to school everyday. q : I score A y ↔ q I go to school everyday if and only if I score A Biconditional: p  q (p if only if q, or p iff q)

11 Discrete Math by R.S. Chang, Dept. CSIE, NDHU11 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables "The number x is an integer." is not a statement because its truth value cannot be determined until a numerical value is assigned for x.

12 Discrete Math by R.S. Chang, Dept. CSIE, NDHU12 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables Truth Tables p q 0 0 0 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1

13 Discrete Math by R.S. Chang, Dept. CSIE, NDHU13 Chapter 1. Fundamentals of Logic Question Find the truth table for the statement

14 Discrete Math by R.S. Chang, Dept. CSIE, NDHU14 Chapter 1. Fundamentals of Logic 2.1 Basic connectives and truth tables Ex. 2.1s: Phyllis goes out for a walk. t: The moon is out. u: It is snowing. If the moon is out and it is not snowing, then Phyllis goes out for a walk. If it is snowing and the moon is not out, then Phyllis will not go out for a walk. If it is not the case that Phyllis goes out for a walk if and only if it is snowing or the moon is out

15 Discrete Math by R.S. Chang, Dept. CSIE, NDHU15 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables Def. 1.1. A compound statement is called a tautology(T 0 ) if it is true for all truth value assignments for its component statements. If a compound statement is false for all such assignments, then it is called a contradiction(F 0 ). : tautology : contradiction

16 Discrete Math by R.S. Chang, Dept. CSIE, NDHU16 Chapter 1. Fundamentals of Logic 1.1 Basic connectives and truth tables an argument: premisesconclusion If any one ofis false, then no matter what truth value q has, the implication is true. Consequently, if we start with the premises --each with truth value 1--and find that under these circumstances q also has value 1, then the implication is a tautology and we have a valid argument.

17 Discrete Math by R.S. Chang, Dept. CSIE, NDHU17 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Ex. 2.7 00110011 01010101 11001100 11011101 11011101 pq Def 2.2. logically equivalent

18 Discrete Math by R.S. Chang, Dept. CSIE, NDHU18 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic logically equivalent We can eliminate the connectivesand from compound statements. (and,or,not) is a complete set.

19 Discrete Math by R.S. Chang, Dept. CSIE, NDHU19 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Ex 2.8. DeMorgan's Laws p and q can be any compound statements.

20 Discrete Math by R.S. Chang, Dept. CSIE, NDHU20 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Law of Double Negation Demorgan's Laws Commutative Laws Associative Laws

21 Discrete Math by R.S. Chang, Dept. CSIE, NDHU21 Chapter 1. Fundamentals of Logic 2.2 Logical Equivalence: The Laws of Logic Distributive Law Idempotent Law Identity Law Inverse Law Domination Law Absorption Law

22 Discrete Math by R.S. Chang, Dept. CSIE, NDHU22 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic All the laws, aside from the Law of Double Negation, all fall naturally into pairs. Def. 1.3 Let s be a statement. If s contains no logical connectives other than and, then the dual of s, denoted s d, is the statement obtained from s by replacing each occurrence of and by and, respectively, and each occurrence of T 0 and F 0 by F 0 and T 0, respectively. Eg. The dual of is

23 Discrete Math by R.S. Chang, Dept. CSIE, NDHU23 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Theorem 1.1 (The Principle of Duality) Let s and t be statements. If, then. Ex. 2.10is a tautology. Replace each occurrence of p by is also a tautology. First Substitution Rule (replace each p by another statement q)

24 Discrete Math by R.S. Chang, Dept. CSIE, NDHU24 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Second Substitution Rule Ex. 1.11Then, because Ex. 1.12 Negate and simplify the compound statement

25 Discrete Math by R.S. Chang, Dept. CSIE, NDHU25 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Ex. 1.13 What is the negation of "If Joan goes to Lake George, then Mary will pay for Joan's shopping spree."? Because The negation is "Joan goes to Lake George, but (or and) Mary does not pay for Joan's shopping spree."

26 Discrete Math by R.S. Chang, Dept. CSIE, NDHU26 Chapter 2. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic Ex. 1.15 00110011 11011101 11011101 10111011 10111011 01010101 pq contrapositive of converse inverse

27 Discrete Math by R.S. Chang, Dept. CSIE, NDHU27 Chapter 1. Fundamentals of Logic 1.2 Logical Equivalence: The Laws of Logic simplification of compound statement Ex. 2.16 Demorgan's Law Law of Double Negation Distributive Law Inverse Law and Identity Law

28 Discrete Math by R.S. Chang, Dept. CSIE, NDHU28 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference an argument: premises conclusion is a valid argument is a tautology

29 Discrete Math by R.S. Chang, Dept. CSIE, NDHU29 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference Ex. 2.19 statements: p: Roger studies. q: Roger plays tennis. r: Roger passes discrete mathematics. premises: p 1 : If Roger studies, then he will pass discrete math. p 2 : If Roger doesn't play tennis, then he'll study. p 3 : Roger failed discrete mathematics. Determine whether the argumentis valid. which is a tautology, the original argument is true

30 Discrete Math by R.S. Chang, Dept. CSIE, NDHU30 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference p r s 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 Ex. 1.20 a tautology deduced or inferred from the two premises

31 Discrete Math by R.S. Chang, Dept. CSIE, NDHU31 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference Def. 1.4. If p, q are any arbitrary statements such that is a tautology, then we say that p logically implies q and we to denote this situation.write meansis a tautology. meansis a tautology.

32 Discrete Math by R.S. Chang, Dept. CSIE, NDHU32 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference Rule of inference: use to validate or invalidate a logical implication without resorting to truth table (which will be prohibitively large if the number of variables are large) Ex 2.22 Modus Ponens (the method of affirming) or the Rule of Detachment

33 Discrete Math by R.S. Chang, Dept. CSIE, NDHU33 Chapter 1. Fundamentals of Logic 1.3 Logical Implication: Rules of Inference Example 1.23 Law of the Syllogism Ex 1.25

34 Discrete Math by R.S. Chang, Dept. CSIE, NDHU34 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex. 2.25 Modus Tollens (method of denying) example:

35 Discrete Math by R.S. Chang, Dept. CSIE, NDHU35 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex. 2.25 Modus Tollens (method of denying) example: another reasoning

36 Discrete Math by R.S. Chang, Dept. CSIE, NDHU36 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference fallacy (1) If Margaret Thatcher is the president of the U.S., then she is at least 35 years old. (2) Margaret Thatcher is at least 35 years old. (3) Therefore, Margaret Thatcher is the president of the US.

37 Discrete Math by R.S. Chang, Dept. CSIE, NDHU37 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference fallacy (1) If 2+3=6, then 2+4=6. (2) 2+3 (3) Therefore, 2+4 6 6

38 Discrete Math by R.S. Chang, Dept. CSIE, NDHU38 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex 2.26 Rule of Conjunction Ex. 2.27 Rule of Disjunctive Syllogism

39 Discrete Math by R.S. Chang, Dept. CSIE, NDHU39 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex. 2.28 Rule of Contradiction Proof by Contradiction To prove we prove

40 Discrete Math by R.S. Chang, Dept. CSIE, NDHU40 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex. 2.29

41 Discrete Math by R.S. Chang, Dept. CSIE, NDHU41 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex. 2.30 p, t q r, s u No systematic way to prove except by truth table (2 n ).

42 Discrete Math by R.S. Chang, Dept. CSIE, NDHU42 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex 2.32 Proof by Contradiction q r F0F0

43 Discrete Math by R.S. Chang, Dept. CSIE, NDHU43 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference reasoning

44 Discrete Math by R.S. Chang, Dept. CSIE, NDHU44 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference Ex 2.33 u, s r p

45 Discrete Math by R.S. Chang, Dept. CSIE, NDHU45 Chapter 2. Fundamentals of Logic 2.3 Logical Implication: Rules of Inference How to prove that an argument is invalid? Just find a counterexample (of assignments) for it ! Ex 2.34 Show the following to be invalid. 0 1 s=0,t=1 p=1 r=1 q=0

46 Discrete Math by R.S. Chang, Dept. CSIE, NDHU46 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers Def. 2.5 A declarative sentence is an open statement if (1) it contains one or more variables, and (2) it is not a statement, but (3) it becomes a statement when the variables in it are replaced by certain allowable choices. examples: The number x+2 is an even integer. x=y, x>y, x<y,... universe

47 Discrete Math by R.S. Chang, Dept. CSIE, NDHU47 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers notations:p(x): The number x+2 is an even integer. q(x,y): The numbers y+2, x-y, and x+2y are even integers. p(5): FALSE,: TRUE, q(4,2): TRUE p(6): TRUE, : FALSE, q(3,4): FALSE For some x, p(x) is true. For some x,y, q(x,y) is true. For some x, is true. For some x,y, is true. Therefore,

48 Discrete Math by R.S. Chang, Dept. CSIE, NDHU48 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers existential quantifier: For some x: universal quantifier: For all x: x in p(x): free variable x in : bound variable is either true or false.

49 Discrete Math by R.S. Chang, Dept. CSIE, NDHU49 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers Ex 2.36 universe: real numbers

50 Discrete Math by R.S. Chang, Dept. CSIE, NDHU50

51 Discrete Math by R.S. Chang, Dept. CSIE, NDHU51

52 Discrete Math by R.S. Chang, Dept. CSIE, NDHU52 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers Def. 2.6 Let p(x) and q(x) be open statements. The open statements are called logically equivalent

53 Discrete Math by R.S. Chang, Dept. CSIE, NDHU53 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers Ex. 2.42 Universe: all integers thenis false butis true Therefore, but for any p(x), q(x) and universe

54 Discrete Math by R.S. Chang, Dept. CSIE, NDHU54 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers For a prescribed universe and any open statements p(x), q(x): Note this!

55 Discrete Math by R.S. Chang, Dept. CSIE, NDHU55 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers How do we negate quantified statements that involve a single variable?

56 Discrete Math by R.S. Chang, Dept. CSIE, NDHU56 Chapter 2. Fundamentals of Logic 2.4 The Use of Quantifiers Ex. 2.44 p(x): x is odd. q(x): x 2 -1 is even. Negate(If x is odd, then x 2 -1 is even.) There exists an integer x such that x is odd and x 2 -1 is odd. (a false statement, the original is true)


Download ppt "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."

Similar presentations


Ads by Google