MATH 1130 1 Discrete Structures Chapter I Logic and Proofs Propositions A proposition is a statement that is either true (T) or false (F), but or both. s Propositions: 1. I am a man.. I am taller than 170 cm. 3. You are studying in Baptist U. 4. 1 + 1 = 3. Not propositions: 1. How are you?. Go to catch the dog. 3. I like this colour. Negation of a Proposition Let p be a proposition. The statement It is not the case that p is another proposition, called the negation of p. The negation of p is denoted by p. p and read not P: It is a sunny day. p : It is not the case that it is a sunny day., or simply It is not a sunny day. Truth Table A truth table displays the relationships between the truth values of propositions. Truth tables are especially valuable in the determination of the truth values of propositions constructed from simpler propositions.
MATH 1130 Discrete Structures The truth table for the negation of a proposition p T F p F T Logic Operators (Connectives) Conjunction Let p and q be propositions. The proposition p and q, denoted by true when both p and q are true and is false otherwise. The proposition conjunction of p and q. p q, is the proposition that is p q is called the The truth table for the conjunction of p and q p q p q T T T T F F F T F F F F Disjunction Let p and q be propositions. The proposition p or q, denoted by false when p and q are both false and true otherwise. The proposition disjunction of p and q. p q, is the proposition that is p q is called the The truth table for the disjunction of p and q p q p q T T T T F T F T T F F F
MATH 1130 3 Discrete Structures Exclusive Or Let p and q be propositions. The exclusive or of p and q, denoted by true when exactly one of p and q is true and is false otherwise. p q, is the proposition that is The truth table for the exclusive or of p and q p q p q T T F T F T F T T F F F Conditional Propositions Implication Let p and q be propositions. The implication p q is the proposition that is false when p is true and q is false and true otherwise. In this implication, p is called the hypothesis and q is called the conclusion. The truth table for the implication p q p q p q T T T T F F F T T F F T Remarks: I) Equivalent expressions of implication 1. if p, then q. p is sufficient for q 3. p implies q 4. p only if q 5. q is necessary for p II) Related Implications 1. q p is called the converse of p q. q p is called the contrapositive of p q
MATH 1130 4 Discrete Structures Biconditional Let p and q be propositions. The biconditional p q is the proposition that is true when p and q have the same truth values and is false otherwise. In this biconditional, p is necessary and sufficient for q, or p if and only if q. The truth table for the biconditional p q p q p q T T T T F F F T F F F T Translating English Sentences He will not be charged (c) if he is handsome (h) or he is muscular (m). h m ( ) c h m h m c c T T T F F T T T T T T F T F T F F T T F T T T F F T T F F T F T T T T F F F F T F T F F F T T F Bit String A bit string is a sequence of zero or more bits. The length of a bit string is the number of bits in the string. 0100100111 is a 10-bit string.
MATH 1130 5 Discrete Structures Bitwise OR, bitwise AND and bitwise XOR We define the bitwise OR, bitwise AND and bitwise XOR of two strings of the same length to be the strings that have as their bits the OR, AND and XOR of the corresponding bits in the two strings, respectively. 01 1011 0110 11 0001 1101 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR Logical equivalence Tautology, Contradiction and Contingency A compound proposition that is always true, no matter what the truth values of the propositions that occur in it, is called a tautology. A compound proposition that is always false is called a contradiction. Finally, a proposition that is neither a tautology nor a contradiction is called a contingency. Truth table of examples of a tautology and a contradiction p p p p p p T F T F F T T F Logically Equivalent The propositions p and q are called logically equivalent if p q denotes that p and q are logically equivalent. p q is a tautology. The notation
MATH 1130 6 Discrete Structures The following truth table shows that the compound propositions ( p q) logically equivalent. p q q p ( p q) and p q are p q p q T T T F F F F T F T F F T F F T T F T F F F F F T T T T Exercise Complete the following truth table to show that p q and p q are logically equivalent. p q p p q p q T T T F F T F F Logical Equivalences Equivalence p T p p F p p T T p F F p p p p p p Name Identity laws Domination laws Idempotent laws ( p) p Double negative law p q q p p q q p ( p q) r p ( q r) ( p q) r p ( q r) p ( q r) ( p q) ( p r) p ( q r) ( p q) ( p r) ( p q) p q ( p q) p q Commutative laws Associative laws Distributive laws De Morgan s laws
MATH 1130 7 Discrete Structures p p T p p F p q p q Predicates and Quantifiers Predicates In statements involving variables, there are two parts the variable (is the subject of the statement) and predicate (refers to a property that the subject can have). In the statement: x > 3 (x is greater than 3) x is the variable and is greater than 3 is the predicate. Let P ( x) denote the statement x > 3. The value of P ( 4) is true and the value of ( ) P is false. Universe of Discourse Many mathematical statements assert that a property is true for all values of a variable in a particular domain, called the universe of discourse. Universal Quantification and Universal Quantifier The universal quantification of P ( x) is the proposition: ( x) universe of discourse, and is denoted by x P ( x) for all (every) x P ( x) the universal quantifier. P is true for all values of x in the. Here, is called Existential Quantification and Existential Quantifier The existential quantification of P ( x) is the proposition: There exists an element x in the universe of discourse such that P ( x) is true, and is denoted by x P ( x) for some x P ( x). Here, is called existential quantifier. Statement When True? When False? x P ( x) ( x) P is true for every x. There is an x for which ( x) x P ( x) There is an x for which P ( x) is true. P ( x) is false for every x. P is false.
MATH 1130 8 Discrete Structures s Translating logical statements into English I) x ( C ( x) y( C( y) F( x, y) )) where C ( x) is x has a computer, ( x y) F, is x and y are friends, and the universe of discourse for both x and y is the set of all students in this class. Every student in your school has a computer or has a friend who has a computer. II) x y z( (( F( x, y) F( x, z) ( y z) ) F( y, z) )) where ( a b) F, means a and b are friends and the universe of discourse for x, y and z is the set of all students in your school. There is a student none of whose friends are also friends with each other. Translating sentences into logical expressions III) Some student in this class has visited Mexico. Let M ( x) be the statement x has visited Mexico. xm ( x), the universe of discourse for x is the set of all the students in this class. IV) Every student in this class has visited either Canada or Mexico. Let M ( x) be the statement x has visited Mexico and ( x) Canada. x C x M ( ( ) ( x) ) C be the statement x has visited, the universe of discourse for x is the set of all the students in this class. V) If somebody is female and is a parent, then this person is someone s mother Let F ( x) be the statement x is female, P ( x) be the statement x is a parent, and M ( x, y) be the statement x is the mother of y. x F x P x ym x, y, the universe of discourse for x and y is the set of all people. (( ( ) ( )) ( ))
MATH 1130 9 Discrete Structures VI) f ( x) = L lim (For every real number ε > 0, there exists a real number δ > 0 such that x a ( x) L < ε f whenever 0 < x a < δ. ( < x a < δ f ( x) L ε ) ε δ x 0 <, the universe of discourse for ε and δ is the set of positive real numbers, and that of x is the set of real numbers, and a is a real constant. Negations The negation of a universal quantification is an existential quantification. ( x) x P( x) xp The negation of an existential quantification is a universal quantification. ( x) x Q( x) xq Method of Proofs Theorems A theorem is a statement that can be shown to be true. Proofs We demonstrate that a theorem is true with a sequence of statements that form an argument, called a proof. Axioms and Postulates Statements used in a proof include axioms and postulates, which are the underlying assumptions about mathematical structures, the hypotheses of the theorem to be proved, and previously proved theorems. Lemmas A lemma is a simple theorem used in the proof of other theorems. Corollaries A corollary is a proposition that can be established directly from a theorem that has been proved. Conjectures A conjecture is a statement whose truth value is unknown.
MATH 1130 10 Discrete Structures Remark: When a proof of a conjecture is found, the conjecture becomes a theorem. Many times conjectures are shown to be false, so they are not theorems. Rules of inference The rules of inference, which are the means used to draw conclusions from other assertions, tie together the steps of a proof. Rule of Inference Tautology Name p p q p ( p q) Addition p q p p q p q p p q q q p q p Simplification (( p) ( q) ) ( p q) ( p ( p q) ) q p q p p q q r p r p q p q Conjunction Modus ponens ( q ( p q) ) p Modus tollens (( p q) ( q r) ) ( p r) (( p q) p) q Hypothetical syllogism Disjunctive syllogism
MATH 1130 11 Discrete Structures s I) 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: It is sunny this afternoon q: It is colder than yesterday r: We will go swimming s: We will take a canoe trip t: We will be home by sunset 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 If we take a canoe trip, then we will be home by sunset p q r p r s s t Conclusion We will be home by sunset t Step Reason 1. p q Hypothesis. p Simplification using Step 1 3. r p Hypothesis 4. r Modus tollens using Steps and 3 5. r s Hypothesis 6. s Modus ponens using Steps 4 and 5 7. s t Hypothesis 8. t Modus ponens using Steps 6 and 7
MATH 1130 1 Discrete Structures II) Show that the hypotheses If you send me an email message, then I will finish writing the program, If you do not send me an email 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: You send me an email message q: I will finish writing the program r: I will go to sleep early s: I will wake up feeling refreshed Hypotheses If you send me an email message, then I will finish writing the program If you do not send me an email message, then I will go to sleep early If I go to sleep early, then I will wake up feeling refreshed p q p r s r Conclusion If I do not finish writing the program, then I will wake up feeling refreshed q s Step Reason 1. p q Hypothesis. q p Contrapositive of Step 1 3. p r Hypothesis 4. q r Hypothetical syllogism using Steps and 3 5. r s Hypothesis 6. q s Hypothetical syllogism using Steps 4 and 5 Fallacies Some common forms of incorrect reasoning are called fallacies. I) Fallacy of affirming the conclusion (( p q) q) p (( F T) T) F is False
MATH 1130 13 Discrete Structures p: it is an apple q: it is red. It is red but it may not be an apple. II) Fallacy of denying the hypothesis (( p q) p) q (( F T) T) F is False p: it is an apple q: it is red. It is not an apple but it may be red. III) Circular reasoning ( p p) p ( F F) F is False p: it is an apple If it is an apple, then it is an apple is always true, even though it is not an apple. Rules of Inference for quantified statements U is the universal of discourse Rule of Inference P P xp( x) P() c if c U () c for an arbitrary c U xp( x) xp( x) P() c for some element c U () c for some element c U xp( x) Name Universal instantiation Universal generalization Existential instantiation Existential generalization
MATH 1130 14 Discrete Structures Methods of Proving Theorems Direct Proof A proof that the implication true. p q is true that proceeds by showing that q must be true when p is Show that if n is odd, then n is odd. Suppose n is odd. I.e. = k + 1 is an odd number. n for some integer k. = ( k + 1) = 4k + 4k + 1 = 4k( k + 1) + 1 n, Indirect Proof A proof that the implication false. p q is true that proceeds by showing that p must be false when q is Show that if n is odd, then n is odd. Suppose n is even. I.e. n k = for some integer k. ( ) n = k = 4k, is an even number. Vacuous Proof A proof that the implication p q is the based on the fact that p is false. Show that if 3 > 5, then 5 > 9. Since 3 > 5 is false, the statement if 3 > 5, then 5 > 9 is true.
MATH 1130 15 Discrete Structures Trivial Proof A proof that the implication p q is true based on the fact that q is true. Show that if 5 > 3, then 9 > 5. Since 9 > 5 is always true, the statement if 5 > 3, then 9 > 5 is true. Proof by Contradiction A proof that a proposition p is true based on the truth of the implication contradiction p q where q is a Show that the sum of m + 1 and n 1 is even. Assume the sum of m + 1 and 1 contradiction. n is odd. ( m + n), a multiple of, is odd. This is a Proof by Cases A proof of an implication where the hypothesis is a disjunction of propositions that shows that each hypothesis separately implies the conclusion Show that if n > 3 or n <, then n n 6 > 0. Case 1 Suppose n > 3. n n 6 = ( n 3)( n + ) > ( 3 3)( 3 + ) = 0. Case Suppose n <. n > 4. n n 6 > 4 ( ) 6 = 0. Therefore, if n > 3 or n <, then n n 6 > 0. Existence Proofs A proof of a proposition of the form xp( x) is called an existence proof. Constructive Existence Proofs An existence proof of xp( x) given by finding an element a such that ( a) constructive existence proof. P is true is called a
MATH 1130 16 Discrete Structures Show that there exists an irrational number between any two rational numbers. Let α and β be two rational numbers. With loss of generality, we may assume α < β. Let β α 1 ε ε = β α. Clearly, ε is also a rational number and = 1 > > 0 α < + α < β. ε Nonconstructive Existence Proofs An existence proof of xp( x) given by not finding an element a such that ( a) nonconstructive existence proof. P is true is called a Show that for every positive integer n there is a prime greater than n. Let n be a positive integer. To show there is a prime greater than n, we may consider the integer n!+1. One possibility is that n!+ 1 is already prime. Otherwise, n!+ 1 is divisible by a prime number. Clearly, n!+ 1 is not divisible by any number less than or equal to n. Thus, the prime factor of n!+ 1 is greater than n. Counterexample Suppose a statement of the form xp( x) is false. We find an element a such that ( a) I.e. x P( x) is true. The element a for which P ( a) is false is called a counterexample. P is false. Show that 3 n + 1 is odd for all integers n is false. For n = 3, 3 () 3 + 1 = 10 is even. Therefore, 3 n + 1 is odd for all integers n is false.
MATH 1130 17 Discrete Structures Mathematical Induction To use prove that a statement is true for all natural numbers n by mathematical induction, we have the following three steps: 1. To prove the statement is true for the first (few) case(s).. To assume the statement is true for n k for some k. 3. With the induction hypothesis in step, to prove the statement is true for n = k + 1. I) Euler s Formula If G is a connected plane graph, then v + f = ε + where v, f and e are the numbers of vertices, faces and edges of G respectively. The formula can be shown by induction on the number of faces of G. If f = 1, then edge of G is a cut edge (a bridge) of G and so G is a tree. In this case, v = ε + 1, and so the theorem holds. We may suppose that the theorem holds for all connected plane graphs with f k, and consider a connected plane graph G having k + 1 faces. Since G has more than one face, there should be an edge e in G that is separating two faces. By taking away e from G, we may obtain ( G e) v( G), f ( G e) = f ( G) 1 and ε ( G e) = ε ( G) 1. Then v( G e) + f ( G e) = ε ( G e) +, and so ( G) + f ( G) = ( G) + v = v ε. G e with IIa) Four Colour Theorem Any map can be coloured using no more than 4 colours. Remark: Any map can be represented by a simple connected plane graph.
MATH 1130 18 Discrete Structures IIb) Five Colour Theorem This theorem can be proved by induction on the number of vertices of G. If v 5, the theorem holds. Suppose the theorem holds for all graphs of v k and consider a graph G of k + 1 vertices. From Euler s formula, we may deduce that the minimum degree of G (any plane graph), δ ( G), is less than or equal to 5. Choose a vertex u in G of the minimum degree. In the case d ( u) 4, G u is a graph of k vertices. By the induction hypothesis, G u can be coloured with five colours, and so we may add u back and put on u a colour which is not on the adjacent vertices of u. In the case d ( u) = 5, there should be two adjacent vertices, s and t, of u which are not adjacent. It is because the 5-complete graph is not planar. Then we may merge s and t to form G u s, t of k 1 vertices. Clearly, G u s, t is 5-colourable by the induction hypothesis, and the any colourings on G u s, t are also valid on G u with s and t of the same colour. Thus, on any colourings of G u, there are at most four colours on the adjacent vertices of u in G. Then we may put on u the a colour other than those on its adjacent vertices.