Discrete Mathematics. Spring 2017

Similar documents
With Question/Answer Animations

Induction and recursion. Chapter 5

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

Mathematical Induction. Section 5.1

Induction and Recursion

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

Discrete Mathematics. Spring 2017

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

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

Strong Mathematical Induction

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

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

EECS 1028 M: Discrete Mathematics for Engineers

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

Math Circle: Recursion and Induction

COMP232 - Mathematics for Computer Science

Climbing an Infinite Ladder

0.Axioms for the Integers 1

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

Climbing an Infinite Ladder

Complete Induction and the Well- Ordering Principle

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

ICS141: Discrete Mathematics for Computer Science I

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

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

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

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

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

Lecture 6 : Induction DRAFT

CSC236H Lecture 2. Ilir Dema. September 19, 2018

Mathematical Induction. EECS 203: Discrete Mathematics Lecture 11 Spring

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

Exercises. Template for Proofs by Mathematical Induction

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

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

MAT115A-21 COMPLETE LECTURE NOTES

Reading 5 : Induction

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

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

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Strong Induction (Second Principle) Example: There are two piles of cards, players take turn: each turn: one player removes any number of cards from

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

Math 324 Summer 2012 Elementary Number Theory Notes on 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.

Lecture 3.2: Induction, and Strong Induction

Section 4.2: Mathematical Induction 1

Proof Techniques (Review of Math 271)

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

Math 230 Final Exam, Spring 2008

Carmen s Core Concepts (Math 135)

Quiz 3 Reminder and Midterm Results

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

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

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

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

Computer Science Foundation Exam

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

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

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

What can you prove by induction?

Models of Computation. by Costas Busch, LSU

PRINCIPLE OF MATHEMATICAL INDUCTION

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

CSE 311: Foundations of Computing. Lecture 14: Induction

CS173 Lecture B, September 10, 2015

Lecture 2: Proof Techniques Lecturer: Lale Özkahya

Example: Use a direct argument to show that the sum of two even integers has to be even. Solution: Recall that an integer is even if it is a multiple

COS 341 Discrete Mathematics

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

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.

Basic Proof Examples

I. Induction. Po-Shen Loh June 16, 2003

CSCE 222 Discrete Structures for Computing. Review for Exam 2. Dr. Hyunyoung Lee !!!

x P(x) x P(x) CSE 311: Foundations of Computing announcements last time: quantifiers, review: logical Inference Fall 2013 Lecture 7: Proofs

In 1854, Karl Weierstrauss gave an example of a continuous function which was nowhere di erentiable: cos(3 n x) 2 n. sin(3 n x), 2

Problem One: Order Relations i. What three properties does a binary relation have to have to be a partial order?

COM S 330 Lecture Notes Week of Feb 9 13

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction. Linda Shapiro Spring 2016

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

Mathematical Fundamentals

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

Notes on induction proofs and recursive definitions

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

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2)

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

CSE 20 DISCRETE MATH SPRING

Properties of the Integers

CHAPTER2 PROOFS, RECURSION, AND ANALYSIS OF ALGORITHMS CHAPTER OBJECTIVES. Question: Is the contractor s estimate correct?

k 6, then which of the following statements can you assume to be

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

CS173 Strong Induction and Functions. Tandy Warnow

1 Sequences and Summation

All numbered readings are from Beck and Geoghegan s The art of proof.

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Show Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.

Transcription:

Discrete Mathematics Spring 2017

Previous Lecture Principle of Mathematical Induction Mathematical Induction: Rule of Inference Mathematical Induction: Conjecturing and Proving

Mathematical Induction: Tiling Checkerboards Example: Show that every 2 n 2 n checkerboard with one square removed can be tiled using right triominoes. Right triominoes are pieces shaped like the letter L Solution: Let P(n) be the proposition that every 2 n 2 n checkerboard with one square removed can be tiled using right triominoes. Use mathematical induction to prove that P(n) is true for all positive integers n. BASIS STEP: P(1) is true, because each of the four 2 2 checkerboards with one square removed can be tiled using one right triomino.

Mathematical Induction: Tiling Checkerboards INDUCTIVE STEP: Assume that P(k) is true for every 2 k 2 k checkerboard, for some positive integer k. Consider a 2 k+1 2 k+1 checkerboard with one square removed. Split this checkerboard into four checkerboards of size 2 k 2 k,by dividing it in half in both directions. Remove a square from one of the four 2 k 2 k checkerboards. By the inductive hypothesis, this board can be tiled. Also by the inductive hypothesis, the other three boards can be tiled with the square from the corner of the center of the original board removed. We can then cover the three adjacent squares with a triominoe.

