2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Size: px
Start display at page:

Download "2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic"

Transcription

1 CS 103 Discrete Structures Chapter 1 Propositional Logic Chapter 1.1 Propositional Logic 1

2 1.1 Propositional Logic Definition: A proposition :is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both or somewhere in between!. EXAMPLE 1: All the following declarative sentences are propositions. 1. Washington, D.C., is the capital of the USA. 2. Cairo is the capital of Egypt = = 3. Propositions 1 and 3 are true, whereas 2 and 4 are false EXAMPLE 2: all the following sentences are not propositions. 1. What time is it? 2. Read this carefully. 3. x + 1 = x + y = Z Sentences 1 and 2 are not propositions because they are not declarative sentences. Sentences 3 and 4 are not propositions because they are neither true nor false 1.1 Propositional Logic Note that: each of sentences 3 and 4 can be turned into a proposition if we assign values to the variables. Note: Commands and questions are not propositions. Propositional variables (or statement variables): are letters used to represent propositions, not used to denote numerical variables. The conventional letters used for propositional variables are p, q, r, s,.... The truth value of a proposition is denoted by: T if it is a true proposition F if it is a false proposition Propositional logic (or propositional calculus): is the area of logic that deals with propositions. It was first developed systematically by the Greek philosopher Aristotle more than 2300 years ago. 2

3 1.1 Propositional Logic Compound: propositions, are formed from existing propositions using logical operators. DEFINITION (negation operator): Let p be a proposition. The negation of p, denoted by p, is the statement "It is not the case that p." The proposition p is read "not p." The truth value of the negation of p, p, is the opposite of the truth value of p. EXAMPLE 3: Find the negation of the proposition "Today is Friday. and express this in simple English. The negation is "It is not the case that today is Friday." This negation can be more simply expressed by "Today is not Friday, Or, "It is not Friday today. 1.1 Propositional Logic Truth Table for p and p DEFINITION : Conjunction Operator Let p and q be propositions. The conjunction of p and q, denoted by p q, is the proposition "p and q." The conjunction p q is: True when both p and q are true and False otherwise. 3

4 Truth Table for p q 1.1 Propositional Logic Example 5: Find the conjunction of the propositions p and q where: p is the proposition "Today is Friday q is the proposition "It is raining today The conjunction p q is the proposition: "Today is Friday and it is raining today" This proposition is: True on rainy Fridays False on any day that is not a Friday and on Fridays when it does not rain DEFINITION : Disjunction Operator Let p and q be propositions. The disjunction of p and q, denoted by p V q, is the proposition "p or q." The disjunction p V q is: False when both p and q are false and True otherwise. Truth Table for p q 1.1 Propositional Logic 4

5 Example: Find the disjunction of the propositions p and q where: p is the proposition "Today is Friday q is the proposition "It is raining today The disjunction p v q is the proposition: "Today is Friday or it is raining today." This proposition is: True on any day that is either a Friday or a rainy day (including rainy Fridays) False only on days that are not Fridays when it also does not rain. 1.1 Propositional Logic 1.1 Propositional Logic Remark: Connective or is used in two ways: Inclusive Or (normal or) A disjunction is True when at least one of the two propositions is true. Example: "Students who have taken calculus or computer science can take this class That is, students that can take the class are: Who have taken both calculus and computer science, Who have taken calculus Who have taken computer science 5

6 1.1 Propositional Logic DEFINITION : Exclusive Or Let p and q be propositions.the exclusive or of p and q, denoted by p q (p XOR q),is the proposition that is: True when exactly one of p and q is true and False otherwise. Truth Table for p q 1.1 Propositional Logic Exclusive Or is True when exactly one of the two propositions is true. Example: "Students who have taken calculus or computer science, but not both, can enroll in this class" That is, students that can take the class are: Who have taken calculus, Who have taken computer science Note that students who have taken both calculus and a computer science course cannot take the class 6

7 1.1 Propositional Logic Conditional Statements: Definition: Implication Operator Let p and q be propositions. The conditional statement p q is the proposition "if p, then q." The conditional statement p q is: False when p is true and q is false, and True otherwise. In the conditional statement p q, p is called the hypothesis and q is called the conclusion. 1.1 Propositional Logic The truth table for the conditional statement p q is shown in Table. A conditional statement is also called an implication. Note that: the statement p q is true when both p and q are true and when p is false (no matter what truth value q has). 7

8 1.1 Propositional Logic ways to express this conditional statement: "if p, then q" "if p, q " "p is sufficient for q" "q if p" "q when p" "a necessary condition for p is q" "q unless p" "p implies q" "p only if q" "a sufficient condition for q is p" "q whenever p" "q is necessary for p" "q follows from p" 1.1 Propositional Logic Example: Let p be the statement Ahmad learns discrete mathematics" and q the statement Ahmad will find a good job" Express the statement p q in English The statement p q can be expressed in English by several ways: If Ahmad learns discrete mathematics, then he will find a good job Ahmad will find a good job when he learns discrete mathematics For Ahmad to get a good job, it is sufficient for him to learn discrete mathematics Ahmad will find a good job unless he does not learn discrete mathematics Note that: the if-then construction used in many programming languages is different from that used in logic 8

9 1.1 Propositional Logic Definition: Converse, Contrapositive, and Inverse There are three related conditional statements to statement p q: The converse of p q is q p The contrapositive of p q is q p The inverse of p q is p q Note that Conditional statement and its contrapositive are equivalent. The converse and the inverse of a conditional statement are also equivalent Example 9: What are the contrapositive, the converse, and the inverse of the conditional statement "The home team wins whenever it is raining."? Because "q whenever p" is one of the ways to express the conditional statement p q, the original statement can be rewritten as "If it is raining, then the home team wins." Consequently, 1.1 Propositional Logic The contrapositive of this conditional statement is "If the home team does not win, then it is not raining." 9

10 1.1 Propositional Logic The converse is "If the home team wins, then it is raining." The inverse is "If it is not raining, then the home team does not win. Note that: Only the contrapositive is equivalent to the original statement. 1.1 Propositional Logic Definition: Biconditional Let p and q be propositions. The biconditional statement p q is the proposition "p if and only if q. " The biconditional statement p q is true when p, q have the same truth values, and is false otherwise. Biconditional statements are also called bi-implications. The truth table for p q 10

11 1.2 Propositional Logic Example 10: Let p be the statement "You can take the flight" and let q be the statement "You buy a ticket." Then p q is the statement "You can take the flight if and only if you buy a ticket." This statement is true if p and q are either both true or both false, That is: if you buy a ticket and can take the flight or if you do not buy a ticket and you cannot take the flight. It is false when p and q have opposite truth values. 1.2 Propositional Logic There are some other common ways to express p q: "p is necessary and sufficient for q" "if p then q, and conversely" "p iff q." Note that: p q has exactly the same truth value as (p q) (q p). 11

12 1.2 Propositional Logic Example 11: Construct the truth table of the compound proposition (p v q) (p q). 12

13 1.2 Propositional Logic Example 12 :How can this English sentence be translated into a logical expression? "You can access the Internet from campus only if you are a computer science major or you are not a freshman. a = access the internet, c = computer science student and, f = freshman 1.2 Propositional Logic Logic and Bit Operations Computers represent information using bits A bit is a symbol with two possible values: o and 1 A bit can be used to represent a truth value Because there are two truth values: true and false. Then we can use the bits as follow: 1 represents T (true) 0 represents F (false) A variable is called a Boolean variable if its value is either true or false. A Boolean variable can be represented using a bit. 13

14 1.2 Propositional Logic Bit Operations correspond to Logical Connectives After replacing true by 1 and false by 0 in the truth tables, we can use the bit operators OR, AND, and XOR as follow: Definition: Bit string 1.2 Propositional Logic A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string is a bit string of length nine. We can extend bit operations to bit strings. bitwise OR, bitwise AND, and bitwise XOR Bitwise OR of two strings of the same length is the string that have the OR of the corresponding bits in the two strings Similarly for bitwise AND and bitwise XOR We use the symbols,, and to represent the bitwise OR, bitwise AND, and bitwise XOR operations, respectively 14

15 Bit Operations Boolean values can be represented as 1 (true) and 0 (false) A bit string is a series of Boolean values. Length of the string is the number of bits is eight Boolean values in one string We can then do operations on these Boolean strings. Each column is its own Boolean operation Bit Operations EXAMPLE : Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings and (Note that: bit strings will be split into blocks of four bits to make them easier to read.) The bitwise OR, bitwise AND, and bitwise XOR of these strings are obtained by taking the OR, AND, and XOR of the corresponding bits, respectively bitwise OR bitwise AND bitwise XOR 15

16 1.1, 1.2 Propositional Logic Exercises: Construct a truth table for each of these compound propositions (P q) ( q p) (P q) (q p) (p q) (p q) (p q) (p q) (p q) ( p q) (p q) (p q) (p q) (p q) (p q) ( q r) Chapter 1.3 Propositional Equivalences 16

17 1.3 Propositional Equivalences Definition: The compound propositions can be classified according to their possible truth values into three types: Tautology A compound proposition that is always true, no matter what the truth values of the propositions that occur in it Contradiction A compound proposition that is always false Contingency A compound proposition that is neither a tautology nor a contradiction Tautologies and contradictions are often important in mathematical reasoning. 1.3 Propositional Equivalences Example 1: We can construct examples of tautologies and contradictions using just one propositional variable. Note That: p p is a tautology. p p is a contradiction 17

18 1.3 Propositional Equivalences Logical Equivalences: Compound propositions that have the same truth values in all possible cases are called logically equivalent. We can also define this notion as follows. Definition: The compound propositions p and q are called logically equivalent if p q is a tautology. The notation p q denotes that p and q are logically equivalent. 1.3 Propositional Equivalences Example: Show that (p q) and p q are logically equivalent. Truth table for these propositions is: Note that (p q) ( p q) is a tautology 18

19 1.3 Propositional Equivalences Example: Show that p q and p q are logically equivalent. Truth table for these propositions is: Note that: ( p q) (p q) is a tautology 1.3 Propositional Equivalences EXAMPLE 4 :Show that are logically equivalent. This is the distributive law of disjunction over conjunction. 19

20 TABLE 6 Logical Equivalences. This table contains some important equivalences. T denotes the compound proposition that is always true F denotes the compound proposition that is always false 1.3 Propositional Equivalences This table contains some important equivalences involving conditional and biconditional statements 20

