Presentation is loading. Please wait.

Presentation is loading. Please wait.

10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science

Similar presentations


Presentation on theme: "10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science"— Presentation transcript:

1 10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science E-mail: salabbad@gmail.com Office # SR 068 Tel # 2581888

2 10/17/2015 2 Rules of Inference – Valid Arguments in Propositional Logic  Argument: An argument is a sequence of statements that end with a conclusion.  Valid: An argument is valid if and only if it is impossible for all premises (preceding statements) to be true and the conclusion to be false. By valid, we mean that the conclusion of the argument must follow from the truth of the premises of the argument.  Consider the arguments: “If you have a current password, then you can log onto the network.” “You have a current password.” Therefore, “You can log onto the network.”

3 10/17/2015 3 Rules of Inference – Valid Arguments in Propositional Logic  The conclusion “You can log onto the network” must be true when the premises “If you have a current password, then you can log onto the network” and “You have a current password” are true.  Let p= “You have a current password.” and q=“You can log onto the network.” Then the argument has the form where  is the symbol that denotes “therefore.”  The statement ((p → q) ⌃ p) → q is a tautology. p → q p  q

4 10/17/2015 4 Rules of Inference – Rule for Propositional Logic  The argument form with premises p1, p2, …., pn and conclusion q is valid, when (p1 ⌃ p2 ⌃ …. ⌃ pn) → q is a tautology.  To show that an argument is valid, instead of showing by truth table, we can establish the validity of some relatively simple argument forms, called rules of inference, which can be used as building blocks to construct more complicated valid argument forms.  The tautology ((p → q) ⌃ p) → q is the basis of the rule of inference called modus ponens or law of detachment.

5 10/17/2015 5 Rules of Inference – Rules for Propositional Logic  Example: Suppose that the conditional statement “If it snows today, then we will go skiing” and its hypothesis “It is snowing today”, are true. Then by modus ponens, it follows that the conclusion of the conditional statement, “We will go skiing” is true.  Q1: Determine whether the argument given here is valid and determine whether its conclusion must be true because of the validity of the argument.

6 10/17/2015 6 Rules of Inference – Rules for Propositional Logic

7 10/17/2015 7 Rules of Inference – Rule for Propositional Logic  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”.  Sol: Let p= “It is below freezing now.” and q = “It is raining now.” Then this argument is of the form: p  p v q This is an argument that uses the addition rule.  Q2: State which rule of inference is the basis of the following argument: “It is below freezing and raining now. Therefore, it is below freezing”.

8 10/17/2015 8 Introduction to Proofs  A theorem is a statement that can be shown to be true (usually important statement)  Less important theorem sometimes are called propositions  A proof is a sequence of statements (valid argument) to show that a theorem is true  The statements to be used in proofs include:  Axioms (statement assumed to be true without proof)  Ex: If x is positive integer then x+1 is positive integer.  Hypothesis (premises) of the theorem  Previously proven theorems  Rules of inference used to draw conclusions and to move from one step to another

9 10/17/2015 Prepared by Dr.Saad Alabbad9 Introduction to Proofs  A theorem is a statement that can be shown to be true (usually important statement)  Less important theorem sometimes are called propositions  A proof is a sequence of statements (valid argument) to show that a theorem is true  The statements to be used in proofs include:  Axioms (statement assumed to be true without proof)  Ex:If x is positive integer then x+1 is positive integer.  Hypothesis (premises) of the theorem  Previously proven theorems  Rules of inference used to draw conclusions and to move from one step to another Rules of inference Axioms Hypothesis proven theorems New theorem

10 10/17/2015 Prepared by Dr.Saad Alabbad10 Introduction to Proofs  Example:  If I have a car (C) I will drive to Makkah(M). My boss gave me 40,000 (G) or Fired me(F). If I have SR40,000 (H) then I have a car(C). My boss did not fire me. Therefore I will drive to Makkah(M). 1.G  F Hypothesis 2.  F Hypothesis 3.G Disjunctive syllogism rule using 1 and 2 4.G  H Axiom 5.H  CHypothesis 6.G  C Hypo. syllogism using 4,5 7.C Modus ponens using 3 and 6 8.C  M Hypothesis 9.M Modus ponens using 7 and 8

11 10/17/2015 Prepared by Dr.Saad Alabbad11 Methods of proving theorems: Direct proofs  A direct proof of a conditional statement H 1  H 2 …  H n  C is established by assuming the truth of all hypothesis and using rules of inference, axioms and proven theorems to assert the truth of the conclusion  Example: prove that “if n is even then n 2 is even” 1.Assume that n is even (hypothesis) 2.Therefore n=2k where k is integer (definition of even number) 3.By squaring n=2k we get n 2 =(2k) 2 =4k 2 =2(2k 2 ) 4.Since 2K 2 is integer (Axiom. See p.A-5) 5.Therefore n 2 =2r is even

