Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

Similar documents
INDUCTION AND RECURSION. Lecture 7 - Ch. 4

Chapter 5.1: Induction

Writing Assignment 2 Student Sample Questions

Discrete Mathematics. Spring 2017

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

Induction and recursion. Chapter 5

5: The Integers (An introduction to Number Theory)

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

1 Recursive Algorithms

Problem Set 5 Solutions

ICS141: Discrete Mathematics for Computer Science I

MAT 243 Test 2 SOLUTIONS, FORM A

2. THE EUCLIDEAN ALGORITHM More ring essentials

Discrete Mathematics

The Euclidean Algorithm

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Ma/CS 6a Class 2: Congruences

Induction and Recursion

Mathematical Induction

Lecture Overview. 2 Weak Induction

Fall 2017 Test II review problems

3 Finite continued fractions

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

MATH FINAL EXAM REVIEW HINTS

THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION ECOM Eng. Huda M.

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Ma/CS 6a Class 2: Congruences

8 Primes and Modular Arithmetic

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

Chapter 5: The Integers

Mathematical Induction

Section 11.1 Sequences

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

M381 Number Theory 2004 Page 1

UNIVERSITY OF VICTORIA DECEMBER EXAMINATIONS MATH 122: Logic and Foundations

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

Arithmetic Algorithms, Part 1

Notes for Recitation 6

Climbing an Infinite Ladder

With Question/Answer Animations

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

1 Examples of Weak Induction

Climbing an Infinite Ladder

n n P} is a bounded subset Proof. Let A be a nonempty subset of Z, bounded above. Define the set

Discrete Mathematics. Spring 2017

Mathematical Induction. Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition)

NOTES ON SIMPLE NUMBER THEORY

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

Recursive Definitions

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Discrete Mathematics GCD, LCM, RSA Algorithm

Carmen s Core Concepts (Math 135)

Introduction to Induction (LAMC, 10/14/07)

Proof Techniques (Review of Math 271)

Lecture Notes. Advanced Discrete Structures COT S

Math.3336: Discrete Mathematics. Mathematical Induction

4. Number Theory (Part 2)

Discrete Math in Computer Science Solutions to Practice Problems for Midterm 2

Complete Induction and the Well- Ordering Principle

NOTES ON INTEGERS. 1. Integers

CPSC 467b: Cryptography and Computer Security

Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 14. Recursive algorithm

We want to show P (n) is true for all integers

201-1A5-MT - Mathematics Summer 2015 HOMEWORK 2 Deadline : Sunday, August 30, 2015 at 12 :30.

21 Induction. Tom Lewis. Fall Term Tom Lewis () 21 Induction Fall Term / 14

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

CSE 20 DISCRETE MATH WINTER

Mathematical Induction

8. Sequences, Series, and Probability 8.1. SEQUENCES AND SERIES

IS 709/809: Computational Methods for IS Research. Math Review: Algorithm Analysis

4 Powers of an Element; Cyclic Groups

Mathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)?

1 Overview and revision

CS 220: Discrete Structures and their Applications. Mathematical Induction in zybooks

MATH 215 Final. M4. For all a, b in Z, a b = b a.

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

Mathematics 228(Q1), Assignment 2 Solutions

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Homework 3, solutions

2301 Assignment 1 Due Friday 19th March, 2 pm

then the hard copy will not be correct whenever your instructor modifies the assignments.

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

CPSC 467: Cryptography and Computer Security

Consider an infinite row of dominoes, labeled by 1, 2, 3,, where each domino is standing up. What should one do to knock over all dominoes?

Outline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction

Homework #2 solutions Due: June 15, 2012

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