21 1.3 Propositional Equivalences Using De Morgan's Laws The two logical equivalences known as De Morgan's laws are particularly important. They tell us how to negate conjunctions and how to negate disjunctions (p q) p q Show that the negation of a disjunction is formed by taking the conjunction of the negations of the component propositions (p q) p q Show that the negation of a conjunction is formed by taking the disjunction of the negations of the component propositions 1.3 Propositional Equivalences Example: Use De Morgan's laws to express the negations of Ahmad has a cellphone and he has a laptop computer" and Ali will go to the university or Mohammad will go to the university Solution part 1: Let p: " Ahmad has a cellphone" q: " Ahmad has a laptop computer." Then " Ahmad has a cellphone and he has a laptop computer" can be represented by p q. By the first of De Morgan's laws, (p q) is equivalent to p q. The negation of our original statement as Ahmad does not have a cell phone or he does not have a laptop computer." 21

22 1.3 Propositional Equivalences Solution part 2: Let r: Ali will go to the university" s: " Mohammad will go to the university." Then " Ali will go to the university or Mohammad will go to the university " can be represented by r s By the second of De Morgan's laws, (r s) is equivalent to r s The negation of our original statement as Ali will not go to the university and Mohammad will not go to the university." Propositional operations summary 22

23 Logical Equivalences Proof using Logical Equivalence Example: Show that (p r) (q r) and (p q) r are logically equivalent (p r) (q r) ( p r) ( q r) p r q r p q r r ( p q) (r r) (p q) r (p q) r Definition of implication Associative Commutative Associative De Morgan, Idempotent Definition of implication 23

24 Example Prove that (p q) (p q) is a Tautology. (Proof) (p q) (p q) (p q) (p q) Implication ( p q) (p q) De Morgan ( p p) ( q q) Commutative, Associative T T Negation T Identity Tautology, Contradiction, Equivalence Tautology: a statement that s always true p p will always be true Contradiction: a statement that s always false p p will always be false A logical equivalence means that the two sides always have the same truth values Symbol is or (we ll use ) 24

25 Exercises 1.3: Homework 1. Show that each of these conditional statements is a tautology by using truth tables. Exercises 1.3: Homework 2. Show that each of the following compound propositions are logically equivalent: a) p q and (p q) ( P q) b) (p q) and p q c) (p q) and p q d) (p q) (p r) and p (q r) e) p (q r) and q (p r) f) (p q) r and p (q r) g) (p q) r and (p r) (q r) h) (p q) (r s)and(p r) (q s) 25

26 Chapter 1.4 Predicates and Quantifiers 1.4 Predicates and Quantifiers How can we express? every computer in CS department is protected by intrusion detection system There exists at least one student who has a red hair. x is greater than 3 has two parts. The first part, the variable x, is the subject of the statement x: subject The second part is greater than 3 : predicate We can denote the statement x is greater than 3 by P(x), where P denotes the predicate is greater than 3 and x is the variable. The statement P(x) is also said to be the value of the propositional function P at x. P(x): propositional function P at x Once a value has been assigned to the variable x, the statement P(x) becomes a proposition and has a truth value. 26

27 1.4 Predicates and Quantifiers Consider P(x) = x < 5 P(x) has no truth values (x is not given a value) P(1) is true: The proposition 1<5 is true P(10) is false: The proposition 10<5 is false P(x) will create a proposition when given a value Let P(x) = x is a multiple of 5 For what values of x is P(x) true? Let P(x) = x + 3 For what values of x is P(x) true? 1.4 Predicates and Quantifiers Functions with multiple variables: P(x, y) = x + y == 0 P(1,2) is false, P(1,-1) is true P(x, y, z) = x + y == z P(3,4,5) is false, P(1,2,3) is true P(x 1,x 2,x 3 x n ) = 27

28 1.4 Predicates and Quantifiers Example1 : Let P(x) denote the statement "x > 3." What are the truth values of P(4) and P(2)? Firstly, P(x) has no truth values (x is not given a value) P(x) will create a proposition when given a value. We obtain the statement P(4) by setting x = 4 in the statement "x > 3." Hence, P(4) is true However, P(2) is false. Example: 1.4 Predicates and Quantifiers Let A(x) denote the statement "Computer x is under attack by an intruder." Suppose that of the computers on campus, only CS2 and MATH1 are currently under attack by intruders. What are truth values of A(CSl), A(CS2), and A(MATHl)? We obtain the statement A(CSl) by setting x = CSI in the statement "Computer x is under attack by an intruder." Because CS 1 is not on the list of computers currently under attack, then A(CSI) is false. Similarly, because CS2 and MATH1 are on the list of computers under attack, then A(CS2) and A(MATHl) are true. 28

29 1.4 Predicates and Quantifiers Example: Let Q(x, y) denote the statement x= y + 3" What are the truth values of the propositions Q(1, 2) and Q(3, 0)? To obtain Q(I, 2), set x = 1 and y = 2 in the statement Q(x, y). Hence, Q(1, 2) is false. The statement Q(3, 0) is true 1.4 Predicates and Quantifiers Quantifiers Why quantifiers? Many things (in this course and beyond) are specified using quantifiers Quantification expresses the extent to which a predicate is true over a range of elements. In English, the words all, some, many, none, and few are used in quantifications. A quantifier is an operator that limits the variables of a proposition In this course we will focus on two types of quantification: Universal quantification: Which tells us that a predicate is true for every element under consideration, Existential quantification: Which tells us that there is one or more element under consideration for which the predicate is true 29

30 1.4 Predicates and Quantifiers Definition: Universal Quantifier Represented by an upside-down A: It means for all The universal quantification of P (x) is the statement: "P(x) for all values of x in the domain. The notation x P (x) denotes the universal quantification of P(x). Here is called the universal quantifier. We read x P(x) as "for all x P(x)" or "for every x P(x )" An element for which P(x) is false is called a counterexample of x P (x). 1.4 Predicates and Quantifiers Most statements in mathematics and computer science use terms such as for every and for some. For example: For every triangle T, the sum of the angles of T is 180 degrees. x P(x): P(x) is true for all (every) values of x in the Domain. What values x can represent called the domain or universe of discourse. Example: What is the truth value of x (x 2 x). - If D is all real numbers, the truth value is false (take x = 0.5, this is called a counterexample). - If D is the set of integers, the truth value is true. 30

31 1.4 Predicates and Quantifiers Example: Let P(x) be the statement "x + 1> x" What is the truth value of the quantification x P(x), where the domain consists of all real numbers? Because P(x) is true for all real numbers x, the quantification x P(x) is true Example: Let Q(x) be the statement "x < 2" What is the truth value of the quantification x Q(x), where the domain consists of all real numbers? Q(x) is not true for every real number x, because, for instance, Q(3) is false. That is, x = 3 is a counterexample for the statement x Q(x). Then x Q(x) is false Remark: you need to one counterexample to prove the universal quantification is false. 1.4 Predicates and Quantifiers Example: What is the truth value of x P(x), where P(x) is the statement "x 2 < 10" and the domain consists of the positive integers not exceeding 4? The statement x P(x) is the same as the conjunction P(l) P(2) P(3) P(4), But P(4) is counterexample then x P(x) is false. Remarks: In order to prove that a universal quantification is true, it must be shown for ALL cases In order to prove that a universal quantification is false, it must be shown to be false for only ONE case 31

32 1.4 Predicates and Quantifiers Example: Suppose that P(x) is "x 2 > 0" What is the truth value of the quantification x P(x), where the domain consists of all integer numbers? The statement x P(x) is false Because the value of x = 0 is a counterexample Example: Let P(x) is x/2 < x What is the truth value of the quantification x P(x), where the domain consists of all real numbers? The statement x P(x) is false Because all negative values of x are counterexample 1.4 Predicates and Quantifiers Definition: Existential Quantifier Represented by an backwards E: It means there exists x P(x): There exists an element x in the universe of discourse (Domain) such that P(x) is true. Example : Let P(x): x = x + 1, Domain is the set of all real numbers: - The truth value of x P(x) is false (there is no real x such that x = x + 1). Example : Let P(x): x 2 = x, Domain is the set of all real numbers: - The truth value of x P(x) is true (take x = 1). 32

33 1.4 Predicates and Quantifiers Let P(x): x 2 x, Domain is the set {0.5, 1, 2, 3}. x P(x) P(0.5) P(1) P(2) P(3) F T T T F x P(x) P(0.5) P(1) P(2) P(3) F T T T T Example: Let P(x) = x+1 < x There is no numerical value x for which x+1<x Thus, x P(x) is false 1.4 Predicates and Quantifiers Example: Let P(x) = x+1 > x There is a numerical value for which x+1>x In fact, it s true for all of the values of x! Thus, x P(x) is true Remarks: In order to show an existential quantification is true, you only have to find ONE value. In order to show an existential quantification is false, you have to show it s false for ALL values 33

34 1.4 Predicates and Quantifiers Example: What is the truth value of x P(x), where P(x) is the statement "x 2 > 10" and the universe of discourse consists of the positive integers not exceeding 4? Because the domain is {l, 2, 3, 4}, the proposition x P (x) is the same as the disjunction P(l) P(2) P(3) P(4). Because P(4) is true, then x P(x) is true. 1.4 Predicates and Quantifiers The meaning of the universal and Existential quantifiers are summarized in the Table 34

35 1.4 Predicates and Quantifiers A note on quantifiers Recall that P(x) is a propositional function Let P(x) be x == 0 Recall that a proposition is a statement that is either true or false P(x) is not a proposition There are two ways to make a propositional function into a proposition: Supply it with a value For example, P(5) is false, P(0) is true Provide a quantification For example, x P(x) is false and x P(x) is true 1.4 Predicates and Quantifiers Precedence of Quantifiers The quantifiers and have higher precedence than all logical operators from propositional calculus. For example, x P(x) Q(x) is the disjunction of x P(x) and Q(x). In other words, it means ( x P(x)) Q(x) rather than x (P(x) Q(x)). Binding variables When a quantifier is used on the variable x, we say that this occurrence of the variable is bound. An occurrence of a variable that is not bound by a quantifier or set equal to a particular value is said to be free. All the variables that occur in a propositional function must be bound or set equal to a particular value to turn it into a proposition. This can be done using a combination of universal quantifiers, existential quantifiers, and value assignments. 35

36 1.4 Predicates and Quantifiers The part of a logical expression to which a quantifier is applied is called the scope of this quantifier. A variable is free if it is outside the scope of all quantifiers in the formula that specify this variable. Example: Let P(x, y) be x > y Consider: x P(x, y) This is not a proposition! Because y is free (not bound by a quantifier) What is y? If it s 5, then x P(x, y) is false If it s x-1, then x P(x, y) is true 1.4 Predicates and Quantifiers Example: In the statement x(x + y = 1): The variable x is bound by the existential quantification x, But the variable y is free Because it is not bound by a quantifier and no value is assigned to this variable. Remarks: x(p(x) Q(x)) x R(x), all variables are bound. The scope of the first quantifier, x, is the expression P(x) Q(x) because x is applied only to P(x) Q(x), and not to the rest of the statement. Similarly, the scope of the second quantifier, x, is the expression R(x). That is, the existential quantifier binds the variable x in P(x) Q(x) and the universal quantifier x binds the variable x in R(x). 36

