Quiz 7 The way I expected it.. How to do it! 1. Let P(n) be the statement that 1 2 + 2 2 +... + n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. Be.

Slides:



Advertisements
Similar presentations
CSC 2510 Test 3 1. Give the names of the formula or rule that provides the answer for each of the following problems. Do not try to solve the problems!
Advertisements

22C:19 Discrete Structures Induction and Recursion Fall 2014 Sukumar Ghosh.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Appendix B Solving Recurrence Equations : With Applications to Analysis of Recursive Algorithms.
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.
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
Fall 2007CS 2251 Proof by Induction. Fall 2007CS 2252 Proof by Induction There are two forms of induction Standard Induction –Prove the theorem is true.
Recursive Definitions Rosen, 3.4. Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
CSE115/ENGR160 Discrete Mathematics 03/22/12 Ming-Hsuan Yang UC Merced 1.
Chapter 10 Sequences, Induction, and Probability Copyright © 2014, 2010, 2007 Pearson Education, Inc Mathematical Induction.
Copyright © Cengage Learning. All rights reserved.
1 Section 3.4 Recursive Definitions. 2 Recursion Recursion is the process of defining an object in terms of itself Technique can be used to define sequences,
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
Induction and Recursion by: Mohsin tahir (GL) Numan-ul-haq Waqas akram Rao arslan Ali asghar.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
Induction and recursion
Algorithm Design and Analysis (ADA)
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
Mathematical Maxims and Minims, 1988
Chapter 6 Mathematical Induction
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!
Chapter 4: Induction and Recursion
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,
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
1 Section 5.5 Solving Recurrences Any recursively defined function ƒ with domain N that computes numbers is called a recurrence or recurrence relation.
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.
Recursive Algorithms &
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
October 3, 2001CSE 373, Autumn Mathematical Background Exponents X A X B = X A+B X A / X B = X A-B (X A ) B = X AB X N +X N = 2X N 2 N +2 N = 2 N+1.
1/32 This Lecture Substitution model An example using the substitution model Designing recursive procedures Designing iterative procedures Proving that.
Inductive Proofs and Inductive Definitions Jim Skon.
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction Linda Shapiro Winter 2015.
Divide and Conquer Faculty Name: Ruhi Fatima Topics Covered Divide and Conquer Matrix multiplication Recurrence.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
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.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Section 8.4 Mathematical Induction. Mathematical Induction In this section we are going to perform a type of mathematical proof called mathematical induction.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Mathematical Induction. The Principle of Mathematical Induction Let S n be a statement involving the positive integer n. If 1.S 1 is true, and 2.the truth.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Chapter 4: Induction and Recursion
11.7 – Proof by Mathematical Induction
MATH 224 – Discrete Mathematics
CS2210:0001Discrete Structures Induction and Recursion
Induction and Recursion
CSE 311: Foundations of Computing
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Mathematical Induction Recursion
Chapter 5 Induction and Recursion
Quiz 6 The way I expected it..
Proofs, Recursion and Analysis of Algorithms
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction
BaSIC Math Reviews.
Notes 9.5 – Mathematical Induction
CSE 373 Data Structures and Algorithms
Applied Discrete Mathematics Week 9: Integer Properties
Solving a System of Equations in Two Variables by the Addition Method
Chapter 11: Further Topics in Algebra
Copyright © Cengage Learning. All rights reserved.
Mathematical Induction
Mathematical Induction
Copyright © Cengage Learning. All rights reserved.
11.4 Mathematical Induction
Recursion.
Chapter 1 Automata CE year IV.
Presentation transcript:

Quiz 7 The way I expected it.

How to do it! 1. Let P(n) be the statement that n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. Be sure to use the formal proof that includes the Basis Step

State what you are trying to prove! Prove n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. Positive integer n means 1, 2, 3, …

Basis Step Let P(n) be the statement that n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. (a) Basis Step: plugging in n = 1 we have that P(1) is the statement: (1) 2 = (1)((1) + 1)(2(1) + 1)/6 Expanding both sides we have: 1 = 1 * 2 * 3/6 = 1 Both sides of P(1) shown in part (a) equal 1. Here we are just plugging in the smallest positive integer and showing that both sides are equivalent.

Inductive Hypotheses (b) Inductive Hypotheses: The inductive hypothesis is the statement that k 2 = k(k + 1)(2k + 1)/6 Here we substitute k for n and restate what we are trying to prove.

Inductive step (c) For the inductive step, we want to show for each k ≥ 1 that P(k) implies P(k + 1). In other words, we want to show that by assuming the inductive hypothesis we can prove ( k 2 ) + (k + 1) 2 = (k + 1) ((k + 1) + 1)(2(k + 1) + 1)/6 We take the last k term on the left side, (k) 2, add another similar term with the k value replaced by k + 1, and replace all k terms on the right-hand side by k + 1 terms.

Substitution Proof (d) Replacing the quantity in brackets on the left-hand side of part(c) by what it equals by virtue of the inductive hypothesis k(k + 1)(2k + 1)/6 + (k + 1) 2 = (k + 1) ((k + 1) + 1)(2(k + 1) + 1)/6, we have k(k + 1)(2k + 1)/6 + (k + 1) 2 = (k + 1) ((k + 1) + 1)(2(k + 1) + 1)/6 k(k + 1)(2k + 1)/6 +6 (k + 1) 2 /6 = (k + 1) ((k + 1) + 1)(2(k + 1) + 1)/6 (k(2k + 1) + 6 (k + 1))/6 = (k + 2)(2k + 3)/6{divide both sides by (k + 1)} (k(2k + 1) + 6 (k + 1)) = (k + 2)(2k + 3){multiply both sides by 6} 2k 2 + k + 6k + 6 = (k + 2)(2k + 3){expand both sides} 2k 2 + 7k + 6 = 2k 2 + 7k + 6 {divide both sides by 2k 2 + 7k + 6 } 1 = 1{both sides equal} we have shown that both sides are equal as we desired. 

N Factorial 2. Convert the following recursive function into a recursive algorithm (using the pseudo format specified in appendix A3): f(0) = 1 f(n + 1) = (n + 1) * f(n) procedure factorial(n: nonnegative integer) if n = 0 then return 1 else return n ∙ factorial(n − 1 ) {output is n!}

A Recursive Algorithm for Computing  n k=0 a k 3. Bonus: a. Give a recursive algorithm (in the pseudo format specified in appendix A3) for computing:  n k=0 a k = a 0 + a 1 + a 2 + … + a n procedure series (a: list of nonzero real numbers, n: nonnegative integer) if n = 0 then return a 0 else return a n + series (a, n − 1 ) {output is a 0 + a 1 + a 2 + … + a n }

Bonus b. Using 3. above, show the value of a k generated at each step given a 0 = 1 and n= 4. (missing information a 1 = 2, a 2 = 3, a 3 = 4, a 4 = 5) Green is the values that missing info would have provided! Red is what you could have provided without missing info! n01234 anan a0a0 a 0 + a 1 a 0 +a 1 + a 2 a 0 + a 1 + a 2 + a 3 a 0 + a 1 + a 2 + a 3 + a