{ 0! = 1 n! = n(n 1)!, n 1. n! =

Notes on Continued Fractions for Math 4400

Mathematical Induction Assignments

MEETING 9 - INDUCTION AND RECURSION

Math 230 Final Exam, Spring 2008

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

Transcription:

The principle of mathematical induction is a useful tool for proving that a certain predicate is true for all natural numbers. It cannot be used to discover theorems, but only to prove them. If we have a propositional function P(n), and we want to prove that P(n) is true for any natural number n, we do the following: Show that P(0) is true. Show that if P(n) then P(n + 1) for any n N. Then P(n) must be true for any n N. 1 2 Show that n < 2 n for all positive integers n. Let P(n) be the proposition n < 2 n. 1. Show that P(1) is true. P(1) is true, because 1 < 2 1 = 2. 2. Show that if P(n) is true, then P(n + 1) is true. Assume that n < 2 n is true. We need to show that P(n + 1) is true, i.e. n + 1 < 2 n+1 We start from n < 2 n : n + 1 < 2 n + 1 2 n + 2 n = 2 n+1 Therefore, if n < 2 n then n + 1 < 2 n+1 3 4 3. Then P(n) must be true for any positive integer. n < 2 n is true for any positive integer. Another Example ( Gauss ): 1 + 2 + + n = n (n + 1)/2 1. Show that P(0) is true. For n = 0 we get 0 = 0. True. 5 6 1

2. Show that if P(n) then P(n + 1) for any n N. 1 + 2 + + n = n (n + 1)/2 1 + 2 + + n + (n + 1) = n (n + 1)/2 + (n + 1) = (n + 1) (n/2 + 1) = (n + 1) (n + 2)/2 = (n + 1) ((n + 1) + 1)/2 3. Then P(n) must be true for any n N. 1 + 2 + + n = n (n + 1)/2 is true for all n N. 7 8 There is another proof technique that is very similar to the principle of mathematical induction. It is called the second principle of mathematical induction. It can be used to prove that a propositional function P(n) is true for any natural number n. The second principle of mathematical induction: Show that P(0) is true. Show that if P(0) and P(1) and and P(n), then P(n + 1) for any n N. Then P(n) must be true for any n N. 9 10 Show that every integer greater than 1 can be written as the product of primes. Show that P(2) is true. 2 is the product of one prime: itself. Show that if P(2) and P(3) and and P(n), then P(n + 1) for any n N. Two possible cases: If (n + 1) is prime, then obviously P(n + 1) is true. If (n + 1) is composite, it can be written as the product of two integers a and b such that 2 a b < n + 1. By the induction hypothesis, both a and b can be written as the product of primes. Therefore, n + 1 = a b can be written as the product of primes. 11 12 2

Then P(n) must be true for any n N with n > 1. We have shown that every integer greater than 1 can be written as the product of primes. Recursive Definitions Recursion is a principle closely related to mathematical induction. In a recursive definition, an object is defined in terms of itself. We can recursively define sequences, functions and sets. 13 14 Recursively Defined Sequences The sequence {a n } of powers of 2 is given by a n = 2 n for n = 0, 1, 2,. The same sequence can also be defined recursively: a 0 = 1 a n+1 = 2a n for n = 0, 1, 2, Obviously, induction and recursion are similar principles. We can use the following method to define a function with the natural numbers as its domain: 1. Specify the value of the function at zero. 2. Give a rule for finding its value at any integer from its values at smaller integers. Such a definition is called recursive or inductive definition. 15 16 f(0) = 3 f(n + 1) = 2f(n) + 3 f(0) = 3 f(1) = 2f(0) + 3 = 2 3 + 3 = 9 f(2) = 2f(1) + 3 = 2 9 + 3 = 21 f(3) = 2f(2) + 3 = 2 21 + 3 = 45 f(4) = 2f(3) + 3 = 2 45 + 3 = 93 How can we recursively define the factorial function f(n) = n!? f(0) = 1 f(n + 1) = (n + 1)f(n) f(0) = 1 f(1) = 1f(0) = 1 1 = 1 f(2) = 2f(1) = 2 1 = 2 f(3) = 3f(2) = 3 2 = 6 f(4) = 4f(3) = 4 6 = 24 17 18 3

A famous example: The Fibonacci numbers f(0) = 0, f(1) = 1 f(n) = f(n 1) + f(n - 2) f(0) = 0 f(1) = 1 f(2) = f(1) + f(0) = 1 + 0 = 1 f(3) = f(2) + f(1) = 1 + 1 = 2 f(4) = f(3) + f(2) = 2 + 1 = 3 f(5) = f(4) + f(3) = 3 + 2 = 5 f(6) = f(5) + f(4) = 5 + 3 = 8 If we want to recursively define a set, we need to provide two things: an initial set of elements, rules for the construction of additional elements from elements in the set. Let S be recursively defined by: 3 S (x + y) S if (x S) and (y S) S is the set of positive integers divisible by 3. 19 20 Proof: Let A be the set of all positive integers divisible by 3. To show that A = S, we must show that A S and S A. Part I: To prove that A S, we must show that every positive integer divisible by 3 is in S. We will use mathematical induction to show this. Let P(n) be the statement 3n belongs to S. Basis step: P(1) is true, because 3 is in S. Inductive step: To show: If P(n) is true, then P(n + 1) is true. Assume 3n is in S. Since 3n is in S and 3 is in S, it follows from the recursive definition of S that 3n + 3 = 3(n + 1) is also in S. Conclusion of Part I: A S. 21 22 Part II: To show: S A. Basis step: To show: All initial elements of S are in A. 3 is in A. True. Inductive step: To show: (x + y) is in A whenever x and y are in A. If x and y are both in A, it follows that 3 x and 3 y. As we already know, it follows that 3 (x + y). Conclusion of Part II: S A. Overall conclusion: A = S. 23 Another example: The well-formed formulas of variables, numerals and operators from {+, -, *, /, ^} are defined by: x is a well-formed formula if x is a numeral or variable. (f + g), (f g), (f * g), (f / g), (f ^ g) are well-formed formulas if f and g are. 24 4

With this definition, we can construct formulas such as: (x y) ((z / 3) y) ((z / 3) (6 + 5)) ((z / (2 * 4)) (6 + 5)) An algorithm is called recursive if it solves a problem by reducing it to an instance of the same problem with smaller input. Example I: Recursive Euclidean Algorithm procedure gcd(a, b: nonnegative integers with a < b) if a = 0 then gcd(a, b) := b else gcd(a, b) := gcd(b mod a, a) 25 26 Example II: Recursive Fibonacci Algorithm procedure fibo(n: nonnegative integer) if n = 0 then fibo(0) := 0 else if n = 1 then fibo(1) := 1 else fibo(n) := fibo(n 1) + fibo(n 2) Recursive Fibonacci Evaluation: f(4) f(3) f(2) f(2) f(1) f(1) f(0) f(1) f(0) 27 28 5