37 1.4 Predicates and Quantifiers Remarks: ( x P(x)) Q(x) The x in Q(x) is not bound; thus not a proposition ( x P(x)) ( x Q(x)) Both x values are bound; thus it is a proposition x ( P(x) Q(x)) ( y R(y)) All variables are bound; thus it is a proposition ( x P(x) Q(y)) ( y R(y)) The y in Q(y) is not bound; this not a proposition 1.4 Predicates and Quantifiers Logical Equivalences Involving Quantifier Definition: Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value no matter which predicates are substituted into these statements and which domain of discourse is used for the variables in these propositional functions. We use the notation S T to indicate that two statements S and T involving predicates and quantifiers are logically equivalent. 37

38 1.4 Predicates and Quantifiers Example: Show that x (P(x) Q(x)) and x P(x) x Q(x) are logically equivalent. Where the same domain is used throughout. To show that these statements are logically equivalent, we must show that they always take the same truth value, no matter: What the predicates P and Q are, Which domain of discourse is used. Suppose we have particular predicates P and Q, with a common domain. We can show that x (P(x) Q(x)) and x P(x) x Q(x) are logically equivalent by doing two things: First, we show that if x (P(x) Q(x)) is true, then x P(x) x Q(x) is true. Second, we show that if x P(x) x Q(x) is true, then x (P(x) Q(x)) is true. 1.4 Predicates and Quantifiers Suppose that x (P(x) Q(x)) is true. This means that if a is in the domain, then P(a) Q(a) is true. Hence, P(a) is true and Q(a) is true. Because P(a) is true and Q(a) is true for every element in the domain, we can conclude that x P(x) and x Q(x) are both true. This means that x P(x) x Q(x) is true. Next, suppose that x P(x) x Q(x) is true. Then x P(x) is true and x Q(x) is true. Hence, if a is in the domain, then P(a) is true and Q(a) is true Because P(x) and Q(x) are both true for all elements in the domain. It follows that for all a, P(a) Q(a) is true. Then x (P(x) Q(x)) is true. We can now conclude that: x (P(x) Q(x)) x P(x) x Q(x). 38

39 1.4 Predicates and Quantifiers Negating quantifications Consider the statement: All students in this class have red hair What is required to show the statement is false? There exists a student in this class that does NOT have red hair To negate a universal quantification: You negate the propositional function AND you change to an existential quantification x P(x) = x P(x) 1.4 Predicates and Quantifiers Consider the statement: There is a student in this class with red hair What is required to show the statement is false? All students in this class do not have red hair Thus, to negate an existential quantification: To negate the propositional function AND you change to a universal quantification x P(x) = x P(x) 39

40 1.4 Predicates and Quantifiers Example: Let P(x) is the statement x 2 1 = 0, where the domain is the set of real numbers R. - The truth value of x P(x) is False - The truth value of x P(x) is True - x P(x) x (x 2 1 0), which is True - x P(x) x (x 2 1 0), which is False 1.4 Predicates and Quantifiers The rules for negations for quantifiers are called De Morgan s laws for quantifiers. These rules are summarized in this table: 40

41 1.4 Predicates and Quantifiers Example: What are the negations of the statements "There is an excellent student" and "All teachers explain lessons seriously"? Let E (x) denote "x is excellent" Then the statement "There is an excellent student is represented by x E (x), where the domain consists of all students. The negation of this statement is x E (x), which is equivalent to x E(x). This negation can be expressed as "Every student is not excellent" Let L (x) denote "x explains lessons seriously" Then the statement "All teachers explain lessons seriously " is represented by x L (x), where the domain consists of all teachers. The negation of this statement is x L(x), which is equivalent to x L(x). This negation can be expressed in several different ways, including: "Some teachers does not explain lessons seriously" "There is an teacher who does not explain lessons seriously." 1.4 Predicates and Quantifiers Example: What are the negations of the statements x (x 2 > x) and x (x 2 = 2)? The negation of x (x 2 > x) is the statement, x (x 2 > x), which is equivalent to x (x 2 > x). This can be rewritten as x (x 2 x). The negation of x (x 2 = 2) is the statement x (x 2 = 2), which is equivalent to x (x 2 = 2). This can be rewritten as x (x 2 2). Note that the truth values of these statements depend on the domain 41

42 1.4 Predicates and Quantifiers Example: Show that x (P(x) Q(x)) and x (P(x) Q(x)) are logically equivalent. By De Morgan's law for universal quantifiers, we know that: x (P(x) Q(x)) x ( (P(x) Q(x))) x ( ( P(x) Q(x))) x (P(x) Q(x)) Then x (P(x) Q(x)) and x (P(x) Q(x)) are logically equivalent. 1.4 Predicates and Quantifiers Translating from English into Logical Expressions Translating sentences in English (or other natural languages) into logical expressions is a crucial task in mathematics, logic programming, artificial intelligence, software engineering, and many other disciplines. Example: Express the statement "Every student in this class has studied calculus" using predicates and quantifier we introduce C(x), which is the statement x has studied calculus. Consequently, if the domain for x consists of the students in the class, Then we can translate our statement as: x C(x) 42

43 1.4 Predicates and Quantifiers Note that: If we change the domain to consist of all people, we will need to express our statement as: For every person x, if person x is a student in this class then x has studied calculus. If S(x) represents the statement that person x is in this class, we see that our statement can be expressed as x(s(x) C(x)). [Caution! Our statement cannot be expressed as x(s(x) C(x)) because this statement says that all people are students in this class and have studied calculus!] 1.4 Predicates and Quantifiers Example: Express the statement Every student in this class has studied math and C++ course using predicates and quantifier If D is the students in this class: Translated to: x (M(x) CPP(x)) But if the D is all people: For every person x, if person x is a student in this class then x has studied math and C++ Translated to: x (S(x) M(x) CPP(x)) 43

44 1.4 Predicates and Quantifiers Example: Express the statement Some student in this class has studied math and C++ course. using predicates and quantifier If D is the students in this class: Translated to: x (M(x) CPP(x)) But if the D is all people: We introduce S(x) to represent x is a student in this class. Our solution becomes: x (S(x) M(x) CPP(x)) because the statement is that there is a person x who is a student in this class and who has studied math and C++. Exercises 1.4 Predicates and Quantifiers 1. Let P(x) be the statement x = x 2 " If the domain consists of the integers, what are the truth values? a) P(0) b) P(-l) c)p(l) d) x P(x) e) P(2) f) x P(x) 2. Let Q(x) be the statement "x + 1 > 2x" If the domain consists of all integers, what are these truth values? a) Q(0) b) Q(-I) c) Q(l) d) x Q(x) e) x Q(x) f) x Q(x) g) x Q(x) 3. Let P (x) be the statement "x spends more than five hours every weekday in class," where the domain for x consists of all students. Express each of these quantifications in English. a) xp(x) b) x P(x) c) x P(x) d) x P(x) 44

45 Chapter 1.5 Nested Quantifiers In the previous section: 1.5 Nested Quantifiers we defined the existential and universal quantifiers and showed how they can be used to represent mathematical statements. We also explained how they can be used to translate English sentences into logical expressions. However, we avoided nested quantifiers, where one quantifier is within the scope of another, such as x y (x + y = 0). In this section: we will gain experience working with nested quantifiers. We will see how to use nested quantifiers to express mathematical statements. 45

46 1.5 Nested Quantifiers EXAMPLE : Assume that the domain for the variables x and y consists of all real numbers. The statement x y (x + y = y + x) says that x + y = y + x for all real numbers x and y. This is the commutative law for addition of real numbers. Likewise, the statement x y (x + y = 0) says that for every real number x there is a real number y such that x + y = 0. This states that every real number has an additive inverse. Similarly, the statement x y z (x + (y + z) = (x + y) + z) is the associative law for addition of real numbers. 1.5 Nested Quantifiers Examples x y (x + y = y) There exists an additive identity for all real numbers x y (((x 0) (y<0)) (x - y > 0)) A non-negative number minus a negative number is greater than zero x y (((x 0) (y 0)) (x-y > 0)) The difference between two non-positive numbers is not necessarily non-positive (i.e. can be positive) x y (((x 0) (y 0)) (x y 0)) The product of two non-zero numbers is non-zero if and only if both factors are non-zero 46

47 1.5 Nested Quantifiers Example: Translate into English the statement: x y((x > 0) (y < 0) (x y < 0)), where the domain for both variables consists of all real numbers. This statement says that for every real number x and for every real number y, if x > 0 and y < 0, then x y < 0. That is, this statement says that for real numbers x and y, if x is positive and y is negative, then x y is negative. This can be stated more succinctly as The product of a positive real number and a negative real number is always a negative real number. 1.5 Nested Quantifiers Thinking of Quantifiers as Loops: Examples: To see whether x y P(x, y) is true, we loop through the values for x, and for each x we loop through the values for y. If we find that P(x, y) is true for all values for x and y, we have determined that x y P(x, y) is true. If we ever hit a value x for which we hit a value y for which P(x, y) is false, we have shown that x y P(x, y) is false. Similarly, to determine whether x y P(x, y) is true, we loop through the values for x, and for each x we loop through the values for y until we find a y for which P(x, y) is true. If for every x we hit such a y, then x y P(x, y) is true; if for some x we never hit such a y, then x y P(x, y) is false. 47

48 1.5 Nested Quantifiers To see whether x y P(x, y) is true, we loop through the values for x until we find an x for which P(x, y) is always true when we loop through all values for y. Once we find such an x, we know that x y P(x, y) is true. If we never hit such an x, then we know that x y P(x, y) is false. Finally, to see whether x y P(x, y) is true, we loop through the values for x, where for each x we loop through the values for y until we hit an x for which we hit a y for which P(x, y) is true. The statement x y P(x, y) is false only if we never hit an x for which we hit a y such that P(x, y) is true. 1.5 Nested Quantifiers The Order of Quantifiers Many mathematical statements involve multiple quantifications of propositional functions involving more than one variable. It is important to note that the order of the quantifiers is important, unless all the quantifiers are universal quantifiers or all are existential quantifiers. Example: Let P(x, y) be the statement "x + y = y + x." What are the truth values of the quantifications x y P(x, y) and y x P(x, y) where the domain for all variables consists of all real numbers? Both x y P(x, y) and y x P(x, y) mean "For all real numbers x, for all real numbers y, x + y = y + x. Both statements have the same meaning Because P (x, y) is true for all real numbers x and y, Then the propositions x y P(x, y) and y x P(x, y) have the same meaning, and both are true. 48

