CSE 20 DISCRETE MATH WINTER

Similar documents
1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

CSE 20 DISCRETE MATH. Winter

Inference rule for Induction

Discrete Mathematics Lecture 4. Harper Langston New York University

Recursive Definitions Structural Induction Recursive Algorithms

Blocking Combinatorial Games

Cofinite Induced Subgraph Nim

Induction and Recursion. CMPS/MATH 2170: Discrete Mathematics

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

CSE 20 DISCRETE MATH. Fall

Discrete Structures. Fall Homework3

Winning Positions in Simplicial Nim

To illustrate what is intended the following are three write ups by students. Diagonalization

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

On the packing chromatic number of some lattices

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

Recursively Defined Functions

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

Solutions to the Second Midterm Exam

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Fundamental mathematical techniques reviewed: Mathematical induction Recursion. Typically taught in courses such as Calculus and Discrete Mathematics.

1. (15 points) Solve the decanting problem for containers of sizes 199 and 179; that is find integers x and y satisfying.

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours

A Generalization of the Nim and Wythoff games

Foundations of Computer Science Spring Mathematical Preliminaries

Infinity and Uncountability. Countable Countably infinite. Enumeration

Computer Science 236 Fall Nov. 11, 2010

Today. Types of graphs. Complete Graphs. Trees. Hypercubes.

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Mathematical Induction

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

Trail Making Game. Hyun Sung Jun Jaehoon Kim Sang-il Oum Department of Mathematical Sciences KAIST, Daejeon, , Republic of Korea.

Encoding/Decoding, Counting graphs

SECTION 5.1. Sequences

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

William Linz 1 Department of Mathematics, Texas A&M University, College Station, Texas

Integers and Mathematical Induction

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

AXIOMS FOR THE INTEGERS

Recall our recursive multiply algorithm:

HMMT February 2018 February 10, 2018

Treewidth and graph minors

Domination, Independence and Other Numbers Associated With the Intersection Graph of a Set of Half-planes

Master Theorem, Introduction to Graphs

Vertex Deletion games with Parity rules

Binomial Coefficient Identities and Encoding/Decoding

Finite Math Linear Programming 1 May / 7

COT 3100 Spring 2010 Midterm 2

Chomp the Graph. Research. treet. road. Sam Magura, Vitchyr Pong, Elliot Cartee, Kevin Valakuzhy. Scientific

2017 SOLUTIONS (PRELIMINARY VERSION)

Complexity, Induction, and Recurrence Relations. CSE 373 Help Session 4/7/2016

4&5 Binary Operations and Relations. The Integers. (part I)

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:

THE PRINCIPLE OF INDUCTION. MARK FLANAGAN School of Electrical, Electronic and Communications Engineering University College Dublin

REGULAR GRAPHS OF GIVEN GIRTH. Contents

CSC Discrete Math I, Spring Sets

Solutions to In-Class Problems Week 4, Fri

IMO Training 2008: Graph Theory

Lecture 1. 1 Notation

Algorithms. Cody Johnson

Math236 Discrete Maths with Applications

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

arxiv: v2 [math.co] 11 May 2016

4 Generating functions in two variables

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

Summary of Course Coverage

Cardinality of Sets. Washington University Math Circle 10/30/2016

Section 1.7 Sequences, Summations Cardinality of Infinite Sets

Instructor: Paul Zeitz, University of San Francisco

HW Graph Theory SOLUTIONS (hbovik) - Q

Lecture 22 Tuesday, April 10

Pebble Sets in Convex Polygons

Fall Recursion and induction. Stephen Brookes. Lecture 4

CSE 105 THEORY OF COMPUTATION

NOTE ON MINIMALLY k-connected GRAPHS

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

Nim-Regularity of Graphs

Recursion and Structural Induction

Induction Review. Graphs. EECS 310: Discrete Math Lecture 5 Graph Theory, Matching. Common Graphs. a set of edges or collection of two-elt subsets

Chapter 3. Set Theory. 3.1 What is a Set?