12 10/17/2015 Prepared by Dr.Saad Alabbad12 Methods of proving theorems: Proof by contraposition  An indirect proof of a conditional statement p  q is a direct proof of its contraposition  q   p.  Example 1: prove that “if n 2 is even then n is even” The contraposition is “if n is not even then n 2 is not even” 1.Assume that n is not even i.e n is odd (hypothesis) 2.Therefore n=2k+1 where k is integer (definition of odd number) 3.By squaring n=2k+1 we get  n 2 =(2k+1) 2  =4k 2 +4k+1  =2(2k 2 +2k)+1= 2r+1 4.Since 2k 2 +2k is integer (Axiom. See p.A-5) 5.Therefore n 2 =2r+1 is not even (odd)

13 10/17/2015 Prepared by Dr.Saad Alabbad13 Methods of proving theorems: Proof by contraposition  Example 2: prove that if n=ab then a  n or b  n where a and b are positive integers 1.Let p be a  n, q be b  n and r be n=ab 2.We want to prove that r  p  q 3.The contraposition is  ( p  q )   r (By definition) 4.Which is equivalent to  p   q   r (De Morgan’s law) 5.Now assume that a  n and b  n (  p   q ) 6.Then a.b  n.  n=n (by multiplying the two inequalities) 7.Therefore ab  n 8.Which is the same as  r

14 10/17/2015 Prepared by Dr.Saad Alabbad14 Methods of proving theorems: Vacuous and Trivial Proofs  Vacuous Proof If we know that p is false then p  q is vacuously true.  Example 1: prove that if x 2  0 then 1=2 where x is a real number  Since x 2  0 for every real number then the implication is vacuously true  Example 2: prove that if he is alive and he is dead then the sun is ice cold.  Since the hypothesis is always false the implication is vacuously true.  Trivial Proof If we know q is true then p  q is trivially true.  Example 1: prove that if x=2 then x 2  0 for all real numbers  Since x 2  0 is true then the implication is trivially true.(we didn’t use the fact x=2) pq p  q FFTTFFTT FTFTFTFT TTFTTTFT pq FFTTFFTT FTFTFTFT TTFTTTFT

15 10/17/2015 Prepared by Dr.Saad Alabbad15 Methods of proving theorems: Proofs by Contradiction(1)  In proof by contradiction it is shown that if some statement were false, a logical contradiction occurs, hence the statement must be true  Show that  2 is irrational 1.Let p be  2 is irrational 1.Assume  p is true “  2 is rational ” 1.Then  2=a/b where gcd(a,b)=1, b  0 and a  0 (Definition of rational numbers) 2.Squaring both sides we get 2=a 2 /b 2 3.It follows that 2a 2 =b 2 4.Hence b 2 is even (Definition of even numbers) 5.Which means that b is even (Proved theorem. see slide 5) 6.But a 2 =b 2 /2=(2k) 2 /2=2k 2 so a is even also (Definition of even numbers and proved thoeorm) 7.But this is a contradiction since 7 and 8 contradict the fact that gcd(a,b)=1 since if a and b are even then 2 is a common divisor.

16 10/17/2015 Prepared by Dr.Saad Alabbad16 Methods of proving theorems: Proofs by Contradiction(2)  Why is this method valid ?  The contradiction forces us to reject our assumption because our other steps based on that assumption are logical and justified. The only “mistake” that we could have made was the assumption itself.  Be careful!  Sometimes the contradiction comes from a mistake in the steps of the proof and not from the assumption. This makes the proof invalid.  Example: prove that 1=2 1.Suppose that 2  1 and a=b for some a. 2.Then 2b  b [multiply by b] 3.a+b  b [2b=b+b=a+b by hypothesis] 4.(a-b)(a+b)  b(a-b) [multiply by a-b] 5.a 2 -b 2  ab-b 2 6.a 2  ab [subtract b 2 from both sides] 7.a  b which contradicts our assumption that a=b 8.Hence it follows that 1=2  Can you find the error 

17 10/17/2015 Prepared by Dr.Saad Alabbad17 Methods of proving theorems: Proofs by Contradiction(3)  To prove a conditional statement p  q by contradiction we prove that p   q  F is true which is equivalent to p  q.  Example:  If 3n+2 is odd then n is odd  Suppose that 3n+2 is odd and n is even [ p   q] Then 1. n=2r [hypothesis  q and definition of even numbers] 2.3n=6r [multiply 1 by 3] 3.3n+2=2+6r [add 2 to both sides] 4.3n+2=2(1+3r) 5.3n+2=2k [let k=1+3r] 6.Thus 3n+2 is even which is false (a contradiction !) 7.Therefore the implication is true.