49 1.5 Nested Quantifiers Example: Let Q(x, y) denote "x + y = 0" What are the truth values of the quantifications y x Q(x, y) and x y Q(x, y), where the domain for all variables consists of all real numbers? y x Q(x, y) denotes the proposition "There is a real number y such that for every real number x, Q(x, y). No matter what value of y is chosen, there is only one value of x for which x + y = 0. Because there is no real number y such that x + y = 0 for all real numbers x, the statement y x Q(x, y) is false. x y Q(x, y) denotes the proposition "For every real number x there is a real number y such that Q(x, y)." Given a real number x, there is a real number y such that x + y = 0; (y = -x), the statement x y Q(x, y) is true. Note that: the order of different quantifiers is very important y x Q(x, y) and x y Q(x, y) are not logically equivalent 1.5 Nested Quantifiers Summary The following table summarizes the meanings of the different possible quantifications involving two variables 49

50 1.5 Nested Quantifiers Example: Let Q(x, y, z) be the statement "x + y = z" What are the truth values of the statements x y z Q(x, y, z) and z x y Q(x, y, z), where the domain of all variables consists of all real numbers? Suppose that x and y are assigned values. x y z Q(x, y, z) means "For all real numbers x and for all real numbers y there is a real number z such that x + y = z, It is true. z x y Q(x, y, z) means "There is a real number z such that for all real numbers x and for all real numbers y it is true that x + y = z, It is false Because there is no value of z that satisfies the equation x + y = z for all values of x and y. The order of the quantification here is important 1.5 Nested Quantifiers Translating Mathematical Statements into Statements Involving Nested Quantifier Example: Translate the statement "The sum of two positive integers is always positive" into a logical expression. We can rewrite the statement by introducing the variables x and y as: "For all positive integers x and y, x + y is positive." Consequently, we can express this statement as: x y ((x > 0) (y > 0) (x + y > 0)) where the domain for both variables consists of all integers. If we consider the positive integers as the domain. Then the original statement becomes : "For every two positive integers, the sum of these integers is positive We can express this as: x y(x + y > 0) where the domain for both variables consists of all positive integers. 50

51 1.5 Nested Quantifiers Example: Translate the statement "Every real number except zero has a multiplicative inverse. We can rewrite this as "For every real number x, if x 0, then there exists a real number y such that x y = I" This can be rewritten as: x ((x 0) y (x y = 1)) Example: Translate the statement The product of two negative integers is positive x y ((x<0) (y<0) (x y > 0)) Example: Translate the statement The average of two positive integers is positive x y ((x>0) (y>0) ((x + y)/2 > 0)) 1.5 Nested Quantifiers Examples: The difference of two negative integers is not necessarily negative x y ((x<0) (y<0) ( x-y 0)) m n ((m < 0) (n < 0) :(m - n < 0)) The absolute value of the sum of two integers does not exceed the sum of the absolute values of these integers x y ( x + y x + y ) Example: Use quantifiers to express the definition of the limit of a real valued function f (x) of a real variable x at a point a in its domain. lim f ( x) L x a For every real number > 0 there exists a real number > 0 such that f(x ) - L < whenever 0 < x - a <. This definition of a limit can be phrased in terms of quantifiers by: >0, >0 S.T x (0 < x a < f(x ) L < ) where the domain for the variables and consists of all positive real numbers 51

52 1.5 Nested Quantifiers Translating from Nested Quantifiers into English Example: Translate the statement x (C (x ) y (C (y) F(x, y))) into English: C (x ) is "x has a computer" F (x, y) is "x and y are friends, The domain for both x and y consists of all students in your faculty. The statement can be translated as: For every student x in your faculty, x has a computer or there is a student y such that y has a computer and x and y are friends. Every student in your faculty has a computer or has a friend who has a computer. 1.5 Nested Quantifiers Example: Translate the statement x y z ((F (x, y) F(x, z) (y z)) F(y, z)) into English: F(a, b) means a and b are friends The domain for x, y, and z consists of all students in your faculty We first examine the expression (F (x, y) F(x, z) (y z)) F(y, z) This expression means: If students x and y are friends, and students x and z are friends, and furthermore, if y and z are not the same student, then y and z are not friends. Then the original statement says that: There is a student x such that for all students y and all students z other than y, if x and y are friends and x and z are friends, then y and z are not friends. In other words, there is a student none of whose friends are also friends with each other. 52

53 1.5 Nested Quantifiers Translating English Sentences into Logical Expressions Example: Express the statement "If a person is female and is a parent, then this person is someone's mother" as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. This statement can be expressed as "For every person x, if person x is female and person x is a parent, then there exists a person y such that person x is the mother of person y." Suppose that: F(x) to represent "x is female," P(x) to represent "x is a parent," M (x, y) to represent "x is the mother of y." The original statement can be represented as: x (( F(x) P(x)) y M(x, y)) Because y is not in scope of universal quantifier then we can move y to the left after x We obtain the logically equivalent expression x y (( F(x) P(x)) M(x, y)) 1.5 Nested Quantifiers Example: Express the statement "Everyone has exactly one best friend" as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. This statement can be expressed as "For every person x, person x has exactly one best friend y. This means that there is a person y who is the best friend of x, and furthermore, that for every person z, if person z is not person y, then z is not the best friend of x. Consider B(x, y) be the statement "y is the best friend of x" Then our original statement can be expressed as: x y(b (x, y) z (( z y) B(x, z))). 53

54 1.5 Nested Quantifiers Negating Nested Quantifiers Recall negation rules for single quantifiers: x P(x) = x P(x) x P(x) = x P(x) Essentially, you change the quantifier(s), and negate what it s quantifying Examples: ( x y P(x, y)) = x y P(x, y) = x y P(x, y) ( x y z P(x, y, z)) = x y z P(x, y, z) = x y z P(x, y, z) = x y z P(x, y, z) 1.5 Nested Quantifiers Consider ( x y P(x, y)) = x y P(x, y) The left side is saying for all x, there exists a y such that P is true To disprove it (negate it), you need to show that there exists an x such that for all y, P is false Consider ( x y P(x, y)) = x y P(x, y) The left side is saying there exists an x such that for all y, P is true To disprove it (negate it), you need to show that for all x, there exists a y such that P is false 54

55 1.5 Nested Quantifiers Example: Express the negation of the statement x y (x y = 1) so that no negation precedes the quantifiers x y (x y=1) x y (x y = 1) x y (x y = 1) x y (x y 1) Exercises 1.5 Nested Quantifiers 1. Translate these statements into English, where the domain for each variable consists of all real numbers 2. Let Q(x, y) be the statement "x has sent an message to y," where the domain for both x and y is all students in your class. Express each of these quantifications in English. 55

56 Chapter 1.6 Rules of Inference Rules of Inference An argument in propositional logic is a sequence of statements that end with a conclusion. Valid mean that the conclusion, or final statement of the argument, must follow from the truth of the preceding statements, or premises, of the argument. An argument is valid if and only if it is impossible for all the premises to be true and the conclusion to be false. To deduce new statements from statements we use rules of inference which are templates for constructing valid arguments. Rules of inference are our basic tools for establishing the truth of statements. 56

57 Rules of Inference Valid Arguments in Propositional Logic Consider the following argument involving propositions: "If you have a current password, then you can log onto the network. [premise] "You have a current password. [premise] Therefore, "You can log onto the network. [conclusion] Assume that: p is "You have a current password" q is "You can log onto the network." Then, the argument has the form: p q p q where is the symbol that denotes "therefore. Rules of Inference We know that when p and q are propositional variables, the tatement ((p q) p) q is a tautology. In particular, when both p q and p are true, we know that q must also be true. We say this form of argument is valid because whenever all its premises are true, the conclusion must also be true. An argument is valid if the truth of all premises implies that the conclusion is true. i.e. (p 1 p 2 p n ) q is a tautology. Where p 1, p 2,, p n are premises and q is conclusion. An argument form in propositional logic is a sequence of compound propositions involving propositional variables. An argument form is valid no matter which particular propositions are substituted for the propositional variables in its premises, the conclusion is true if the premises are all true. 57

58 Rules of Inference Rules of Inference for Propositional Logic We can always use a truth table to show that an argument form is valid. Consider (p (p q)) q p p q q Rules of Inference we can first establish the validity of some relatively simple argument forms, called rules of inference. These rules of inference can be used as building blocks to construct more complicated valid argument forms. We will now introduce the most important rules of inference in propositional logic. Definition : modus ponens The tautology (p (p q)) q is the basis of the rule of inference called modus ponens. This tautology leads to the following valid argument form. 58

59 Rules of Inference Modus ponens may written as follow: p p q q Modus ponens tells us that if a conditional statement and the hypothesis of this conditional statement are both true, then the conclusion must also be true. Rules of Inference Example: Assume you are given the following two statements: you are in this class if you are in this class, you will get a grade Let p = you are in this class Let q = you will get a grade By Modus Ponens, you can conclude that you will get a grade Remark: A valid argument can lead to an incorrect conclusion if one or more of its premises is false. 59

60 Rules of Inference Example: Consider the argument: p q: p : 2 if 3 2 The premises of the argument are p q and p, q is its conclusion. 2 q: 2 This argument is valid because it is constructed by using modus ponens 3 2 and then However, one of its premises is false. 2 The conclusion of this argument is false 3 ( ) 2 3 ( ) There are many useful rules of inference for propositional logic. The most widely used of these are listed in Table Rules of Inference 60

61 Rules of Inference Definition: Modus Tollens Assume that we know: q and p q Recall that p q q p Thus, we know q and q p We can conclude p q p q p Rules of Inference Example: Assume you are given the following two statements: you will not get a grade if you are in this class, you will get a grade Let p = you are in this class Let q = you will get a grade By Modus Tollens, you can conclude that you are not in this class 61

62 Rules of Inference Definitions: Addition & Simplification Addition: If you know that p is true, then p q will ALWAYS be true p p q Simplification: If p q is true, then p will ALWAYS be true q p q Rules of Inference Example: State which rule of inference is the basis of the following argument: It is below freezing now. Therefore, it is either below freezing or raining now. Let p is "It is below freezing now," and q is "It is raining now." This argument is of the form: Then this argument is of the form: p p q This is an argument that uses the addition rule. 62

