Lecture 12 CS 1813 – Discrete Mathematics

Slides:



Advertisements
Similar presentations
Functional Programming Lecture 13 - induction on lists.
Advertisements

Introduction to Proofs
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way.
CSE115/ENGR160 Discrete Mathematics 04/03/12 Ming-Hsuan Yang UC Merced 1.
TR1413: INTRO TO DISCRETE MATHEMATICS LECTURE 2: MATHEMATICAL INDUCTION.
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
Mathematical Induction Readings on induction. (a) Weiss, Sec. 7.2, page 233 (b) Course slides for lecture and notes recitation. Every criticism from a.
COMP 170 L2 Page 1. COMP 170 L2 Page 2 COMP 170 L2 L10: Intro to Induction l Objective n Introduce induction from proof-by-smallest-counter-example 
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
Introduction to Proofs
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
CSNB143 – Discrete Structure Topic 5 – Induction Part I.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 18 CS 1813 – Discrete Mathematics Loops Without Invariants Are Like.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 10 CS 1813 – Discrete Mathematics Quantify What? Reasoning with Predicates.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 7 CS 1813 – Discrete Mathematics Equational Reasoning Back to the Future:
1.1 Introduction to Inductive and Deductive Reasoning
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 2 CS 1813 – Discrete Mathematics Proofs Propositions and Calculuses.
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 2/21/2016 MATH 224 – Discrete Mathematics Sequences and Sums A sequence of the form ar 0, ar 1, ar 2, ar 3, ar 4, …, ar n, is called a geometric sequence.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 14 CS 1813 – Discrete Mathematics A Little Bit of Set Theory.
Mathematical Induction 1. 2 Suppose we have a sequence of propositions which we would like to prove: P (0), P (1), P (2), P (3), P (4), … P (n), … We.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 17 CS 1813 – Discrete Mathematics How Does It Work in the Real World?
Mathematical Induction EECS 203: Discrete Mathematics Lecture 11 Spring
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
1 Section 4.4 Inductive Proof What do we believe about nonempty subsets of N? Since  N, <  is well-founded, and in fact it is linear, it follows that.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 CS 1813 – Discrete Mathematics Review of Predicate Calculus Set Theory Inductive.
11.7 – Proof by Mathematical Induction
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
PROGRAMMING IN HASKELL
PROGRAMMING IN HASKELL
CSE 311: Foundations of Computing
Methods of Proof A mathematical theorem is usually of the form pq
Lecture 4 CS 1813 – Discrete Mathematics
Lecture 15 CS 1813 – Discrete Mathematics
CS 1813 – Discrete Mathematics
Lecture 6 CS 1813 – Discrete Mathematics
Lecture 13 CS 1813 – Discrete Mathematics
Elementary Metamathematics
CS 1813 – Discrete Mathematics
The Foundations: Logic and Proofs
Lecture 16 CS 1813 – Discrete Mathematics
Quizzes CS 1813 – Discrete Mathematics
Mathematical Reasoning
Notes 9.5 – Mathematical Induction
CSE 311: Foundations of Computing
Lecture 9 CS 1813 – Discrete Mathematics
Follow me for a walk through...
Lecture 11 CS 1813 – Discrete Mathematics
Mathematical Induction I
MA/CSSE 474 More Math Review Theory of Computation
Applied Discrete Mathematics Week 9: Integer Properties
Lecture 5 CS 1813 – Discrete Mathematics
Lecture 3.1: Mathematical Induction
Induction (Section 3.3).
Sullivan Algebra and Trigonometry: Section 13.4
Follow me for a walk through...
Lecture 8 CS 1813 – Discrete Mathematics
Copyright © Cengage Learning. All rights reserved.
Mathematical Reasoning
1.1 Introduction to Inductive and Deductive Reasoning
Follow me for a walk through...
Copyright © Cengage Learning. All rights reserved.
Lecture 3.1: Mathematical Induction
Presentation transcript:

Lecture 12 CS 1813 – Discrete Mathematics Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Lecture 12 CS 1813 – Discrete Mathematics The Principle of Mathematical Induction ok … now we’re cooking with gas … CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

A Little Theorem about Sequences Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 A Little Theorem about Sequences Algebraic laws of sequence construction (x: []) = [x] -- :[] (xs  [ ] ) = (x. ys. xs = (x: ys) ) -- (:) Informally ( x : [x1, x2, …] ) = [x, x1, x2, …] -- (: …) Algebraic laws of concatenation (++) :: [a] -> [a] -> [a] ([ ] ++ ys) = ys -- (++).[ ] ((x : xs) ++ ys) = (x : (xs ++ ys)) -- (++).: An equational argument Assume x :: a and xs :: [a] [x] ++ xs = (x : [ ]) ++ xs :[] = x : ([ ] ++ xs) (++).: = (x : xs) (++).[ ] What did this prove? ([x] ++ xs) = (x : xs) () CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Software Equations = Algebraic Laws Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Software Equations = Algebraic Laws foldr (the big picture) foldr () z [x1, x2, …, xn] = x1  (x2  … (xn-1  (xn  z)) … ) Algebraic laws of foldr foldr :: (a -> b -> b) -> b -> [a] -> b foldr () z [ ] = z -- (foldr).[] foldr () z (x : xs) = x  (foldr () z xs) -- (foldr).: The big or (\/) :: Bool -> Bool -> Bool -- “little or” – satisfies Boolean laws for  or :: [Bool] -> Bool -- “big or” or = foldr (\/) False -- (or) Theorem (or1). or ([True] ++ xs) = True or ([True] ++ xs) = or (True : xs) () = foldr (\/) False (True : xs) (or) = True \/ (foldr (\/) False xs) (foldr).: = (foldr (\/) False xs) \/ True ( comm) = True ( null) CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page qed