18 10/17/2015 Prepared by Dr.Saad Alabbad18 Methods of proving theorems: Proofs of Equivalence and Disproof by counter example  Proofs of Equivalence  To prove p  q we have to prove p  q and q  p  Example: prove “n is even if and only if n 2 is even”  “if n is even then n 2 is even” proved in slide 4  “n 2 is even then n is even” proved in slide 5  Therefore, n is even if and only if n 2 is even  Proving equivalence of several propositions  If we want to prove that p 1  p 2  p 3 …  p n  Then it is sufficient to prove p 1  p 2,, p 2  p 3 … p n  p 1  Disproof by Counterexample  Prove that “For all real numbers x 2 >x” is false  X=0.5 is a counterexample since 0.5 2 >0.5 is not true

19 10/17/2015 Prepared by Dr.Saad Alabbad19 Methods of proving theorems: Exhaustive Proof and Proof by Cases(1)  Sometimes there is no single argument that works for all possible cases appearing in the statement. So we have to consider all different cases and/or instances.  (1) Exhaustive Proof In this type of proofs. All possible instances are relatively small. So we prove each instance separately. Example: Prove that (n+1) 3 >= 3 n if n is a positive integer with n  4. We only have 4 instances to consider, n = 1, 2, 3, and 4. Proof of case n = 1: (1+1) 3 >= 3 1 i.e 4 >= 3 which is true. Check n = 2, 3, and 4 similarly.  Notes  Human can perform exhaustive proofs with limited number of possibilities. Computers can consider much larger number of instances/cases. However  Instances/cases must be finite and enumerable

20 10/17/2015 Prepared by Dr.Saad Alabbad20 Methods of proving theorems: Exhaustive Proof and Proof by Cases(2)  (2) Proof by Cases In this type of proofs. The proof covers each possible case. Each case may cover an infinite number of instances Example: Prove "if n is an integer then n 2 >= n". Case 1: n = 0. Since 0 2 = 0, 0 2 >= 0. Case 2 Case 2: n >= 1. n >= 1 implies n 2 >= n. Case 3: n n..  Question: prove that |xy|=|x||y|  Hint: Consider all 4 cases depending on whether x is positive or x is negative and whether or not y is negative.  Common errors in with exhaustive proof and proof by cases:  Draw conclusion from non-exhaustive examples  Not covering all possible cases

21 10/17/2015 Prepared by Dr.Saad Alabbad21 Methods of proving theorems: Existence Proofs  Many theorems state that an object with certain properties exists. I.e.,  xP(x) where P is a predicate. A proof of such a theorem is called an EXISTENCE PROOF. There are two kinds:  (1) Constructive Existence Proof The proof is established be giving example a such that P(a) is true Example: Prove "there is a positive integer that can be written as the sum of cubes in two different ways." Proof: consider 1729=10 3 +9 3 =12 3 +1 3. Finding such examples may require computer assistance. Check n = 2, 3, and 4 similarly.

22 10/17/2015 Prepared by Dr.Saad Alabbad22 Methods of proving theorems: Existence Proofs (2) Non-constructive Existence Proof  The proof is established by showing that an object a with P(a) is true must exist without explicitly demonstrating one. Proofs by contradiction are usually used in such cases.  Example: Let x 1,x 2,..,x n be positive integers such that their average is m. prove that there exists x i such that x i ≥m  Proof: suppose that there is no such number.i,e x 1  m, x 2  m … x n  m By adding these inequalities we get : x 1 + x 2 +…+ x n  nm Dividing by n : (x 1 + x 2 +…+ x n )/n  m But since the average is defined as (x 1 + x 2 +…+ x n )/n Then we have m  m which is a contradiction. Therefore there must be a number x i such that x i ≥m. But we can not specify which number is that.

23 10/17/2015 Prepared by Dr.Saad Alabbad23 Methods of proving theorems: Uniqueness Proofs  Some theorems state that there is exactly one element with a certain property.  A proof of such a theorem is called a UNIQUENESS PROOF.  Strategy here is (1) show that an element x with the desired property exists (2) show that any other y (y != x) does not have the property. I.e., if x and y both have the property, then x must equal y.  Example: prove that the equation 3x+5=9 has a unique solution.  (1) There exists a solution namely x=4/3  (2) suppose that y and z are solutions then 3y+5=9=3z+5 So 3y=3z Dividing by 3 we get y=z This proves that the solution is unique

24 10/17/2015 Prepared by Dr.Saad Alabbad24 END


Download ppt "10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science"

Similar presentations


Ads by Google