Encoding/Decoding and Lower Bound for Sorting

CS250: Discrete Math for Computer Science. L20: Complete Induction and Proof of Euler s Characterization of Eulerian-Walks

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Graph Theory II. Po-Shen Loh. June edges each. Solution: Spread the n vertices around a circle. Take parallel classes.

Proposition 1. The edges of an even graph can be split (partitioned) into cycles, no two of which have an edge in common.

arxiv: v1 [math.co] 15 Dec 2009

APCS-AB: Java. Recursion in Java December 12, week14 1

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

Cache-Oblivious Traversals of an Array s Pairs

A Reduction of Conway s Thrackle Conjecture

CLASSIFICATION OF SURFACES

The transition: Each student passes half his store of candies to the right. students with an odd number of candies eat one.

Assignment 4 Solutions of graph problems

Lecture 15: The subspace topology, Closed sets

1. Chapter 1, # 1: Prove that for all sets A, B, C, the formula

Pick s Theorem! Finding the area of polygons on a square lattice grid.

Grey Codes in Black and White

Transcription:

CSE 20 DISCRETE MATH WINTER 2016 http://cseweb.ucsd.edu/classes/wi16/cse20-ab/

Today's learning goals Explain the steps in a proof by (strong) mathematical induction Use (strong) mathematical induction to prove correctness of identities and inequalities properties of algorithms properties of geometric constructions Apply recursive definitions of sets to determine membership in the set Use structural induction to prove properties of recursively defined sets

Induction: a road map Thursday What is a proof by induction? Examples: inequalities, algorithms, constructions Today Recursive definitions: functions, sets, sigma notation Strong induction More examples / proofs: identities, constructions

A new proof strategy Rosen p. 311 To show that some statement P(k) is true about all nonnegative integers k, 1. Show that it s true about 0 i.e. P(0) 2. Show P(0) à P(1) Hence conclude P(1) 3. Show P(1) à P(2) Hence conclude P(2) 4. Show P(2) à P(3) Hence conclude P(3) 5... Need both for induction to be applicable

Mathematical induction Rosen p. 311 To show that some statement P(k) is true about all nonnegative integers k, 1. Show that it s true about 0 i.e. P(0) 2. Show 8k( P(k)! P (k + 1) ) Hence conclude P(1),

Robot Start at origin, moves on infinite 2-dimensional integer grid. At each step, move to diagonally adjacent grid point. Can it ever reach (1,0)?

Robot Lemma (Invariant): The sum of the coordinates of any state reachable by the robot is even. Proof of Lemma: by mathematical induction on the number of steps. Using proof: Sum of coordinates of (1,0) is 1 so not even!

Recursive definitions Rosen Sec 5.3 Define a set S by { } { x P(x) } Recursive definition: Induction: every positive integer can be reached by starting at 1 and adding 1 finitely many times Basis step Specify initial collection of elements. Recursive step Provide rules for forming new elements in the set from those already known to be in the set.

Recursive definitions Rosen Sec 5.3 Let S be the subset of the set of integers defined recursively by Basis step: Recursive step: If, then. What's an equivalent description of this set? A. All positive multiples of 2. B. All positive even integers. C. All positive odd integers. D. All integers. E. None of the above.

Recursive definitions Rosen Sec 5.3 The set of binary strings {0,1} * is defined recursively by Basis step: where is the empty string. Recursive step: If, then and. Which of the following are not binary strings? A. B. 1 C. 000 D. 010101 E. 101100111000111100001111100000111

Structural induction Rosen p. 354 To show that some statement P(k) is true about all elements of a recursively defined set S, 1. Show that it's true for each element specified in the basis step to be part of S. 2. Show that if it's true for each of the elements used to construct new elements in recursive step, then it holds for these new elements.

Structural Induction, example Rosen Sec 5.3 Define the subset S of binary strings {0,1} * by Basis step: where is the empty string. Recursive step: If, then each of How many elements of S have been specified after the basis step, plus at most one application of the recursive step? A. 1 B. 7 C. 6 D. 3 E. None of the above

