Lecture13Induction - CS2603 Applied Logic for Hardware and...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma 1 Lecture 13 CS 2603 Applied Logic for Hardware and Software T h e m o s t i m p o r t a n t t h i n g y o u w i l l l e a r n t h i s y e a r n e x t y e a r o r t h e y e a r a f t e r t h a t Induction the original blue-light special CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma 2 Mathematical Induction Principle of Induction Starting point 9 Predicate P 9 Universe of discourse: N = {0, 1, 2, } Process 9 Prove: P(0) 9 Prove: n.(P(n) P(n+1)) Conclusion: n. P(n) P(0) n.(P(n) P(n+1)) {Ind} n. P(n) Induction Induction is a tremendous bargain You get: proofs for an infinite number of propositions 9 P(0), P(1), P(2), But, you only have to prove one of them: P(0) Also, you have to prove the implication: P(n) P(n+1) 9 That is, you prove P(n+1), but you get to assume P(n) b l u e- l i g h t s p e c i a l a new inference rule for our formal system CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma 3 Advantages of sumr Summing Things Up sum(x: xs) = x + (sum xs)--sum : sum[ ] = 0--sum[ ] a x i o m s ( s u m ) r e v i e w sum[x 1 , x 2 , x n ] = x 1 + (x 2 + (x 3 + (x n-1 + (x n + 0)) )) t h e o r e m (proved by mathematical induction) sumr s (x: xs) = sumr (s + x) xs--sumr : sumr s [ ] = s--sumr[ ] a x i o m s ( s u m r ) (sumr s [x 1 , x 2 , x n ] ) = s + (sum[x 1 , x 2 , x n ] ) t h e o r e m (proved by mathematical induction) o b v i o u s l y c o r r e c t e l u s i v e l y c o r r e c t more efficient computation (no nested induction) sequentional circuit (isomorphic to axioms for sumr) sumr (running sum) s + x + x 2 x 3 x 2 x s + x + x 2 + x 3 s + x + x 2 s + x + Theorems allow us to choose the more efficient solution engineering the application of principles of science and math to the design of useful things THIS IS REAL ENGINEERING Why propose new axioms ? CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma 4 Algebraic equations of concatenation ([ ] ++ ys) = ?-- (++)[ ] ((x : xs) ++ ys) = ?-- (++) : ( ? : (xs ++ ys)) Insertion (:) and Concatenation (++) axioms and a theorem Algebraic laws of sequence construction x. ( (x: [ ]) = [x] )-- :[ ] `_ xs. ( (xs [ ] ) = ( y. ys. xs = (y: ys)) )-- (:) `_ Informally ( x : [x 1 , x 2 , ] ) = [x, x 1 , x 2 , ]-- (: ) Equation-based reasoning (deriving theorems from axioms) [x] ++ xs = (x : [ ]) ++ xs :[ ] = x : ([ ] ++ xs) (++) : = (x : xs) (++)[ ] What equation did this prove?...
View Full Document

This note was uploaded on 04/08/2008 for the course CS 2603 taught by Professor Rexpage during the Spring '08 term at The University of Oklahoma.

Page1 / 17

Lecture13Induction - CS2603 Applied Logic for Hardware and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online