CS173 Strong Induction and Functions. Tandy Warnow

Similar documents
CS173 Lecture B, September 10, 2015

Mathematical Induction. EECS 203: Discrete Mathematics Lecture 11 Spring

Introduction to Computational Complexity

CSC236 Week 2. Larry Zhang

CS173 Lecture B, November 3, 2015

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

Discrete Mathematics for CS Spring 2008 David Wagner Note 4

Proof Techniques (Review of Math 271)

1 More finite deterministic automata

Mathematical Induction

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

PRINCIPLE OF MATHEMATICAL INDUCTION

Lecture 3.2: Induction, and Strong Induction

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

Preparing for the CS 173 (A) Fall 2018 Midterm 1

The Inductive Proof Template

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

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 7

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

Climbing an Infinite Ladder

Big-oh stuff. You should know this definition by heart and be able to give it,

Example. How to Guess What to Prove

Mathematical Induction

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

Assignment 3 Logic and Reasoning KEY

Mathematical Induction Again

Section 4.2: Mathematical Induction 1

Mathematical Induction Again

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

Section 20: Arrow Diagrams on the Integers

Climbing an Infinite Ladder

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

CS173 Running Time and Big-O. Tandy Warnow

Essential facts about NP-completeness:

A Guide to Proof-Writing

Inference and Proofs (1.6 & 1.7)

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

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

Reading 11 : Relations and Functions

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

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

Lecture 6 : Induction DRAFT

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

Logic, Sets, and Proofs

Mathematical Induction

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques

Mathematical Induction. Section 5.1

CSC236 Week 3. Larry Zhang

Math 5a Reading Assignments for Sections

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

CHAPTER 4 SOME METHODS OF PROOF

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

What can you prove by induction?

Solutions to Quiz 1. Problem 1 (20 points). Suppose S(n) is a predicate on natural numbers, n, and suppose. k N S(k) S(k + 2). (1)

Linear Independence Reading: Lay 1.7

Computer Science Foundation Exam

MATH 430 PART 2: GROUPS AND SUBGROUPS

Another Proof By Contradiction: 2 is Irrational

Introduction to Basic Proof Techniques Mathew A. Johnson

Lecture Overview. 2 Weak Induction

Chapter 1 Review of Equations and Inequalities

Tutorial on Mathematical Induction

SET THEORY. Disproving an Alleged Set Property. Disproving an Alleged Set. Example 1 Solution CHAPTER 6

Mathematical Induction

CSE 20 DISCRETE MATH. Fall

Discrete Mathematics. Spring 2017

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

E.g. The set RE of regular expressions is given by the following rules:

Lesson 26: Characterization of Parallel Lines

Mathematical Induction. Part Two

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

Take the Anxiety Out of Word Problems

Lecture 4.3: Closures and Equivalence Relations

Integer-Valued Polynomials

Chapter 4. Induction. 4.1 Chains of Implications

Discrete Mathematics. Spring 2017

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1 (Version B)

Exercises. Template for Proofs by Mathematical Induction

Sums of Squares (FNS 195-S) Fall 2014

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

We ll start today by learning how to change a decimal to a fraction on our calculator! Then we will pick up our Unit 1-5 Review where we left off!

CSE 20 DISCRETE MATH SPRING

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

1.2 The Well-Ordering Principle

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

Proving Programs Correct

What is Crater Number Density?

Introducing Proof 1. hsn.uk.net. Contents

Computational Learning Theory

CH 24 IDENTITIES. [Each product is 35] Ch 24 Identities. Introduction

Zeros and Roots of a Polynomial Function. Return to Table of Contents

Quiz 1. Adrian Georgi Josh Karen Lee Min Nikos Tina. There are five (5) problems totaling 100 points. Total time is 110 minutes.

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.

CS 241 Analysis of Algorithms

CSE 311: Foundations of Computing. Lecture 14: Induction

8.7 MacLaurin Polynomials

Transcription:

CS173 Strong Induction and Functions Tandy Warnow

CS 173 Introduction to Strong Induction (also Functions) Tandy Warnow

Preview of the class today What are functions? Weak induction Strong induction A graph theory question

Graph Theory Question Consider the following question All finite simple graphs with minimum degree at least 1 are connected Is it true? If so, prove by induction on the number of vertices.

What are functions? Rosen, Chapter 2.3 (pp. 138-155). Functions are mappings from one set to another! The notation f : X Y means: f is a function from X to Y You can think of f as an algorithm with input coming from X and output in Y The output of f on input x is denoted f (x) In other words f (x) has a value in Y for each element x X Also, f (x) never has two values in Y for any x X X is referred to as the domain of f and Y is referred to as the co-domain of f. The subset of Y defined to be {y Y x X s.t. f (x) = y} is called the range of f.

Functions, continued Functions may or may not have nice closed forms. Consider functions mapping R R: 1. f (n) = n 2 2. f (n) = 1 if n 0 and f (n) = 1 if n < 0 3. f (n) = n if n Z and f (n) = π if n R \ Z Or something like this: f : {0, 1, 2, 3} {3, 5} given by: f (0) = 3 f (1) = 5 f (2) = 3 f (3) = 3 Question: How many different functions are there from {0, 1, 2, 3} to {3, 5}?

Representing Functions You can represent a function F : X Y with a set of ordered pairs: {(x, y) y = f (x), x X, y Y } Similarly, you can draw this as a directed bipartite graph (X, Y ) with directed edges x y for each x X, y Y such that y = f (x).