Structural Induction, example Rosen Sec 5.3 Define the subset S of binary strings {0,1} * by Basis step: where is the empty string. Recursive step: If, then each of Claim: Every element in S has an equal number of 0s and 1s.

Structural Induction, example Rosen Sec 5.3 Define the subset S of binary strings {0,1} * by Basis step: where is the empty string. Recursive step: If, then each of Claim: Every element in S has an equal number of 0s and 1s. Proof: Basis step WTS that empty string has equal # of 0s and 1s Recursive step Let w be an arbitrary element of S. Assume, as the IH that w has equal # of 0s and 1s. WTS that 10w, 1w0, w10, 01w, 0w1, w01 each have equal # of 0s, 1s.

Recursive definitions, part 2 Rosen Sec 5.3 For functions f: N à X - define by a (closed-form) formula or Sequences are functions too!

Recursive definitions, part 2 Rosen Sec 5.3 For functions f: N à X - define by a (closed-form) formula or Sequences are functions too! Basis step: Specify the value of the function at 0 Recursive step: Give a rule for finding its value at an integer from its values at smaller integers Which of the following functions / sequences have recursive definitions? A. n! D. B. 2 n nx (i 2 + i) C. 2, -8, 32, -128, 512, E. All of the above. i=1

Recursive definitions, part 2 Rosen Sec 5.3 n! 0! = 1, n! = n (n-1)! for n > 0. 2 n 2 0 = 1, 2 n = 2 (2 n-1 ) for n > 0. 2, -8, 32, -128, 512, a 0 = 2, a n = -4 a n-1 for n > 0.,, and for n>1.

An identity Theorem: The sum of the first n positive integers is

An identity Theorem: The sum of the first n positive integers is Proof: by Mathematical Induction. 1. Basis step WTS 2. Inductive hypothesis Let k be a positive integer. Assume 3. Induction step WTS

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. A. The first player has a strategy to always win. B. The second player has a strategy to always win. C. One of the players has a strategy to always win, but which player depends on how many jellybeans there are. D. Who wins is random. E. None of the above.

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. n=1 Who wins?

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. n=2 Who wins?

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. A. The first player has a strategy to always win. B. The second player has a strategy to always win. C. One of the players has a strategy to always win, but which player depends on how many jellybeans there are. D. Who wins is random. E. None of the above.

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. Idea: 2 nd player takes the same amount 1 st player took but from opposite pile. Game reduces to same setup but with fewer jellybeans.

Strong induction Rosen p. 334 To show that some statement P(n) is true about all positive integers n, 1. Verify that P(1) is true. 2. Let k be an arbitrary positive integer. Show that is true. Strong induction hypothesis

Nim Two players take turns removing any positive # of jellybeans at a time from one of two piles in front of them. The piles start out with equal #s. The player who removes the last jellybean wins the game. Theorem: the second player can always guarantee a wing. Proof: By Strong Mathematical Induction, on # jellybeans in each pile. 1. Basis step WTS if piles each have 1, then 2 nd player can win. 2. Strong Induction hypothesis Let k be a positive integer. Assume that 2 nd player can win whenever there are j jellybeans in each pile, for each j between 1 and k (inclusive). 3. Induction step WTS 2 nd player has winning strategy when start with k+1 jellybeans in each pile.

Fibonacci numbers Rosen p. 158, 347 Theorem: For each integer n>=2, f n >= 2 n-2.. Proof: By Strong Mathematical Induction, on n>=2. 1. Basis step WTS f 2 >= 2 0. 2. Strong Induction hypothesis Let k be a positive integer. Assume inequality is true for each earlier Fibonacci term. 3. Induction step WTS statement is true about f k.

Shapes Place squares so that each new square shares an edge with at least one previously-placed square and no squares overlap. Each side of each square has length 1. Use mathematical induction on the number of squares to prove that the perimeter of the shape (length of the boundary) is always even, no matter how many squares are placed or how they are arranged.