Strong Induction Strong Induction: To prove that P(n) is true for all positive integers n, where P(n) is a propositional function, complete two steps: BASIS STEP: Verify that the proposition P(1) is true INDUCTIVE STEP: Show the conditional statement [P(1) P(2) P(k)] P(k + 1) holds for all positive integers k Which Form of Induction Should Be Used? We can always use strong induction instead of mathematical induction. But there is no reason to use it if it is simpler to use mathematical induction. In fact, the principles of mathematical induction, strong induction, and the well-ordering property are all equivalent

Strong Induction: Proof of the Fundamental Theorem of Arithmetic Example: Show that if n is an integer greater than 1, then n can be written as the product of primes Solution: Let P(n) be the proposition that n can be written as a product of primes BASIS STEP: P(2) is true since 2 itself is prime INDUCTIVE STEP: The inductive hypothesis is P(j) is true for all integers j with 2 j k. To show that P(k + 1) must be true under this assumption, two cases need to be considered: If k + 1 is prime, then P(k + 1) is true Otherwise, k + 1 is composite and can be written as the product of two positive integers a and b with 2 a b < k + 1. By the inductive hypothesis a and b can be written as the product of primes and therefore k + 1 can also be written as the product of those primes Hence, every integer greater than 1 can be written as the product of primes

Strong Induction: Postage Example Example: Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps Solution: Let P(n) be the proposition that postage of n cents can be formed using 4-cent and 5-cent stamps BASIS STEP: P(12), P(13), P(14), and P(15) hold P(12) uses three 4-cent stamps P(13) uses two 4-cent stamps and one 5-cent stamp P(14) uses one 4-cent stamp and two 5-cent stamps P(15) uses three 5-cent stamps INDUCTIVE STEP: The inductive hypothesis states that P(j) holds for 12 j k, where k 15. Assuming the inductive hypothesis, it can be shown that P(k + 1) holds Using the inductive hypothesis, P(k 3) holds since k 3 12. To form postage of k + 1 cents, add a 4-cent stamp to the postage for k 3 cents. Hence, P(n) holds for all n 12

Mathematical Induction: Postage Example Example: Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps Solution: Let P(n) be the proposition that postage of n cents can be formed using 4-cent and 5-cent stamps BASIS STEP: Postage of 12 cents can be formed using three 4-cent stamps INDUCTIVE STEP: Assume P(k) holds, i.e., postage of k cents can be formed using 4-cent and 5-cent stamps Must show that P(k + 1) holds for k 12. Consider two cases: If at least one 4-cent stamp has been used, then a 4-cent stamp can be replaced with a 5-cent stamp to yield a total of k + 1 cents Otherwise, no 4-cent stamp have been used and at least three 5-cent stamps were used. Three 5-cent stamps can be replaced by four 4-cent stamps to yield a total of k + 1 cents Hence, P(n) holds for all n 12

Why Does Induction Works? Well Ordering One of the axioms of positive integers is the principle of well-ordering: Every non-empty subset of N contains the least element (Recall: an element is called the least element if it is less than all the other elements in the poset) Note that the sets of all integers, rational numbers, and real numbers do not have this property Suppose that mathematical induction is not valid. Then there is a predicate P(n) such that P(1) is true, k(p(k) P(k + 1)) is true, but there is n such that P(n) is false Let T N be the set of all n such that P(n) is false. By the principle of well-ordering T contains the least element a As P(1) is true, a 1. We have P(a 1) is true. However, since P(a 1) P(a), we get a contradiction

Recursively Functions: Definition Induction mechanism can be used to define things To define a function f : N R we complete two steps: Basis step: define f (1) Inductive step: for all k define f (k + 1) as a function of f (k) or, more generally, as a function of f (1), f (2),..., f (k) Example: Give a recursive definition of f (n) = 2 n Basis step: f (0) = 1 Inductive step: f (k + 1) = 2 f (k) Example: Suppose f is defined by: f (0) = 3 f (n + 1) = 2f (n) + 3 Find f (1), f (2), f (3), f (4) Solution:

Recursively Defined Functions: Factorial Example: f (n) = n! BASIS STEP: 0! = 1 INDUCTIVE STEP: (k + 1)! = k! (k + 1) n n! 0 1 1 1 2 2 3 6 4 24 4 120 5 720 7 5040 8 40320 9 362880

Recursively Defined Functions: Fibonacci Numbers Basis step: F (0) = 0, F (1) = 1 Inductive step: F (k + 1) = F (k) + F (k 1)

