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

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

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

Discrete Mathematics. Spring 2017

Induction and recursion. Chapter 5

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

Mathematical Induction

CSI Mathematical Induction. Many statements assert that a property of the form P(n) is true for all integers n.

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

Mathematical Induction. Section 5.1

With Question/Answer Animations

Induction. Announcements. Overview. Defining Functions. Sum of Squares. Closed-form expression for SQ(n) There have been some corrections to A1

Discrete Mathematics. Spring 2017

Sum of Squares. Defining Functions. Closed-Form Expression for SQ(n)

Mathematical Induction Assignments

Exercises. Template for Proofs by Mathematical Induction

Mathematical Induction

Use mathematical induction in Exercises 3 17 to prove summation formulae. Be sure to identify where you use the inductive hypothesis.

n(n + 1). 2 . If n = 3, then 1+2+3=6= 3(3+1) . If n = 2, then = 3 = 2(2+1)

Induction and Recursion

CSC236H Lecture 2. Ilir Dema. September 19, 2018

At the start of the term, we saw the following formula for computing the sum of the first n integers:

Mathematical Induction. Defining Functions. Overview. Notation for recursive functions. Base case Sn(0) = 0 S(n) = S(n 1) + n for n > 0

PRINCIPLE OF MATHEMATICAL INDUCTION

Carmen s Core Concepts (Math 135)

Climbing an Infinite Ladder

Proof by Induction. Andreas Klappenecker

STUDY PROBLEMS FOR EXAM I CMSC 203 DISCRETE STRUCTURES. n (n +1)(2n +1), 6. j 2 = 1(1+1)(2 1+1) 6. k (k +1)(2k +1) 6

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

COM S 330 Lecture Notes Week of Feb 9 13

Lecture 6 : Induction DRAFT

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya

Reading 5 : Induction

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

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 3

Climbing an Infinite Ladder

CSCE 222 Discrete Structures for Computing. Proof by Induction. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

MAC-CPTM Situations Project

Induction and recursion. Topics. Induction and Recursion Vojislav Kecman CMSC 302

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

CSE 311: Foundations of Computing. Lecture 14: Induction

MATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2.

What can you prove by induction?

Discrete Mathematics for CS Spring 2008 David Wagner Note 4

Discrete Mathematics for CS Fall 2003 Wagner Lecture 3. Strong induction

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

Complete Induction and the Well- Ordering Principle

Discrete Mathematics & Mathematical Reasoning Induction

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

CSCE 222 Discrete Structures for Computing. Proofs. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

PUTNAM TRAINING MATHEMATICAL INDUCTION. Exercises

CISC-102 Fall 2017 Week 3. Principle of Mathematical Induction

Mathematical Fundamentals

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions

Logic, Sets, and Proofs

Module 9: Mathematical Induction

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

EECS 1028 M: Discrete Mathematics for Engineers

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

Discrete Mathematics & Mathematical Reasoning Induction

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Mathematical Induction. EECS 203: Discrete Mathematics Lecture 11 Spring

Prompt. Commentary. Mathematical Foci

Math Circle: Recursion and Induction

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final exam Logic & Set Theory (2IT61) (correction model)

Problem Set 5 Solutions

Fibonacci Numbers. Justin Stevens. Lecture 5. Justin Stevens Fibonacci Numbers (Lecture 5) 1 / 10

Mathematical Induction

Chapter 2 Section 2.1: Proofs Proof Techniques. CS 130 Discrete Structures

Review 1. Andreas Klappenecker

COMP232 - Mathematics for Computer Science

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

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

Section 4.2: Mathematical Induction 1

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Proof Techniques (Review of Math 271)

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Hence, the sequence of triangular numbers is given by., the. n th square number, is the sum of the first. S n

Chapter 5: The Integers

3.1 Induction: An informal introduction

Review 3. Andreas Klappenecker

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Notes on induction proofs and recursive definitions

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?

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score:

CSE 1400 Applied Discrete Mathematics Proofs

1 Examples of Weak Induction

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n.

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

CHAPTER 4 SOME METHODS OF PROOF

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

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

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

CS 173: Induction. Madhusudan Parthasarathy University of Illinois at Urbana-Champaign. February 7, 2016

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

Transcription:

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

Why induction? Prove algorithm correctness (CS320 is full of it) The inductive proof will sometimes point out an algorithmic solution to a problem Strongly connected to recursion

Motivation Show that any postage of 8 can be obtained using 3 and 5 stamps. First check for a few values: 8 = 3 + 5 9 = 3 + 3 + 3 10 = 5 + 5 11 = 5 + 3 + 3 12 = 3 + 3 + 3 + 3 How to generalize this?

Motivation Let n be a positive integer. Show that every 2 n x 2 n chessboard with one square removed can be tiled using triominoes, each covering three squares at a time.

Motivation Prove that for every positive value of n, 1 + 2 +,, + n = n(n + 1)/2.

Motivation Many mathematical statements have the form: "n Î N, P(n) P(n): Logical predicate Example: For every positive value of n, 1 + 2 +,, + n = n(n + 1)/2. Predicate propositional function that depends on a variable, and has a truth value once the variable is assigned a value. Mathematical induction is a proof technique for proving such statements

Proving P(3) Suppose we know: 1. P(1) and 2. P(n) P(n + 1) "n ³ 1. Prove: P(3) Proof: 1. P(1). [premise] 2. P(1) P(2). [specialization of premise] 3. P(2). [step 1, 2, & modus ponens] 4. P(2) P(3). [specialization of premise] 5. P(3). [step 3, 4, & modus ponens] We can construct a proof for every finite value of n Modus ponens: if p and p q then q

a Example

a Example

A Geometrical interpretation 1: 2: 3: Put these blocks, which represent numbers, together to form sums: 1 + 2 = 1 + 2 + 3 =

A Geometrical interpretation n n Area is n 2 /2 + n/2 = n(n + 1)/2

The principle of mathematical induction Let P(n) be a statement that, for each natural number n, is either true or false. To prove that "nîn, P(n), it suffices to prove: P(1) is true. (basis step) "nîn, P(n) P(n + 1). (inductive step) This is not magic. It is a recipe for constructing a proof for an arbitrary nîn.

the domino principle If the 1 st domino falls over and the nth domino falls over implies that domino (n + 1) falls over then domino n falls over for all n Î N. image from http://en.wikipedia.org/wiki/file:dominoeffect.png

proof by induction 3 steps: Prove P(1). [the basis step] Assume P(k) [the induction hypothesis] Using P(k) prove P(k + 1) [the inductive step]

Example ØShow that any postage of 8 can be obtained using 3 and 5 stamps. ØBasis step: 8 = 3 + 5

Example Let P(n) be the statement n cents postage can be obtained using 3 and 5 stamps. Want to show that P(k) is true implies P(k+1) is true for all k 8. 2 cases: 1) P(k) is true and the k cents contain at least one 5. 2) P(k) is true and the k cents do not contain any 5.

Example Case 1: k cents contain at least one 5 stamp. k cents Replace 5 stamp by two 3 stamps 5 3 3 Case 2: k cents do not contain any 5 stamp. Then there are at least three 3 stamp. k+1 cents k cents Replace three 3 stamps by two 3 3 3 5 stamps 5 5 k+1 cents 17

Arithmetic sequences Sum of an arithmetic sequence: Proof: By induction on n Base case: n=1 Induction step: Assume: Need to prove:

Examples Prove that 1 + 2 + 2 2 + + 2 n = 2 n + 1 1 Prove that for n 4 2 n < n! Prove that n 3 n is divisible by 3 for every positive n. Prove that 1 + 3 + 5 +... + (2n+1) = (n+1) 2 Prove that a set with n elements has 2 n subsets Prove that 1 2 + 2 2 + 3 2 + + n 2 = n(n+1)(2n+1)/6 for n>0 Hint: 2n 2 +7n+6 = (n+2)(2n+3) each time ask yourself 1. BASE What is the base case? Can I prove the base case? 2. STEP What is the hypothesis? Obligation: What do I need to prove the inductive step How do I complete the inductive step?

Example Prove that P(n): 1 2 + 2 2 + 3 2 + + n 2 = n(n+1)(2n+1)/6 for n>0 Base: n=1 1 2 = 1.2.3/6 Hypothesis: P(k): 1 2 + 2 2 + 3 2 + + k 2 = k(k+1)(2k+1)/6 Obligation P(k) à P(k+1) : 1 2 + 2 2 + 3 2 + + (k+1) 2 = (k+1)(k+2)(2k+3)/6 Proof: 1 2 + 2 2 + 3 2 + + (k+1) 2 = 1 2 + 2 2 + 3 2 + + k 2 + (k+1) 2 = hypothesis k(k+1)(2k+1)/6 + (k+1) 2 = (k+1)(k(2k+1)+6(k+1))/6 = (k+1)(2k 2 +7k+6)/6 = Hint: 2n 2 +7n+6 = (n+2)(2n+3) (k+1)(k+2)(2k+3)/6

All horses have the same color Base case: If there is only one horse, there is only one color. Induction step: Assume as induction hypothesis that within any set of n horses, there is only one color. Now look at any set of n + 1 horses. Number them: 1, 2, 3,..., n, n + 1. Consider the sets {1, 2, 3,..., n} and {2, 3, 4,..., n + 1}. Each is a set of only n horses, therefore within each there is only one color. But the two sets overlap, so there must be only one color among all n+1 horses. This is clearly wrong, but can you find the flaw?

NOT all horses have the same color The step from k = 1 {1} to k = 2 {1,2} Fails: there is no intersection: {1} {2} in a set of two horses, as was incorrectly used in the proof.

More induction examples Let n be a positive integer. Show that every 2 n x 2 n chessboard with one square removed can be tiled using L-shaped triominoes, each covering three squares at a time. First, show that 3 2 n x 2 n 1 (i.e. 3 divides 2 n x 2 n 1 )

Tiling with triominoes Divide the board into four sub-boards: Base case?

A bound on Fibonacci numbers The Fibonacci sequence: f 0 = 0, f 1 = 1 f n = f n 1 + f n 2 for n 2 Theorem: f n 2 n for n 0

Strong induction Induction: P(1) is true. "n ÎN, P(n) P(n + 1). Implies "n ÎN, P(n) Strong induction: P(1) is true. "n ÎN, (P(1) P(2) P(n)) P(n + 1). Implies "n ÎN, P(n)

Example Prove that all natural numbers ³ 2 can be represented as a product of primes. Basis: n=2: 2 is a prime.

Example Inductive step: show that n+1 can be represented as a product of primes. If n+1 is a prime: It can be represented as a product of 1 prime, itself. If n+1 is composite: Then, n + 1 = ab, for some a,b < n + 1. Therefore, a = p 1 p 2... p k & b = q 1 q 2... q l, where the p i s & q i s are primes. Represent n+1 = p 1 p 2... p k q 1 q 2... q l.

Breaking chocolate Theorem: Breaking up a chocolate bar with n squares into individual squares takes n-1 breaks. (Break = dividing (sub) bar in 2 along a break line ) A full binary tree (sometimes proper binary tree or 2-tree) is a tree in which every node other than the leaves has two children. Prove: A full binary tree with n leaves has n-1 internal nodes What is the relation with the chocolate bar?

Induction and the well ordering principle The well-ordering principle: any non-empty subset of the non-negative integers has a smallest element. Surprising fact: Well-ordering implies the principle of mathematical induction Smallest element: base Next element: step