63 Rules of Inference Example: State which rule of inference is the basis of the following argument: It is below freezing and raining now. Therefore, it is below freezing now. Let p be the proposition It is below freezing now, and let q be the proposition It is raining now. This argument is of the form: p q p This argument uses the simplification rule. Rules of Inference Definitions: Hypothetical syllogism Example: State which rule of inference is used in the argument: If it rains today, then we will not have a barbecue today. If we do not have a barbecue today, then we will have a barbecue tomorrow. Therefore, if it rains today, then we will have a barbecue tomorrow. Let p be the proposition It is raining today, let q be the proposition We will not have a barbecue today, and let r be the proposition We will have a barbecue tomorrow. Then this argument is of the form p q q r p r Hence, this argument is a hypothetical syllogism. 63

64 Rules of Inference Example: State which rule of inference is used in the argument: If it rains today, then we will not have a sheep today. If we do not have a sheep today, then we will have a sheep tomorrow. Therefore, if it rains today, then we will have a sheep tomorrow. Let: p is "It is raining today, q is "We will not have a sheep today", r is "We will have a sheep tomorrow" Then this argument is of the form p q q r p r Hence, this argument is a hypothetical syllogism. Rules of Inference Using Rules of Inference to Build Arguments When there are many premises, several rules of inference are often needed to show that an argument is valid. Example: Show that the hypotheses "It is not sunny this afternoon and it is colder than yesterday" "We will go swimming only if it is sunny" "If we do not go swimming, then we will take a canoe trip" and "If we take a canoe trip, then we will be home by sunset" lead to the conclusion "We will be home by sunset" Let: p is "It is sunny this afternoon" q is "It is colder than yesterday" r is "We will go swimming" s is "We will take a canoe trip t is "We will be home by sunset" Then the hypotheses become p q, r p, r s, and s t. The conclusion is simply t. 64

65 Rules of Inference We need to give a valid argument with hypotheses and conclusion. We construct an argument to show that our hypotheses lead to the desired conclusion as follows: 1. p q Premise (1 st hypothesis) 2. p Simplification using step 1 3. r p Premise (2 nd hypothesis) 4. r Modus tollens using steps 2 & 3 5. r s Premise (3 rd hypothesis) 6. s Modus ponens using steps 4 & 5 7. s t Premise (4 th hypothesis) 8. t Modus ponens using steps 6 & 7 Note that: if we use a truth table to show a valid argument, we require 32 rows Because we are working with five propositional variables, p, q, r, s, and t. Rules of Inference Example : Show that the premises If you send me an message, then I will finish writing the program, If you do not send me an message, then I will go to sleep early, and If I go to sleep early, then I will wake up feeling refreshed lead to the conclusion: If I do not finish writing the program, then I will wake up feeling refreshed. Let p be the proposition You send me an message, q the proposition I will finish writing the program, r the proposition I will go to sleep early, and s the proposition I will wake up feeling refreshed. Then the premises are p q, p r, and r s. The desired conclusion is q s. We need to give a valid argument with premises p q, p r, and r s and conclusion q s. 65

66 Rules of Inference This argument form shows that the premises lead to the desired conclusion. Step Reason 1. p q Premise 2. q p Contrapositive of (1) 3. p r Premise 4. q r Hypothetical syllogism using (2) and (3) 5. r s Premise 6. q s Hypothetical syllogism using (4) and (5) Resolution Rules of Inference Computer programs have been developed to automate the task of reasoning and proving theorems. Many of these programs make use of a rule of inference known as resolution. This rule of inference is based on the tautology ((p q) ( p r)) (q r) The final disjunction in the resolution rule (q r) is called the resolvent. 66

67 Rules of Inference Example: Use resolution to show that the hypotheses Ahmed is skiing or it is not snowing and It is snowing or Ramy is playing hockey imply that Ahmed is skiing or Ramy is playing hockey. Let p be the proposition It is snowing, q the proposition Ahmed is skiing, and r the proposition Ramy is playing hockey. We can represent the hypotheses as p q and p r, respectively. Using resolution, the proposition q r, Ahmed is skiing or Ramy is playing hockey, follows. Rules of Inference Example: Show that the hypotheses: (p q) r and r s imply the conclusion p s. We can rewrite the hypothesis (p q) r as two clauses, p r and q r (p q) r (p r) (q r) We can also replace r s by the equivalent clause r s r s r s Using the two clauses p r and r s, we can use resolution to conclude p s 67

68 Fallacies Rules of Inference Several common fallacies arise in incorrect arguments. These fallacies are discussed here to show the distinction between correct and incorrect reasoning. The proposition [(p q) q] p is not a tautology, because it is false when p is false and q is true. However, there are many incorrect arguments that treat this as a tautology. In other words, they treat the argument with premises p q and q and conclusion p as a valid argument form, which it is not. This type of incorrect reasoning is called the fallacy of affirming the conclusion. Rules of Inference Example: Is the following argument valid? If you do every problem in this book, then you will learn discrete mathematics. You learned discrete mathematics. Therefore, you did every problem in this book. Let: p is "You did every problem in this book" q is "You learned discrete mathematics" Then this argument is of the form: if (p q and q) then p. [(p q) q] p This is an example of an incorrect argument using the fallacy of affirming the conclusion. Indeed, it is possible for you to learn discrete mathematics in some way other than by doing every problem in this book. You may learn discrete mathematics by reading, listening to lectures, doing some, but not all, the problems in this book, and so on 68

69 Rules of Inference The proposition [(p q) p] q is not a tautology, because it is false when p is false and q is true. However, there are many incorrect arguments use it as rule of inference This type of incorrect reasoning is called the fallacy of denying the hypothesis. Example: Let p and q be as in previous example. If the conditional statement p q is true, and p is true, is it correct to conclude that q is true? This incorrect argument is of the form p q and p imply q, which is an example of the fallacy of denying the hypothesis Rules of Inference Rules of Inference for Quantified Statements We will now describe some important rules of inference for statements involving quantifiers. Universal instantiation: is the rule of inference used to conclude that P(c) is true, where c is included in the domain of the premise x P(x). Universal generalization: is the rule of inference that states that x P(x) is true, given the premise that P(c) is true for all elements c in the domain Universal generalization is used when we show that x P(x) is true by taking an arbitrary element c from the domain and showing that P(c) is true 69

70 Rules of Inference Existential instantiation: is the rule that allows us to conclude that there is an element c in the domain for which P(c) is true if we know that x P(x) is true. We cannot select an arbitrary value of c here, but rather it must be a c for which P(c) is true. Usually we have no knowledge of what c is, only that it exists. Because it exists, we may give it a name (c) and continue our argument. Existential generalization: is the rule of inference that is used to conclude that x P(x) is true when a particular element c with P(c) true is known. That is, if we know one element c in the domain for which P(c) is true, then we know that x P(x) is true. Rules of Inference We summarize these rules of inference in this table 70

71 Rules of Inference Example: Show that the premises Everyone in this discrete mathematics class has taken a course in computer science and Ahmed is a student in this class imply the conclusion Ahmed has taken a course in computer science. Let D(x) denote x is in this discrete mathematics class, and let C(x) denote x has taken a course in computer science. Then the premises are x(d(x) C(x)) and D(Ahmed). The conclusion is C(Ahmed). The following steps can be used to establish the conclusion from the premises. Step Reason 1. x(d(x) C(x)) Premise 2. D(Ahmed) C(Ahmed) Universal instantiation from (1) 3. D(Ahmed) Premise 4. C(Ahmed) Modus ponens from (2) and (3) Rules of Inference Combining Rules of Inference for Propositions and Quantified Statements Sometimes we need to develop rules of inference both for propositions and for quantified statements. In previous two examples we used both universal instantiation and modus ponens. This combination of rules is sometimes called universal modus ponens. This rule tells us that if x(p(x) Q(x)) is true, and if P(a) is true for a particular element a in the domain of the universal quantifier, then Q(a) must also be true. We can describe universal modus ponens as follows : x (P(x) Q(x)) P (a ), where a is a particular element in the domain Q(a) 71

72 Rules of Inference Example: Assume that "For all positive integers n, if n is greater than 4, then n 2 is less than 2 n " is true. Use universal modus ponens to show that < Let: P(n) denote "n > 4" Q(n) denote "n 2 < 2 n " The original statement can be n(p(n) Q(n)) where the domain consists of all positive integers. We are assuming that n(p(n) Q(n)) is true. Note that: P(l00) is true because 100 > 4. It follows by universal modus ponens that Q(n) is true, namely that < Rules of Inference Exercises What rule of inference is used in each of these arguments? a) Alice is a mathematics major. Therefore, Alice is either a mathematics major or a computer science major. b) Jerry is a mathematics major and a computer science major. Therefore, Jerry is a mathematics major. c) If it is rainy, then the pool will be closed. It is rainy. Therefore, the pool is closed. d) If it snows today, the university will close. The university is not closed today. Therefore, it did not snow today. e) If I go swimming, then I will stay in the sun too long. If I stay in the sun too long, then I will sunburn. Therefore, if I go swimming, then I will sunburn. 72

73 Rules of Inference Rules of Inference 73

74 Chapter 1.7 Introduction to Proofs Introduction to Proofs We introduce the notion of a proof and describe methods for constructing proofs. A proof is a valid argument that establishes the truth of a mathematical statement. A proof can use: The hypotheses of the theorem, Axioms assumed to be true, Previously proven theorems Proof may be: Formal: where all steps were supplied, and the rules for each step in the argument were given. Informal: where more than one rule of inference may be used in each step, steps may be skipped, the axioms being assumed and the rules of inference used are not explicitly stated. Informal proofs can explain to humans why theorems are true, while computers are producing formal proofs using automated reasoning systems. 74

75 Introduction to Proofs Some Terminology A theorem is a statement that can be shown to be true. Sometimes called facts or results A Proposition: less important theorem A proof is a valid argument that establishes the truth of a theorem. We demonstrate that a theorem is true with a proof. An axiom is the statement used in a proof, which is assumed to be true A lemma is less important theorem that is helpful in the proof of other results A corollary is a theorem that can be established directly from a theorem that has been proved. A conjecture is a statement that is being proposed to be a true statement, usually on the basis of some partial evidence, a heuristic argument, or the intuition of an expert Introduction to Proofs Understanding How Theorems Are Stated Many theorems assert that a property holds for all elements in a domain, such as integers or the real numbers. Although the precise statement of such theorems needs to include a universal quantifier. Sometimes we ignore the quantifiers For example, the statement: "If x > y, where x and y are positive real numbers, then x 2 > y 2 " really means: "For all positive real numbers x and y, if x > y, then x 2 > y 2 Steps of proof: Selecting a general element of the domain. Showing that this element has the property in question. Assuring that the theorem holds for all members of the domain. 75