Theorem — or/singleton True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or/singleton True Corollary (or1c): or [True] = True Proof True = or ( [True] ++ [ ] ) (or1) = or ( True : [ ] ) () = or ( [True] ) :[] qed CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x,True, …] = True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x,True, …] = True Theorem (or2): or ([x] ++ ([True] ++ xs)) = True Proof or([x] ++ ([True] ++ xs)) = or((x:[]) ++ ([True] ++ xs)) (:) = or(x:([] ++ ([True] ++ xs))) (++).: = foldr (\/) False (x:([] ++ ([True] ++ xs))) (or) = x \/ (foldr (\/) False ([] ++ ([True] ++ xs))) (foldr).: = x \/ (or([] ++ ([True] ++ xs))) (or) = x \/ (or([True] ++ xs)) (++).[] = x \/ True (or1) = True  null qed Theorem (or1): or ([True] ++ xs) = True CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x, y,True, …] = True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x, y,True, …] = True Theorem (or3): or ([x, y] ++ ([True] ++ xs)) = True Proof or([x, y] ++ ([True] ++ xs)) = or((x:[y]) ++ ([True] ++ xs)) (:) = or(x:([y] ++ ([True] ++ xs))) (++).: = foldr (\/) False (x:([y] ++ ([True] ++ xs))) (or) = x \/(foldr (\/) False ([y] ++ ([True] ++ xs))) (foldr).: = x \/ (or([y] ++ ([True] ++ xs))) (or) = x \/ True (or2) = True  null qed Theorem (or2): or ([x] ++ [True] ++ xs) = True CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x, y, z,True, …] = True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x, y, z,True, …] = True Theorem (or4): or ([x, y, z] ++ ([True] ++ xs)) = True Proof or([x, y, z] ++ ([True] ++ xs)) = or((x:[y, z]) ++ ([True] ++ xs)) (:) = or(x:([y, z] ++ ([True] ++ xs))) (++).: = foldr (\/) False (x:([y,z] ++ ([True] ++ xs))) (or) = x \/(foldr (\/) False ([y,z] ++ ([True] ++ xs))) (foldr).: = x \/ (or([y,z] ++ ([True] ++ xs))) (or) = x \/ True (or3) = True  null qed Theorem (or3): or ([x, y] ++ [True] ++ xs) = True CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x, y, z, w,True, …] = True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x, y, z, w,True, …] = True Theorem (or5): or ([x, y, z, w] ++ ([True] ++ xs)) = True Proof You can do this one, right? or([x, y, z, w] ++ ([True] ++ xs)) = or((x:[y, z, w]) ++ ([True] ++ xs)) (:) = or(x:([y, z, w] ++ ([True] ++ xs))) (++).: = foldr (\/) False (x:([y,z,w] ++ ([True] ++ xs))) (or) = x \/(foldr (\/) False ([y,z,w] ++ ([True] ++ xs))) (foldr).: = x \/ (or([y,z,w] ++ ([True] ++ xs))) (or) = x \/ True (or4) = True  null The last three proofs are all the same, except that they each cite a different theorem in the 5th line. Theorem (or4): or ([x, y, z] ++ [True] ++ xs) = True The proof of (orn+1) cites (orn) CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Principle of Mathematical Induction another way to skin a cat Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Principle of Mathematical Induction another way to skin a cat {I} — an inference rule with n. P(n) as it’s conclusion One way to use {I} Prove P(0) Prove P(n +1) for arbitrary n Takes care of P(1), P(2), P(3), … P(n) {n arbitrary} {I} n. P(n)  Introduction P(0) n.P(n)P(n+1) {Ind} n. P(n) Induction Mathematical induction makes it easier Proof of P(n +1) can cite P(n) as a reason If you cite P(n) as a reason in proof of P(n+1), your proof relies on mathematical induction If you don’t, your proof relies on {I} CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x, y, …,True, …] = True Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x, y, …,True, …] = True Theorem (orn) nN. length ys = n  or (ys ++ ([True] ++ xs)) = True Proof P(n)  length ys = n  or (ys ++ ([True] ++ xs)) = True Base case: P(0)  length ys = 0  or(ys ++ ([True] ++ xs)) = True length ys = 0  ys = [ ] zero len theorem  or(ys ++ ([True] ++ xs)) = or([ ] ++ ([True] ++ xs)) substitution = or ([True] ++ xs) ++.[] = True or1 Inductive case: P(n)  P(n+1) … next slide CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

Theorem — or[x, y, …,True, …] = True Inductive Case Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 Theorem — or[x, y, …,True, …] = True Inductive Case Predicate to prove for inductive case P(n+1)  length ys = n+1  or (ys ++ ([True] ++ xs)) = True length ys = n+1  ys  [ ] zero len theorem  ys = y: zs  length zs = n :len corollary  or(ys ++ ([True] ++ xs)) = or((y:zs) ++ ([True] ++ xs)) subst  length zs = n = or(y:(zs ++ ([True] ++ xs)))  length zs = n (++).: = (y \/ (or(zs ++ ([True] ++ xs))))  length zs = n (foldr).: = (y \/ True)  length zs = n P(n) induction hypothesis = (y \/ True)  True subst = True  id,  null Conclude: nN. P(n) principle of induction CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page qed

Lecture 15 - CS 1813 Discrete Math, University of Oklahoma 9/22/2018 End of Lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page