Chapter 5: Section 5-1 Mathematical Logic D. S. Malik Creighton University, Omaha, NE D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 1 / 29
Mathematical Logic Intuitively, logic is the discipline that considers the methods of reasoning. It provides the rules and techniques for determining whether an argument is valid or not. In everyday life, we use reasoning to prove different points. For example, to prove to our parents that we passed an exam, we might show the test and the score. Similarly, in mathematics, mathematical logic (or logic) is used to prove results. To be specific, in mathematics, we use logic or logical reasoning to prove theorems. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 2 / 29
Statements (Proposition) Definition A statement or a proposition is a declarative sentence that is either true or false, but not both. Example Consider the following sentences. (i) 4 is an integer. (ii) 5 is an integer. (iii) Washington, DC, is the capital of the USA. Each of these sentences is a declarative sentence. The sentence (i) is true, (ii) is not true, and (iii) is true. Hence, these are examples of statements.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 3 / 29
We use lowercase letters, with or without subscripts, such as p, q, and r, to denote sentences or statements. For example, we can write p : 4 is an integer. q : 5 is an integer. r : Washington, DC, is the capital of the U.S.A. Example Consider the following sentences: p : 5 is greater than 3. q : 7 is an even integer. Both p and q are declarative sentences. Thus, p and q are statements. Moreover, p is true and q is false.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 4 / 29
Example Consider the following sentences. p : Will you go? q : Shall we enjoy the lovely weather? Here the sentences p and q are not declarative sentences, so these are not statements.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 5 / 29
A statement is a declarative sentence that can be classified as true or false, but not both. One of the values truth or false that is assigned to a statement is called its truth value. We abbreviate truth to T or 1 and false to F or 0. If a statement p is true, we say that the (logical) truth value of p is true and write p is T (or p is 1); otherwise, we say the (logical) truth value of p is false and write p is F (or p is 0). D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 6 / 29
Compound Statements Consider the following statements. 1 I will not go to the basketball game today. 2 I paid my bill in the morning and I went to the gym in the evening. 3 You can go to Chicago or you can go to Paris. 4 If I win the competition, then I will win the scholarship money. 5 Study hard and get good grades, or lose the scholarship. These are examples of compound statements. Moreover, not, and, or, and, if... then are called logical connectives or simply connectives. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 7 / 29
Example (i) Consider the statement 4 is a prime number. The negation of this statement is 4 is not a prime number. Hence, 4 is not a prime number is a compound statement. (iii) You can borrow the car and buy the groceries. This is a compound statement because it contains the connective and. (iv) If ABC is a right-angled triangle, then one of its angle is 90 o. This is a compound statement because it contains the connective if... then. (v) I invested in the Smith and Barney company. This is not a compound statement. The word and is part of the name of the company.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 8 / 29
Negation Definition Let p be a statement. The negation of p, written p, is the statement obtained by negating the statement p. The truth value of p and p are opposite. The symbol is called not. We read p as not p. If p is a statement, then its negation is formed by writing it is not the case that p. For example, if then p : 2 is positive, p : it is not the case that 2 is positive. Sometimes, p is also written as follows: p : 2 is not positive.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 9 / 29
By the definition of the negation of a statement p, the truth value of p is opposite to the truth value of p, i.e., if p is T, then p is F and if p is F, then p is T. We record this in a table, called a truth table, as follows: p p T F F T Example Consider the statement The negation of this statement is The Rockie Mountains are in Colorado. The Rockie Mountains are not in Colorado.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 10 / 29
Conjunction Consider the following statements: Now consider the sentence p : 2 is an even integer. q : 7 divides 14. r : 2 is an even integer and 7 divides 14. Because r is true, r is a statement. Such a statement r is called the conjunction of p and q. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 11 / 29
Conjunction Definition Let p and q be statements. The conjunction of p and q, written p q, is the statement formed by joining the statements p and q using the word and. The statement p q is true if both p and q are true; otherwise p q is false. The symbol is called and. Let p and q be statements. The truth table of p q is given by: p q p q T T T T F F F T F F F F. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 12 / 29
Example (i) Let p : Washington, DC, is the capital of the USA and q : The USA is in North America. Then p q is the statement: p q : Washington, DC, is the capital of the USA and the USA is in North America. Notice that p q is T. (ii) Let p : 2 divides 4 and q : 3 is greater than 5. Then p q is the statement: p q : 2 divides 4 and 3 is greater than 5. Because p is T and q is F, it follows that p q is F. (iii) Let r : 2 divides 4 and s : 2 divides 6. Then r s is the statement: r s : 2 divides 4 and 2 divides 6. Because r is T and s is T, it follows that r s is T.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 13 / 29
Consider the statements, r : 2 divides 4 and s : 2 divides 6, in the previous example. The statement r s is: r s : 2 divides 4 and 2 divides 6. Sometimes, the statement r s is written r s : 2 divides both 4 and 6. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 14 / 29
Disjunction Given two statements p and q, we can form the statement p or q by putting the word or between the statements such that the statement p or q is true if at least one of the statements p or q is true. For example, suppose we have the statements: p : 2 is an integer. q : 3 is greater than 5. Then we can form the statement. r : 2 is an integer or 3 is greater than 5. Because p is T, it follows that r is true. The statement r is called the disjunction of p and q. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 15 / 29
Disjunction Definition Let p and q be statements. The disjunction of p and q, written p q, is the statement formed by putting the statements p and q together using the word or. The truth value of the statement p q is T if at least one of the statements p or q is true. The symbol is called or. For statements p and q, the truth table of p q is given by: p q p q T T T T F T F T T F F F. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 16 / 29
Example Let p be the statement You can pay me now and q be the statement You can pay me tomorrow with a 10% penalty. Then p q is the statement: You can pay me now or you can pay me tomorrow with a 10% penalty. Example Let p : 2 2 + 3 3 is an even integer and q : 2 2 + 3 3 is an odd integer. Then p q : 2 2 + 3 3 is an even integer or 2 2 + 3 3 is an odd integer. Sometimes for better readability, we write p q as: p q : Either 2 2 + 3 3 is an even integer or 2 2 + 3 3 is an odd integer. or p q : 2 2 + 3 3 is an even integer or an odd integer.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 17 / 29
Implication In every day life, we encounter statements such as If it is cold, then I will wear a jacket. If I get a bonus, then I will buy a car. If I work, then I must pay taxes. Similarly, in mathematics, we frequently encounter statements such as: If ABC is a triangle, then A + B + C = 180 0. If 49301 is divisible by 6, then 49301 is divisible by 3. In each of these statements, two statements are connected by If... then to form a new statement. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 18 / 29
Implication Definition Let p and q be two statements. Then if p then q is a statement called an implication or a condition, written p q. The statement p q can also be read as or or or p implies q p is suffi cient for q q if p q whenever p. In the implication p q, p is called the hypothesis (or antecedent) and q is called the conclusion (or consequent).. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 19 / 29
Let us consider the following implication: If I pass Monday s math test, then I will take you out for dinner. Let p represent the statement I pass Monday s math test and q represent the statement I will take you out for dinner. Suppose p is true and q is true. Then because I told the truth, the statement p q is true. Suppose p is true but q is false. In this case, I lied. So the statement p q is false. Suppose p is false but q is true. In this case, even though I did not pass the test, but I still took you out for dinner. Note that I did not say anything about dinner and failing the test. Therefore, I did not lie. So the statement p q is true. Suppose p is false and q is false. In this case, I did not pass the test and I did not take you out for dinner. I cannot be held responsible for not taking you out for dinner because I promised to take you out for dinner only if I passed the test. Therefore, I did not lie. So the statement p q is true. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 20 / 29
The truth table of the implication p q is given by: p q p q T T T T F F F T T F F T Example Let p be the statement It rains today, and q be the statement The game will be postponed. Then the statement p q is the statement If it rains today, then the game will be postponed.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 21 / 29
Evaluating Logical Expressions Consider the statements: p = 2 is an even integer q = 6 is a prime number Then the truth value of p is true (T ) and the truth value of q is false (F ). Now p, ( p) q, p ( q) are also statements. Suppose that we want to know the truth values of these statements. To find the truth value of these statements, we substitute the values of the variables p and q and then use the rules of evaluating the logical connectives. For example, Thus, the truth value of p is F. p = T = F. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 22 / 29
Similarly, ( p) q = ( T ) F = F F, because T = F = F, and p ( q) = T ( F ) = T T = T. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 23 / 29
To avoid the use of so many parentheses (and brackets) in a statement formula we adopt the following conventions: 1. We omit the outer pair of parentheses in a statement. For example, we write p for ( p). 2. If there is a statement of the form ( p) ( q), then we write it as p q. 3. Similarly, we write ( p) ( q) as p q, ( p) ( q) as p q, ( p) as p, and so on. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 24 / 29
Precedence of Logical Connectives (Operators) In a compound statement without parentheses that contains logical connectives, the logical connectives are evaluated in the following order, i.e., the precedence of logical connectives is: highest second highest third highest fourth highest D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 25 / 29
Example Let p be a true (T ) statement, q be a false (F ) statement, and r be a true (T ) statement. (i) p ( r q) = T ( T F ) = T (F F ) = T F = T. (ii) ( p q) ( q r) = ( T F ) ( F T ) = (F F ) (T T ) = F T = T.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 26 / 29
Example Let p be a true (T ) statement, q be a false (F ) statement, and r be a true (T ) statement. (i) p r = T T = T F = F. (ii) r ( p q) = T ( T F ) = T (F T ) = T T = T.. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 27 / 29
Exercise: Write the negation of each of the following statements: (i) 2 is an odd integer; (ii) 7 + 5 > 13; (iii) p 7; (iv) I am taking the applied mathematics course. Solution: (i) 2 is not an odd integer; (ii) 7 + 5 13 (iii) p > 7; (iv) I am not taking the applied mathematics course. D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 28 / 29
Exercise: Let p be true, q be false, and r be true. Find the truth value of the following statements. (i) p (q r) (ii) [(p q) r)] (iii) (p q) ( q r) Solution: (i) p (q r) = T (F T ) = T T = T (ii) (iii) [(p q) r] = [(T F ) T ] = [(T T ) F ] = [T F ] = F = T (p q) ( q r) = (T F ) ( F T ) = T (T T ) = F T = T D. S. Malik Creighton University, Omaha, NE Chapter () 5: Section 5-1 Mathematical Logic 29 / 29