76 Introduction to Proofs Methods of Proving Theorems There are several methods that can be used for proving theorems: 1. Direct proofs 2. Proof by Contraposition (Indirect proofs) 3. Vacuous proofs 4. Trivial proofs 5. Proof by contradiction 6. Proof by cases 7. Proofs of equivalence 8. Existence proofs 9. Uniqueness proofs 10. Counterexamples Introduction to Proofs Direct Proofs A direct proof of a conditional statement p q is constructed when the first step is the assumption that p is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. A direct proof shows that a conditional statement p q is true by showing that if p is true, then q must also be true, so that the combination p true and q false never occurs. In a direct proof, we assume that p is true and use axioms, definitions, and previously proven theorems, together with rules of inference, to show that q must also be true. DEFINITION : The integer n is even if there exists an integer k such that n = 2k, and n is odd if there exists an integer k such that n = 2k + 1. Note that: an integer is either even or odd, and no integer is both even & odd. 76

77 Introduction to Proofs Example: Give a direct proof of the theorem Show that the square of an odd number is an odd number Rephrased: if n is odd, then n 2 is odd Note that this theorem states n P ((n) Q(n)), where P(n) is n is an odd integer and Q(n) is n 2 is odd. As we have said, we will follow the usual convention in mathematical proofs by showing that P(n) implies Q(n), and not explicitly using universal instantiation. Now we assume that n is odd Thus, n = 2k+1, for some k (definition of odd numbers) n 2 = (2k+1) 2 = 4k 2 + 4k +1 = 2(2k 2 +2k)+1 By the definition of an odd integer, As n 2 is 2 times an integer +1, we can conclude that n2 is an odd integer Prove that: Show that the square of an even number is an even number Rephrased: if n is even, then n 2 is even Introduction to Proofs Example: Give a direct proof of the theorem Give a direct proof that if m and n are both perfect squares, then nm is also a perfect square. (An integer a is a perfect square if there is an integer b such that a = b 2.) we assume that m and n are both perfect squares. that there are integers s and t such that m = s 2 and n = t 2. The goal of the proof is to show that mn must also be a perfect square mn = s 2 t 2. Hence, mn = s 2 t 2 = (s s )(t t ) = (s t)(s t) = (s t) 2, using commutativity and associativity of multiplication. By the definition of perfect square, it follows that mn is also a perfect square. 77

78 Introduction to Proofs Proof by Contraposition (indirect proof) An extremely useful type of indirect proof is known as proof by contraposition. Proofs by contraposition make use of the fact that the conditional statement p q is equivalent to its contrapositive, q p. This means that the conditional statement p q can be proved by showing that its contrapositive, q p, is true. In a proof by contraposition of p q, we take q as a premise (hypothesis), and using axioms, definitions, and previously proven theorems, together with rules of inference, we show that p must follow. Introduction to Proofs Example: prove that If n 2 is an odd integer then n is an odd integer We can prove the contrapositive: If n is an even integer, then n 2 is an even integer Now suppose that: n=2k for some integer k (definition of even numbers) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) Since n 2 is 2 times an integer, it is even This is the negation of the hypothesis of the theorem. Then the original conditional statement is true Since the negation of the conclusion of the conditional statement implies that the hypothesis is false 78

79 Introduction to Proofs Example of which to use Prove that if n is an integer and n 3 +5 is odd, then n is even a) direct proof n 3 +5 = 2k+1 for some integer k (definition of odd numbers) n 3 = 2k-4 Umm n 3 2k 4??? So direct proof didn t work out. b) indirect proof Contrapositive: If n is odd, then n 3 +5 is even Assume n is odd, and show that n 3 +5 is even n=2k+1 for some integer k (definition of odd numbers) n 3 +5 = (2k+1) 3 +5 = 8k 3 +12k 2 +6k+6 = 2(4k 3 +6k 2 +3k+3) n 3 +5 is 2 times an integer, it is even Then the original conditional statement is true Introduction to Proofs Example: Prove that if n is an integer and 3n + 2 is odd, then n is odd a) direct proof. Assume that 3n + 2 is an odd integer. This means that 3n + 2 = 2k + 1 for some integer k. Can we use this fact to show that n is odd? We see that 3n + 1 = 2k, But there does not seem to be any direct way to conclude that n is odd. b) indirect proof. Assume that the conclusion of the original statement is false (i.e. n is even) Then n = 2k for some integer k. 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1). This tells us that 3n + 2 is even and therefore not odd. This is the negation of the hypothesis of the theorem. Then the original conditional statement is true. 79

80 Introduction to Proofs Proofs by Contradiction Suppose we want to prove that a statement p is true. Furthermore, suppose that we can find a contradiction q such that p q is true. Because q is false, but p q is true, we can conclude that p is false, which means that p is true. How can we find a contradiction q? It is known that (r r) is a contradiction whenever r is a proposition Then we can prove that p is true if we can show that: p (r r) is true for some proposition r. Proofs of this type are called proofs by contradiction. Remark: Because a proof by contradiction does not prove a result directly, it is another type of indirect proof Introduction to Proofs Example: Give a proof by contradiction of the theorem "If 3n + 2 is odd, then n is odd. Let p be 3n + 2 is odd and q be n is odd. To construct a proof by contradiction, assume that both p and q are true. That is, assume that 3n + 2 is odd and that n is even. Because n is even, there is an integer k such that n = 2k. This implies that 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1). Because 3n + 2 is 2t, where t = 3k + 1, 3n + 2 is even. Note that the statement 3n + 2 is even is equivalent to the p, because an integer is even if and only if it is not odd. Because both p and p are true, we have a contradiction. This completes the proof by contradiction, proving that if 3n + 2 is odd, then n is odd. 80

81 Introduction to Proofs Example: Prove that if n is an integer and n 3 +5 is odd, then n is even We can rewrite the theorem as: If n 3 +5 is odd, then n is even Let p is n 3 +5 is odd and q is n is even Assume p is true and q is false This means that n 3 +5 is odd, and n is odd n=2k+1 for some integer k (definition of odd numbers) n 3 +5 = (2k+1) 3 +5 = 8k 3 +12k 2 +6k+6 = 2(4k 3 +6k 2 +3k+3) As 2(4k 3 +6k 2 +3k+3) is 2 times an integer, It must be even This leads to contradiction, Which prove the theorem. Introduction to Proofs Proofs of equivalence To prove a theorem that is a biconditional statement (of the form P q), we show that p q and q p are both true. The validity of this approach is based on the tautology: (p q) [(p q) (q p)] Example: Prove the theorem "If n is a positive integer, then n is odd if and only if n 2 is odd." This theorem has the form p if and only if q" where p is "n is odd" and q is "n 2 is odd To prove this theorem, we need to show that p q and q p are true We have already shown that p q and q p are true Then the theorem is true. 81

82 Introduction to Proofs Example: Show that m 2 =n 2 if and only if m=n or m=-n Rephrased: (m 2 =n 2 ) [(m=n) (m=-n)] Suppose that [(m=n) (m=-n)] (m 2 =n 2 ) Proof by cases! Case 1: (m=n) (m 2 =n 2 ) (m) 2 = m 2, and (n) 2 = n 2, so this case is proven Case 2: (m=-n) (m 2 =n 2 ) (m) 2 = m 2, and (-n) 2 = n 2, so this case is proven (m 2 =n 2 ) [(m=n) (m=-n)] Subtract n 2 from both sides to get m 2 -n 2 =0 Factor to get (m + n)(m - n) = 0 Since that equals zero, one of the factors must be zero Thus, either m + n=0 (which means m = - n) Or m - n=0 (which means m = n) Introduction to Proofs Mistakes in Proofs There are many common errors made in constructing mathematical proofs. Among the most common errors are mistakes in arithmetic and basic algebra. Whenever you use such computations you should check them as carefully as possible. Each step of a mathematical proof needs to be correct and the conclusion needs to follow logically from the steps that precede it. Many mistakes result from the introduction of steps that do not logically follow from those that precede it. 82

83 Introduction to Proofs Example: What is wrong with this famous supposed "proof" that 1 = 2? "Proof:" We use these steps, where a and b are two equal positive integers. Every step is valid except step 5 Where we divided both sides by a-b. The error is that a - b equals zero; Note that: division of both sides of an equation by the same quantity is valid as long as this quantity is not zero. Introduction to Proofs What s wrong with this proof? Theorem: All numbers are equal to 0. Proof: Suppose a = b. Then a 2 = a b. Then a 2 - b 2 = a b - b 2. Then (a - b)(a + b) = b(a - b). Then a + b = b. Therefore, a = 0 83

ECOM Discrete Mathematics

ECOM Discrete Mathematics ECOM 2311- Discrete Mathematics Chapter # 1 : The Foundations: Logic and Proofs Fall, 2013/2014 ECOM 2311- Discrete Mathematics - Ch.1 Dr. Musbah Shaat 1 / 85 Outline 1 Propositional Logic 2 Propositional

More information

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1) CS100: DISCREE SRUCURES Lecture 5: Logic (Ch1) Lecture Overview 2 Statement Logical Connectives Conjunction Disjunction Propositions Conditional Bio-conditional Converse Inverse Contrapositive Laws of

More information

DISCRETE MATHEMATICS BA202

DISCRETE MATHEMATICS BA202 TOPIC 1 BASIC LOGIC This topic deals with propositional logic, logical connectives and truth tables and validity. Predicate logic, universal and existential quantification are discussed 1.1 PROPOSITION

More information

software design & management Gachon University Chulyun Kim

software design & management Gachon University Chulyun Kim Gachon University Chulyun Kim 2 Outline Propositional Logic Propositional Equivalences Predicates and Quantifiers Nested Quantifiers Rules of Inference Introduction to Proofs 3 1.1 Propositional Logic

More information

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic Discrete Mathematical Structures Chapter 1 he oundation: Logic 1 Lecture Overview 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Quantifiers l l l l l Statement Logical Connectives Conjunction

More information

Discrete Mathematics and Its Applications

Discrete Mathematics and Its Applications Discrete Mathematics and Its Applications Lecture 1: The Foundations: Logic and Proofs (1.3-1.5) MING GAO DASE @ ECNU (for course related communications) mgao@dase.ecnu.edu.cn Sep. 19, 2017 Outline 1 Logical

More information

Predicate Logic & Quantification

Predicate Logic & Quantification Predicate Logic & Quantification Things you should do Homework 1 due today at 3pm Via gradescope. Directions posted on the website. Group homework 1 posted, due Tuesday. Groups of 1-3. We suggest 3. In