Recursively Defined Functions: Fibonacci Numbers Show that whenever n 3, F (n) > α n 2, where α = (1 + 5)/2 (α is a solution of x 2 x 1 = 0) Solution: Let P(n) be the statement F (n) > α n 2. Use strong induction to show that P(n) is true whenever n 3 BASIS STEP: P(3) holds since α < 2 = F (3) P(4) holds since α 2 = (3 + 5)/2 < 3 = F (4) INDUCTIVE STEP: Assume that P(j) holds, i.e., F (j) > α j 2 for all integers j with 3 j k, where k 4 Show that P(k + 1) holds, i.e., F (k + 1) > α k 1

Recursively Defined Functions: Fibonacci Numbers Since α 2 = α + 1 (because α is a solution of x 2 x 1 = 0) α k 1 = α 2 α k 3 = (α + 1) α k 3 = α α k 3 + 1 α k 3 = α k 2 + α k 3 By the inductive hypothesis, because k 4 we have F (k + 1) = F (k) + F (k 1) > α k 2 + α k 3 = α k 1 Hence, P(k + 1) is true

Recursively Defined Sets and Structures Induction can be used to define structures We need to complete the same two steps: Basis step: Define the simplest structure possible Inductive step: A rule, how to build a bigger structure from smaller ones

Recursively Defined Sets and Structures: Well Formed Propositional Statements What is a well formed statement? (p q) r is well formed (p q) r is not Recursive definition of well formed formulas Basis step: A primitive statement is a well formed statement Inductive step: If φ and ψ are well formed statements, then φ, (φ ψ), (φ ψ), (φ ψ), (φ ψ), (φ ψ) are well formed statements Such a definition can be used by various algorithms, for example, parsing

Recursively Defined Sets and Structures: Rooted Trees A binary tree is a graph formed by the following recursive definition Basis case: A single vertex is a binary tree Inductive step: Suppose that T 1, T 2 are disjoint binary trees with roots r 1, r 2, respectively. Then the graph formed by starting with a root r, and adding an edge from r to each of the vertices r 1, r 2, is also a binary tree. Or T is a binary tree with the root r. Then the graph formed by starting with a root r, and adding an edge from r to r is also a binary tree

Definition: To prove a property of the elements of a recursively defined set, we use structural induction BASIS STEP: Show that the result holds for all elements specified in the basis step of the recursive definition RECURSIVE STEP: Show that if the statement is true for each of the elements used to construct new elements in the recursive step of the definition, the result holds for these new elements The validity of structural induction can be shown to follow from the principle of mathematical induction

Definition: The height h(t ) of a full binary tree T is defined recursively as follows: BASIS STEP: The height of a full binary tree T consisting of only a root r is h(t ) = 0 RECURSIVE STEP: If T 1 and T 2 are full binary trees, then the full binary tree T = T 1 T 2 has height h(t ) = 1 + max(h(t 1 ), h(t 2 )) The number of vertices n(t ) of a full binary tree T satisfies the following recursive formula: BASIS STEP: The number of vertices of a full binary tree T consisting of only a root r is n(t ) = 1 RECURSIVE STEP: If T 1 and T 2 are full binary trees, then the full binary tree T = T 1 T 2 has the number of vertices n(t ) = 1 + n(t 1 ) + n(t 2 )

Theorem: If T is a full binary tree, then n(t ) 2 h(t )+1 1 Proof: Use structural induction BASIS STEP: The result holds for a full binary tree consisting only of a root, n(t ) = 1 and h(t ) = 0. Hence, n(t ) = 1 2 0+1 1 = 1 RECURSIVE STEP: Assume n(t 1 ) 2 h(t1)+1 1 and also n(t 2 ) 2 h(t2)+1 1 whenever T 1 and T 2 are full binary trees n(t ) = 1 + n(t 1 ) + n(t 2 ) (by recursive formula of n(t )) 1 + (2 h(t1)+1 1) + (2 h(t2)+1 1) (by inductive hypothesis) 2 max(2 h(t1)+1, 2 h(t2)+1 ) 1 = 2 2 max(h(t1),h(t2))+1 1 (because max(2 x, 2 y ) = 2 max(x,y) ) = 2 2 h(t ) 1 (by recursive definition of h(t )) = 2 h(t )+1 1

Homework for practice (not graded) Exercises from the Book: Section 5.2: Exercises 4, 6, 8, 10, 12 Section 5.3: Exercises 2, 4, 6, 8, 10