Are these functions? Consider each of the following mappings... and determine which ones are functions. Let People denote the set of all people who have ever lived. For each mapping, consider whether it satisfies the requirements for being a function. F is a mapping from People to People that has the ordered pair (x, y) if and only if x is the mother of y F is a mapping from People to People that has the ordered pair (x, y) if and only if x is the child of y F is a mapping from R + to R that has the ordered pair (x, y) if and only if y = x 2. F is a mapping from R + to R that has the ordered pair (x, y) if and only if x = y 2.

Weak induction What we did was weak induction : Write down what you want to prove as a statement P(n) that depends on a parameter n Show that P(n) is true for some base case(s) Show that P(n) P(n + 1)

Weak induction Let F : Z + Z be defined by F (1) = 1 F (n) = 2F (n 1) if n > 1 Then F (n) = 2 n for all n Z +. The proof by weak induction is straightforward.

A harder case Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Then for all positive integers n, F (n) = n mod 2 Let s try to prove this by induction on n. Let s make our Boolean statement P(n) be: F (n) = n mod 2 where n mod 2 is the remainder after dividing n by 2.

Why simple induction can fail Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Suppose P(n) is the statement F (n) = n mod 2. Base cases are fine (n = 1, n = 2). Does P(n) P(n + 1)? Let n 2 and assume P(n) is true.

Why weak induction can fail Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Suppose P(n) is the statement F (n) = n mod 2. To show that P(n) P(n + 1) we need to show that If F (n) = n mod 2 then F (n + 1) = n + 1 mod 2. Let s try this.

Why weak induction can fail Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 We assume n 2 is arbitrary and P(n) is true. Then n + 1 3 and so (by definition) F (n + 1) = F (n 1). What s our next step?

Why weak induction can fail Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 We assume n 2 is arbitrary and P(n) is true. Then n + 1 3 and so (by definition) F (n + 1) = F (n 1). What s our next step? Recall the Inductive Hypothesis is P(n): F (n) = n mod 2. The Inductive Hypothesis tells us nothing about F (n 1). What do we do now???

Our induction proof has failed! Our Inductive Hypothesis only told us about F (n), not about F (n 1). Our induction proof failed because we don t know anything about F (n 1). We need to make a statement about all preceeding values, not just the immediate predecessor.

Let s do strong induction! Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Then F (n) = n mod 2 for all n Z +. Question: What should we assume? Let P(k) be the assertion that: F (k) = k mod 2 and let us assume that P(1), P(2), P(3),..., P(n) are all true! Can we work with this?

Using strong induction Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Then F (n) = n mod 2 for all n Z +. Let P(k) be the assertion: F (k) = k mod 2 and let us assume that P(1), P(2),..., P(n) are all true. We need two base cases n = 1 and n = 2. Does this work? (YES) Why do we need two base cases? (You ll see later)

Using strong induction Let F : Z + Z be defined by F (1) = 1 and F (2) = 0 F (n) = F (n 2) if n > 2 Then F (n) = n mod 2 for all n Z +. Let P(k) be the assertion: F (k) = k mod 2 Now we want to show that for any arbitrary n 1, P(1) P(2)... P(n) P(n + 1) In other words, we wish to prove that IF k {1, 2,..., n}, F (k) = k mod 2 THEN F (n + 1) = n + 1 mod 2

Continuing this proof Let n 2 and assume P(k) true for all k = 1, 2,..., n. We wish to infer that P(n + 1) is true. Since n 2, then n + 1 3. Hence, by the definition of F : F (n + 1) = F (n 1) But n 1 n and so by the Inductive Hypothesis, Also note that F (n 1) = n 1 mod 2 n 1 mod 2 = n + 1 mod 2 Hence F (n + 1) = n + 1 mod 2

Finishing the proof We showed that whenever n 2. P(1) P(2)... P(n) P(n + 1) We also had established that P(1) and P(2) were true. Hence, P(n) is true for all n Z +. In other words, we have shown that F (n) = n mod 2 for all n Z +. Q.E.D.

Why did we need two base cases? Recall that we checked base cases n = 1 and n = 2. We needed this to be sure that we covered every possible n Z +. Suppose we only verified that P(1) is true. Then how would we be able to derive that P(2) is true?

What we learned We learned: The base case is sometimes more than one value. Sometimes strong induction is needed!

Proofs by induction that go wrong Is this true? All finite simple graphs with minimum degree at least 1 are connected

Proofs by induction that go wrong Is this true? Answer: All finite simple graphs with minimum degree at least 1 are connected Consider the graph G = (V, E) with V = {a, b, c, d} and E = {(a, b), (c, d)}

Proofs by induction that go wrong What s wrong with this proof of this theorem? Theorem: All finite simple graphs with minimum degree at least 1 are connected Proof: We prove by induction on n, the number of vertices. Our Inductive Hypothesis is P(n): all simple graphs with n vertices with minimum degree 1 or more are connected. The base case is n = 1 and is vacuously true. Let N 1 be arbitrary, and assume P(N) is true.

Proofs by induction that go wrong Let G = (V, E) be a simple graph with N vertices with minimum degree at least 1. By the inductive hypothesis, G is connected. Let G be the graph formed by adding one vertex, x, to G. If G has minimum degree at least 1, then x must be adjacent to some vertex y. Since y is connected (via a path) by every other vertex in G, x is also connected (via a path) to every other vertex in G. Hence G is connected. Since G was arbitrary, this proves that all simple finite graphs with minimum degree 1 are connected.