More information

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations Logic Propositions and logical operations Main concepts: propositions truth values propositional variables logical operations 1 Propositions and logical operations A proposition is the most basic element

More information

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Why Learning Logic? Logic. Propositional Logic. Compound Propositions Logic Objectives Propositions and compound propositions Negation, conjunction, disjunction, and exclusive or Implication and biconditional Logic equivalence and satisfiability Application of propositional

More information

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1. Chapter 1 Chapter Summary Propositional Logic The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.3) Predicate Logic The Language of Quantifiers (1.4) Logical Equivalences (1.4)

More information

PROPOSITIONAL CALCULUS

PROPOSITIONAL CALCULUS PROPOSITIONAL CALCULUS A proposition is a complete declarative sentence that is either TRUE (truth value T or 1) or FALSE (truth value F or 0), but not both. These are not propositions! Connectives and

More information

Logic Overview, I. and T T T T F F F T F F F F

Logic Overview, I. and T T T T F F F T F F F F Logic Overview, I DEFINITIONS A statement (proposition) is a declarative sentence that can be assigned a truth value T or F, but not both. Statements are denoted by letters p, q, r, s,... The 5 basic logical

More information

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional Logical Operators Conjunction Disjunction Negation Exclusive Or Implication Biconditional 1 Statement meaning p q p implies q if p, then q if p, q when p, q whenever p, q q if p q when p q whenever p p

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics Statistics York University Sept 18, 2014 Outline 1 2 Tautologies Definition A tautology is a compound proposition

More information

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes: Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements. An inference mechanism (a collection of rules) to

More information

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations Chapter 1, Part I: Propositional Logic With Question/Answer Animations Chapter Summary Propositional Logic The Language of Propositions Applications Logical Equivalences Predicate Logic The Language of

More information

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows. Chapter 1 Logic 1.1 Introduction and Definitions Definitions. A sentence (statement, proposition) is an utterance (that is, a string of characters) which is either true (T) or false (F). A predicate is

More information

Section Summary. Section 1.5 9/9/2014

Section Summary. Section 1.5 9/9/2014 Section 1.5 Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements into Statements involving Nested Quantifiers Translated

More information

Intro to Logic and Proofs

Intro to Logic and Proofs Intro to Logic and Proofs Propositions A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. Examples: It is raining today. Washington

More information

Announcements CompSci 102 Discrete Math for Computer Science

Announcements CompSci 102 Discrete Math for Computer Science Announcements CompSci 102 Discrete Math for Computer Science Read for next time Chap. 1.4-1.6 Recitation 1 is tomorrow Homework will be posted by Friday January 19, 2012 Today more logic Prof. Rodger Most

More information

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04 An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04 1 A Taste of Logic Logic puzzles (1) Knights and Knaves Knights: always tell the truth Knaves: always lie You encounter two people A and B. A says:

More information

1 The Foundation: Logic and Proofs

1 The Foundation: Logic and Proofs 1 The Foundation: Logic and Proofs 1.1 Propositional Logic Propositions( 명제 ) a declarative sentence that is either true or false, but not both nor neither letters denoting propositions p, q, r, s, T:

More information

MAT2345 Discrete Math

MAT2345 Discrete Math Fall 2013 General Syllabus Schedule (note exam dates) Homework, Worksheets, Quizzes, and possibly Programs & Reports Academic Integrity Do Your Own Work Course Web Site: www.eiu.edu/~mathcs Course Overview

More information

Chapter 1: The Logic of Compound Statements. January 7, 2008

Chapter 1: The Logic of Compound Statements. January 7, 2008 Chapter 1: The Logic of Compound Statements January 7, 2008 Outline 1 1.1 Logical Form and Logical Equivalence 2 1.2 Conditional Statements 3 1.3 Valid and Invalid Arguments Central notion of deductive

More information

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 1.1 - Logical Form and Logical Equivalence Definition. A statement or proposition is a sentence that is either true or false, but not both. ex. 1 + 2 = 3 IS a statement

More information

CSC Discrete Math I, Spring Propositional Logic

CSC Discrete Math I, Spring Propositional Logic CSC 125 - Discrete Math I, Spring 2017 Propositional Logic Propositions A proposition is a declarative sentence that is either true or false Propositional Variables A propositional variable (p, q, r, s,...)

More information

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier Section 1.4 Section Summary Predicate logic Quantifiers Universal Quantifier Existential Quantifier Negating Quantifiers De Morgan s Laws for Quantifiers Translating English to Logic Propositional Logic

More information

1 The Foundation: Logic and Proofs

1 The Foundation: Logic and Proofs 1 The Foundation: Logic and Proofs 1.1 Propositional Logic Propositions( ) a declarative sentence that is either true or false, but not both nor neither letters denoting propostions p, q, r, s, T: true

More information

Mat 243 Exam 1 Review

Mat 243 Exam 1 Review OBJECTIVES (Review problems: on next page) 1.1 Distinguish between propositions and non-propositions. Know the truth tables (i.e., the definitions) of the logical operators,,,, and Write truth tables for

More information

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

What is Logic? Introduction to Logic. Simple Statements. Which one is statement? What is Logic? Introduction to Logic Peter Lo Logic is the study of reasoning It is specifically concerned with whether reasoning is correct Logic is also known as Propositional Calculus CS218 Peter Lo

More information

1.3 Predicates and Quantifiers

1.3 Predicates and Quantifiers 1.3 Predicates and Quantifiers INTRODUCTION Statements x>3, x=y+3 and x + y=z are not propositions, if the variables are not specified. In this section we discuss the ways of producing propositions from

More information

Compound Propositions

Compound Propositions Discrete Structures Compound Propositions Producing new propositions from existing propositions. Logical Operators or Connectives 1. Not 2. And 3. Or 4. Exclusive or 5. Implication 6. Biconditional Truth

More information

Propositional Logic Not Enough

Propositional Logic Not Enough Section 1.4 Propositional Logic Not Enough If we have: All men are mortal. Socrates is a man. Does it follow that Socrates is mortal? Can t be represented in propositional logic. Need a language that talks

More information

Predicate Logic. Andreas Klappenecker

Predicate Logic. Andreas Klappenecker Predicate Logic Andreas Klappenecker Predicates A function P from a set D to the set Prop of propositions is called a predicate. The set D is called the domain of P. Example Let D=Z be the set of integers.

More information

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications: Tools for reasoning: Logic Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications: 1 Why study propositional logic? A formal mathematical language for precise

More information

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University COMP 182 Algorithmic Thinking Proofs Luay Nakhleh Computer Science Rice University 1 Reading Material Chapter 1, Section 3, 6, 7, 8 Propositional Equivalences The compound propositions p and q are called

More information

Logic and Proof. Aiichiro Nakano

Logic and Proof. Aiichiro Nakano Logic and Proof Aiichiro Nakano Collaboratory for Advanced Computing & Simulations Department of Computer Science Department of Physics & Astronomy Department of Chemical Engineering & Materials Science

More information

Section 1.1 Propositions

Section 1.1 Propositions Set Theory & Logic Section 1.1 Propositions Fall, 2009 Section 1.1 Propositions In Chapter 1, our main goals are to prove sentences about numbers, equations or functions and to write the proofs. Definition.

More information

Chapter 1 Elementary Logic

Chapter 1 Elementary Logic 2017-2018 Chapter 1 Elementary Logic The study of logic is the study of the principles and methods used in distinguishing valid arguments from those that are not valid. The aim of this chapter is to help

More information

Math 3336: Discrete Mathematics Practice Problems for Exam I

Math 3336: Discrete Mathematics Practice Problems for Exam I Math 3336: Discrete Mathematics Practice Problems for Exam I The upcoming exam on Tuesday, February 26, will cover the material in Chapter 1 and Chapter 2*. You will be provided with a sheet containing

More information

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017 3. The Logic of Quantified Statements Summary Aaron Tan 28 31 August 2017 1 3. The Logic of Quantified Statements 3.1 Predicates and Quantified Statements I Predicate; domain; truth set Universal quantifier,

More information

Logic and Propositional Calculus

Logic and Propositional Calculus CHAPTER 4 Logic and Propositional Calculus 4.1 INTRODUCTION Many algorithms and proofs use logical expressions such as: IF p THEN q or If p 1 AND p 2, THEN q 1 OR q 2 Therefore it is necessary to know

More information

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall CSE 20 HW1 graded review form? HW2 released DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Translate sentences from English to propositional logic using appropriate

More information

1.1 Language and Logic

1.1 Language and Logic c Oksana Shatalov, Fall 2017 1 1.1 Language and Logic Mathematical Statements DEFINITION 1. A proposition is any declarative sentence (i.e. it has both a subject and a verb) that is either true or false,

More information

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier Section 1.4 Section Summary Predicate logic Quantifiers Universal Quantifier Existential Quantifier Negating Quantifiers De Morgan s Laws for Quantifiers Translating English to Logic Propositional Logic

More information

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional) Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.6) TOPICS Propositional Logic Logical Operators Truth Tables Implication Logical Equivalence Inference Rules What you should know about propositional

More information

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both.

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both. he oundations. Logic Propositions are building blocks of logic. A proposition is a declarative sentence that is either true or false, but not both. Example. Declarative sentences.. Ottawa is the capital

More information

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics Unit I LOGIC AND PROOFS B. Thilaka Applied Mathematics UNIT I LOGIC AND PROOFS Propositional Logic Propositional equivalences Predicates and Quantifiers Nested Quantifiers Rules of inference Introduction

More information

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook) Lecture 2 Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits Reading (Epp s textbook) 2.1-2.4 1 Logic Logic is a system based on statements. A statement (or

More information

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker CSCE 222 Discrete Structures for Computing Predicate Logic Dr. Hyunyoung Lee Based on slides by Andreas Klappenecker 1 Predicates A function P from a set D to the set Prop of propositions is called a predicate.

More information

Logic and Proofs. (A brief summary)

Logic and Proofs. (A brief summary) Logic and Proofs (A brief summary) Why Study Logic: To learn to prove claims/statements rigorously To be able to judge better the soundness and consistency of (others ) arguments To gain the foundations

More information

EECS 1028 M: Discrete Mathematics for Engineers

EECS 1028 M: Discrete Mathematics for Engineers EECS 1028 M: Discrete Mathematics for Engineers Suprakash Datta Office: LAS 3043 Course page: http://www.eecs.yorku.ca/course/1028 Also on Moodle S. Datta (York Univ.) EECS 1028 W 18 1 / 26 Why Study Logic?

More information

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference Logic? Propositional Logic (Rosen, Chapter 1.1 1.3) TOPICS Propositional Logic Truth Tables Implication Logical Proofs 10/1/12 CS160 Fall Semester 2012 2 What is logic? Logic is a truth-preserving system

More information

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning. 3: Logic Why logic? Logic about inference or argument Start from assumptions or axioms Make deductions according to rules of reasoning Logic 3-1 Why logic? (continued) If I don t buy a lottery ticket on

More information

2. Use quantifiers to express the associative law for multiplication of real numbers.

2. Use quantifiers to express the associative law for multiplication of real numbers. 1. Define statement function of one variable. When it will become a statement? Statement function is an expression containing symbols and an individual variable. It becomes a statement when the variable

More information

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.3) TOPICS Propositional Logic Logical Operations Equivalences Predicate Logic CS160 - Spring Semester 2014 2 What

