CSE 311 Foundations of Computing I

Slides:



Advertisements
Similar presentations
Recursive Definitions and Structural Induction
Advertisements

Induction and Recursion. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative.
10.1 CompSci 102© Michael Frank Today’s topics RecursionRecursion –Recursively defined functions –Recursively defined sets –Structural Induction Reading:
Induction and recursion
CSE 321 Discrete Structures Winter 2008 Lecture 12 Induction.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen Induction.
1 Strong Mathematical Induction. Principle of Strong Mathematical Induction Let P(n) be a predicate defined for integers n; a and b be fixed integers.
Properties of the Integers: Mathematical Induction
Induction and recursion
Mathematical Maxims and Minims, 1988
Induction and recursion
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!
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 4 Induction and Recursion 歐亞書局.
CSE 311 Foundations of Computing I Lecture 15 Recursive Definitions and Structural Induction Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 16 Recursively Defined Sets and Structural Induction Spring
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
INDUCTION AND RECURSION. PRINCIPLE OF MATHEMATICAL INDUCTION To prove that P(n) is true for all positive integers n, where P(n) is a propositional function,
Chapter 5 With Question/Answer Animations. Section 5.1.
CSE 311 Foundations of Computing I Lecture 17 Structural Induction Spring
Chapter Mathematical Induction 4.2 Strong Induction and Well-Ordering 4.3 Recursive Definitions and Structural Induction 4.4 Recursive Algorithms.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Lecture 4,5 Mathematical Induction and Fibonacci Sequences.
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.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
CSE 311 Foundations of Computing I Lecture 14 Euclid’s Algorithm Mathematical Induction Autumn 2012 CSE
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Mathematical Induction
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Chapter 5 Kenneth Rosen, Discrete Mathematics and its Applications, 7th edition, McGraw Hill Instructor: Longin Jan Latecki, Copyright.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
6/12/2016 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(2) Mathematical Induction & Recursion Dr.Saad Alabbad Department of.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Induction and Recursion CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CSE 311 Foundations of Computing I Lecture 15 Strong Induction and Recursive Definitions Spring
Mathematical Induction EECS 203: Discrete Mathematics Lecture 11 Spring
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
(Proof By) Induction Recursion
Induction and Recursion Chapter 5
Advanced Algorithms Analysis and Design
CSE 311 Foundations of Computing I
CS2210:0001Discrete Structures Induction and Recursion
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 311 Foundations of Computing I
Induction and recursion
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CSE 311 Foundations of Computing I
Chapter 5 Induction and Recursion
CSE 311: Foundations of Computing
Induction and recursion
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
Exercise Use mathematical induction to prove the following formula.
CSE 321 Discrete Structures
CSE 373 Data Structures and Algorithms
CSE 321 Discrete Structures
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Chapter 4 Induction and Recursion
CSE 311 Foundations of Computing I
Induction Chapter
Advanced Analysis of Algorithms
Induction and recursion
Chapter 4 (Part 2): Mathematical Reasoning, Induction & Recursion
CSE 321 Discrete Structures
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 16 Induction and Recursive Definitions Autumn 2012 Autumn 2012 CSE 311

Announcements Reading assignments Midterm Friday, Nov 2 Today: 5.2, 5.3 7th Edition 4.2, 4.3 6th Edition 3.3, 3.4 5th Edition Midterm Friday, Nov 2 Closed book, closed notes Practice midterm available on the Web Cover class material up to and including induction. Extra office hours Thursday (midterm review) 3:30 pm, Dan Suciu, Gowen 201 4:30 pm, Richard Anderson, Gowen 201 Autumn 2012 CSE 311

Highlights from last lecture Mathematical Induction Induction proof layout: By induction we will show that P(n) is true for every n≥0 Base Case: Prove P(0) Inductive Hypothesis: Assume that P(k) is true for some arbitrary integer k ≥ 0 Inductive Step: Prove that P(k+1) is true using Inductive Hypothesis that P(k) is true Conclusion: Result follows by induction P(0)  k≥0 (P(k)  P(k+1))   n≥0 P(n) Autumn 2012 CSE 311

Harmonic Numbers for all 𝑛 ≥ 1 Autumn 2012 CSE 311

Cute Application: Checkerboard tiling with Trinominos Prove that a 2n  2n checkerboard with one square removed can be tiled with: Autumn 2012 CSE 311

Strong Induction P(0)  k ((P(0)  P(1)  P(2)  …  P(k))  P(k+1))   n P(n) Follows from ordinary induction applied to Q(n) = P(0)  P(1)  P(2)  …  P(n) Autumn 2012 CSE 311

Strong Induction English Proofs By induction we will show that P(n) is true for every n≥0 Base Case: Prove P(0) Inductive Hypothesis: Assume that for some arbitrary integer k ≥ 0, P(j) is true for every j from 0 to k Inductive Step: Prove that P(k+1) is true using the Inductive Hypothesis (that P(j) is true for all values  k) Conclusion: Result follows by induction Autumn 2012 CSE 311

Every integer ≥ 2 is the product of primes Autumn 2012 CSE 311

Recursive Definitions of Functions F(0) = 0; F(n + 1) = F(n) + 1; G(0) = 1; G(n + 1) = 2  G(n); 0! = 1; (n+1)! = (n+1)  n! H(0) = 1; H(n + 1) = 2H(n) Autumn 2012 CSE 311

Fibonacci Numbers f0 = 0; f1 = 1; fn = fn-1 + fn-2 Autumn 2012 CSE 311

Bounding the Fibonacci Numbers Theorem: 2n/2-1  fn < 2n for n  2 Autumn 2012 CSE 311

Fibonacci numbers and the running time of Euclid’s algorithm Theorem: Suppose that Euclid’s algorithm takes n steps for gcd(a,b) with a>b, then a ≥ fn+1 Set rn+1=a, rn=b then Euclid’s alg. computes rn+1= qnrn + rn-1 rn= qn-1rn-1 + rn-2 ⋮ r3= q2r2 + r1 r2= q1r1 each quotient qi ≥ 1 r1 ≥ 1 Autumn 2012 CSE 311

Recursive Definitions of Sets Basis step: 0  S Recursive step: if x  S, then x + 2  S Exclusion rule: Every element in S follows from basis steps and a finite number of recursive steps Autumn 2012 CSE 311

Recursive definitions of sets Basis: 6  S; 15  S; Recursive: if x, y  S, then x + y  S; Basis: [1, 1, 0]  S, [0, 1, 1]  S; Recursive: if [x, y, z]  S,  in R, then [ x,  y,  z]  S if [x1, y1, z1], [x2, y2, z2]  S then [x1 + x2, y1 + y2, z1 + z2] Powers of 3 Autumn 2012 CSE 311

Strings The set * of strings over the alphabet  is defined Basis:   S ( is the empty string) Recursive: if w  *, x  , then wx  * Autumn 2012 CSE 311

Function definitions on recursively defined sets Len() = 0; Len(wx) = 1 + Len(w); for w  *, x   Concat(w, ) = w for w  * Concat(w1,w2x) = Concat(w1,w2)x for w1, w2 in *, x   Autumn 2012 CSE 311