More information

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics CSC 224/226 Notes Packet #2: Set Theory & Predicate Calculus Barnes Packet #2: Set Theory & Predicate Calculus Applied Discrete Mathematics Table of Contents Full Adder Information Page 1 Predicate Calculus

More information

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

2. The Logic of Compound Statements Summary. Aaron Tan August 2017 2. The Logic of Compound Statements Summary Aaron Tan 21 25 August 2017 1 2. The Logic of Compound Statements 2.1 Logical Form and Logical Equivalence Statements; Compound Statements; Statement Form (Propositional

More information

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations Chapter 1, Part I: Propositional Logic With Question/Answer Animations Chapter Summary! Propositional Logic! The Language of Propositions! Applications! Logical Equivalences! Predicate Logic! The Language

More information

2-4: The Use of Quantifiers

2-4: The Use of Quantifiers 2-4: The Use of Quantifiers The number x + 2 is an even integer is not a statement. When x is replaced by 1, 3 or 5 the resulting statement is false. However, when x is replaced by 2, 4 or 6 the resulting

More information

Logic and Propositional Calculus

Logic and Propositional Calculus CHAPTER 4 Logic and Propositional Calculus 4.1 INTRODUCTION Many algorithms and proofs use logical expressions such as: IF p THEN q or If p 1 AND p 2, THEN q 1 OR q 2 Therefore it is necessary to know

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Originals slides by Dr. Baek and Dr. Still, adapted by J. Stelovsky Based on slides Dr. M. P. Frank and Dr. J.L. Gross

More information

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional. Review Propositional Logic Propositions atomic and compound Operators: negation, and, or, xor, implies, biconditional Truth tables A closer look at implies Translating from/ to English Converse, inverse,

More information

HANDOUT AND SET THEORY. Ariyadi Wijaya

HANDOUT AND SET THEORY. Ariyadi Wijaya HANDOUT LOGIC AND SET THEORY Ariyadi Wijaya Mathematics Education Department Faculty of Mathematics and Natural Science Yogyakarta State University 2009 1 Mathematics Education Department Faculty of Mathematics

More information

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship. LOGIC In mathematical and everyday English language, we frequently use logic to express our thoughts verbally and in writing. We also use logic in numerous other areas such as computer coding, probability,

More information

1.1 Language and Logic

1.1 Language and Logic c Oksana Shatalov, Spring 2018 1 1.1 Language and Logic Mathematical Statements DEFINITION 1. A proposition is any declarative sentence (i.e. it has both a subject and a verb) that is either true or false,

More information

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.7, 5.5) TOPICS Sets and Functions Propositional and Predicate Logic Logical Operators and Truth Tables Logical Equivalences and Inference

More information

Solutions to Exercises (Sections )

Solutions to Exercises (Sections ) s to Exercises (Sections 1.1-1.10) Section 1.1 Exercise 1.1.1: Identifying propositions (a) Have a nice day. : Command, not a proposition. (b) The soup is cold. : Proposition. Negation: The soup is not

More information

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) (2011 Admission Onwards) I Semester Core Course FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK 1) If A and B are two sets

More information

Chapter 4, Logic using Propositional Calculus Handout

Chapter 4, Logic using Propositional Calculus Handout ECS 20 Chapter 4, Logic using Propositional Calculus Handout 0. Introduction to Discrete Mathematics. 0.1. Discrete = Individually separate and distinct as opposed to continuous and capable of infinitesimal

More information

Logic and Proofs. (A brief summary)

Logic and Proofs. (A brief summary) Logic and Proofs (A brief summary) Why Study Logic: To learn to prove claims/statements rigorously To be able to judge better the soundness and consistency of (others ) arguments To gain the foundations

More information

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel LECTURE NOTES on DISCRETE MATHEMATICS Eusebius Doedel 1 LOGIC Introduction. First we introduce some basic concepts needed in our discussion of logic. These will be covered in more detail later. A set is

More information

1 Predicates and Quantifiers

1 Predicates and Quantifiers 1 Predicates and Quantifiers We have seen how to represent properties of objects. For example, B(x) may represent that x is a student at Bryn Mawr College. Here B stands for is a student at Bryn Mawr College

More information

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC Discrete Structures & Algorithms Propositional Logic EECE 320 // UBC 1 Review of last lecture Pancake sorting A problem with many applications Bracketing (bounding a function) Proving bounds for pancake

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Originals slides by Dr. Baek and Dr. Still, adapted by J. Stelovsky Based on slides Dr. M. P. Frank and Dr. J.L. Gross

More information

Propositional Logic. Spring Propositional Logic Spring / 32

Propositional Logic. Spring Propositional Logic Spring / 32 Propositional Logic Spring 2016 Propositional Logic Spring 2016 1 / 32 Introduction Learning Outcomes for this Presentation Learning Outcomes... At the conclusion of this session, we will Define the elements

More information

Discrete Mathematics and Applications COT3100

Discrete Mathematics and Applications COT3100 Discrete Mathematics and Applications CO3100 Dr. Ungor Sources: Slides are based on Dr. G. Bebis material. uesday, January 7, 2014 oundations of Logic: Overview Propositional logic: (Sections 1.1-1.3)

More information

Propositional Logic 1

Propositional Logic 1 Propositional Logic 1 Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth Tables 2 Propositions A proposition is

More information

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC I. BASICS OF PROPOSITIONAL LOGIC George Boole (1815-1864) developed logic as an abstract mathematical system consisting of propositions, operations (conjunction, disjunction, and negation), and rules for

More information

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference CSI 2350, Discrete Structures Chapter 1, Logic and Proofs (3) Young-Rae Cho Associate Professor Department of Computer Science Baylor University 1.6. Rules of Inference Basic Terminology Axiom: a statement

More information

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS All dogs have four legs. All tables have four legs. Therefore, all dogs are tables LOGIC Logic is a science of the necessary laws of thought, without which no employment

More information

MAT 243 Test 1 SOLUTIONS, FORM A

MAT 243 Test 1 SOLUTIONS, FORM A t MAT 243 Test 1 SOLUTIONS, FORM A 1. [10 points] Rewrite the statement below in positive form (i.e., so that all negation symbols immediately precede a predicate). ( x IR)( y IR)((T (x, y) Q(x, y)) R(x,

More information

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers Sec$on Summary (K. Rosen notes for Ch. 1.4, 1.5 corrected and extended by A.Borgida)! Predicates! Variables! Quantifiers! Universal Quantifier! Existential Quantifier! Negating Quantifiers! De Morgan s

More information

Review: Potential stumbling blocks

Review: Potential stumbling blocks Review: Potential stumbling blocks Whether the negation sign is on the inside or the outside of a quantified statement makes a big difference! Example: Let T(x) x is tall. Consider the following: x T(x)

More information

1.1 Statements and Compound Statements

1.1 Statements and Compound Statements Chapter 1 Propositional Logic 1.1 Statements and Compound Statements A statement or proposition is an assertion which is either true or false, though you may not know which. That is, a statement is something

More information

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures Formal Logic: Quantifiers, Predicates, and Validity CS 130 Discrete Structures Variables and Statements Variables: A variable is a symbol that stands for an individual in a collection or set. For example,

More information

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof Discrete Mathematic Chapter 1: Logic and Proof 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers Dr Patrick Chan School of Computer Science and Engineering South China University of Technology http://125.216.243.100/dm/

More information

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo Predicate Logic CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo c Xin He (University at Buffalo) CSE 191 Discrete Structures 1 / 22 Outline 1 From Proposition to Predicate

More information

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks CS 220: Discrete Structures and their Applications Predicate Logic Section 1.6-1.10 in zybooks From propositional to predicate logic Let s consider the statement x is an odd number Its truth value depends

More information

Rules of Inference. Arguments and Validity

Rules of Inference. Arguments and Validity Arguments and Validity A formal argument in propositional logic is a sequence of propositions, starting with a premise or set of premises, and ending in a conclusion. We say that an argument is valid if

More information

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Discrete Structures of Computer Science Propositional Logic III Rules of Inference Discrete Structures of Computer Science Propositional Logic III Rules of Inference Gazihan Alankuş (Based on original slides by Brahim Hnich) July 30, 2012 1 Previous Lecture 2 Summary of Laws of Logic

More information

Section 1.1: Logical Form and Logical Equivalence

Section 1.1: Logical Form and Logical Equivalence Section 1.1: Logical Form and Logical Equivalence An argument is a sequence of statements aimed at demonstrating the truth of an assertion. The assertion at the end of an argument is called the conclusion,

More information

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here. Chapter 2 Mathematics and Logic Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here. 2.1 A Taste of Number Theory In this section, we will

More information

Logic, Sets, and Proofs

Logic, Sets, and Proofs Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Operators. A logical statement is a mathematical statement that can be assigned a value either true or false.

More information

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9 Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9 Typeset September 23, 2005 1 Statements or propositions Defn: A statement is an assertion

More information

Predicate Calculus lecture 1

Predicate Calculus lecture 1 Predicate Calculus lecture 1 Section 1.3 Limitation of Propositional Logic Consider the following reasoning All cats have tails Gouchi is a cat Therefore, Gouchi has tail. MSU/CSE 260 Fall 2009 1 MSU/CSE

More information

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. Math 0413 Appendix A.0 Logic Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. This type of logic is called propositional.

More information

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team KS091201 MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE Discrete Math Team 2 -- KS091201 MD W-04 Outline Valid Arguments Modus Ponens Modus Tollens Addition and Simplification More Rules

More information

Proposi'onal Logic Not Enough

Proposi'onal Logic Not Enough Section 1.4 Proposi'onal Logic Not Enough If we have: All men are mortal. Socrates is a man. Socrates is mortal Compare to: If it is snowing, then I will study discrete math. It is snowing. I will study

More information