cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Size: px
Start display at page:

Download "cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska"

Transcription

1 cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

2 LECTURE 1

3 INTRODUCTION

4 Course Web Page cse547 The webpage contains: detailed lectures notes slides; very detailed solutions to homework problems; some previous tests; all to be used for study

5 Course Text Book Concrete Mathematics A Foundations for Computer Science R. Graham, D. Knuth, O. Patachnik Course has been taught annually at Stanford University since 1970 and we will follow the book very closely We use this book for part one of our course

6 Course Part 2 Abstract (Discrete) Mathematics Concrete Mathematics book was intended and written as an antidote to what authors call Abstract Mathematics. Abstract Mathematics is now called Discrete Mathematics. It was developed as Foundations of Mathematics and plays crucial role in building the Foundations of Computer Science. Discrete Mathematics approach includes development of Set Theory, Boolean Algebras, Model Theory, and Modern Classical and Non-classical Logics. We will introduce some basic notions of the classical Discrete Mathematics and use for that part our own Lecture Notes and sets of problems.

7 What is Concrete Mathematic? Book Definition Concrete Mathematics is a controlled manipulation of (some ) mathematical formulas using a collection of techniques for solving problems We will learn techniques to evaluate horrendously looking sums, to solve complex recurrences, manipulations methods. The original text of the book was an extension of the chapter Mathematical Preliminaries of Knuth s classic book Art of Computer Programming

8 Concrete Mathematics and Abstract (Discrete) Mathematics Concrete Mathematics (Foundations 1) is supposed (and hopefully will) to help you in the art of writing programs Abstract Mathematics (Foundations 2) is supposed (and hopefully will) to help you to think about the art and correctness of programming

9 CHAPTER 1 Recurrent Problems Three examples: Tower of Hanoi Lines in the plane Josephus Problem Recurrent Problems in General: we follow the following steps Abstraction: mathematical model for a problem Recursion: find a recurrent formula Closed Form Formula: find it for the recurrent one (if exists) and prove their equivalency

10 CHAPTER 1 PART ONE: Tower of Hanoi

11 The Tower of Hanoi Tower of Hanoi puzzle is attributed to the French mathematician Edouard Lucas, who came up with it in His formulation involved three pegs and eight distinctly-sized disks stacked on one of the pegs from the biggest on the bottom to the smallest on the top, like so:

12 The GOAL The puzzle goal is to move the stack of disks to one of the other pegs with the following rule: L - rule: must move one disk at a time; a larger disk cannot be on top of any smaller disks at any time do it in as few moves as possible Lucas furnished his puzzle with a romantic legend about Tower of Brahma (64 disks) with monks, gold, diamond needles etc...

13 The Tower of Hanoi GENERALIZED Tower has now n disks, all stacked in decreasing order from bottom to top on one of three pegs, Question: what is the minimum number of (legal) moves needed to move the stack to one of the other pegs? Plan: 1. we start by expressing the minimum number of moves required to move a stack of n disks as a recurrence relation, i.e. find and prove a recursive (recurrent) formula 2. we find a closed-form formula for the minimum number of moves required; 3. we prove that the closed-form and recurrent formulas are equivalent

14 The Tower of Hanoi GENERALIZED to n disks We denote by T n - the minimum number of moves that will transfer n disks from one peg to another under the L - rule: must move one disk at a time; a larger disk cannot be on top of any smaller disks at any time do it in as few moves as possible n = 1 - we have 1 disk- and 1 move, i.e. T 1 = 1 n = 2 - we have 2 disks- and 3 moves: top (smaller) disk from peg 1 to peg 2, remaining (larger) disk from peg 1 to peg 3, the disk from peg 2 (smaller) on the top of the disk (larger) on peg 3 so L - rule holds and hence T 2 = 3

15 A Strategy for n = 3 disks 1. transfer top 2 disks as in previous case for n = 2 we use T 2 moves; 2. move remaining (largest) disk to empty peg we use 1 move; 3. bring the 2 disks to the top of the largest disk as in previous case for n = 2 we use T 2 moves; together we have T 2 + T = = 7 moves

16 Recurrent Strategy to evaluate T n 1. In order to move the bottom disk, we need to move all the n 1 disks above it to a empty peg first 2. Then we can move the bottom disk to the remaining empty peg, and 3. move the n 1 smaller disks back on top of it

17 Recurrent Strategy to evaluate T n 1. we move all the n 1 disks above bottom disk to a different (empty) peg - we do it in T n 1 moves; 2. we move the bottom disk to the remaining empty peg - we do it in 1 moves 3. we move n 1 disks from peg resulting in 1. to the peg resulting in 2. - another T n 1 moves; How many moves? together we have at most T n 1 + T n = 2T n moves i.e we have that T n 2T n 1 + 1, where n 1

18 Recursive Formula for T n We have proven that T n 2T n We show (next slide) that there is no better way, i.e. that T n 2T n and hence we get the Recursive Formula that gives us the solution for the minimum number of moves T n required to move a tower with n disks to another peg. 0, if n = 0; T n = 2T n 1 + 1, if n > 0.

19 Recursive Formula for T n - end of the proof Observe that in order to move the largest bottom disk anywhere, we have to first get the n 1 smaller disks on top of it onto one of the other pegs. This will take at least T n 1 moves. Once this is done, we have to move the bottom disk at least once; we may move it more than once! After we re done moving the bottom disk, we have to move the n 1 other disks back on top of it eventually, which will take again at least T n 1 moves; all together we get that T n 2T n and hence we proved our Recursive Formula 0, if n = 0; T n = 2T n 1 + 1, if n > 0.

20 From Recursive Formula to Closed Form Formula Often the problem with a recurrent solution is in its computational complexity; Observe that for any recursive formula R n, in order to calculate its value for a certain n one needs to calculate (recursively) all values for R k, k = 1,..., n 1. It s easy to see that for large n, this can be quite complex. So we would like to find (if possible) a non- recursive function with a formula f(n), Such formula is called a Closed Form Formula Provided that the Closed Form Formula computes the same function as our original recursive one.

21 From Recursive Formula to Closed Form Formula A big part of the course is to examine classes of Recursive Formula functions for which it is possible to find corresponding equivalent Closed Form Formula function. Of course we have always prove that Recursive Formula functions and Closed Form Formula functions we have found are equal, i.e. their corresponding formulas are equivalent.

22 Definition of Equality of Functions Given two functions f and g such that f : A B and g : A B we say that f and g are equal, or their formulas are equivalent and write symbolically as f = g if and only if f(a) = g(a), for all a A, i.e. a A f(a) = g(a)

23 Proving Equality of Functions Observe that when the domain of f and g are natural numbers N (or a subset of N), i.e. f : N B and g : N B then proving that they are equal, or their formulas are equivalent means proving that n N f(n) = g(n) We usually carry such proofs by Mathematical Induction over the common domain of both functions.

24 Back to Tower of Hanoi We proved that the solution for the Tower of Hanoi is given by a Recursive Formula 0, if n = 0; T n = 2T n 1 + 1, if n > 0. Mathematically it means that we have defined a function such that T : N N T(0) = 0, T(n) = 2T(n 1) + 1, for all n > 0

25 From Recursive Formula to Closed Form Formula For functions with natural numbers N as the domain we use, as in a case of any sequences a notation T(n) = T n We write our recursively defined function T : N N T(0) = 0, T(n) = 2T(n 1) + 1, for all n > 0 as T 0 = 0, T n = 2T n 1 + 1, for all n > 0 and call it, for short a recursive formula Our goal now is to find a Closed Form Formula equivalent to the obove recursive formula One way to get such a solution is to first come up with a guess, and then prove that the guess is in fact a correct solution

26 From Recursive Formula to Closed Form Formula Given our Recursive Formula RF : T 0 = 0, T n = 2T n 1 + 1, for n > 0 We evaluate few values for T n : T 0 = 0, T 1 = 1, T 2 = 3, T 3 = 7, T 4 = 15, T 5 = 31, T 6 = 63,... It is easy to observe that values of T n follows the pattern T n = 2 n 1, for all n 0 We hence guess that T n = 2 n 1 is a Closed Form Formula CF equivalent to our Recursive Formula RF.

27 Proving RF = CF We use, after the book, that same name (in this case T n ) for both functions representing Recursive Formula RF and Closed Form Formula CF. We distinguish them here and in the future investigations by using different colors and notation: RF and CF, respectively. As both functions has the natural numbers N as their common domain, we carry the proof here (and in the future investigations) by Mathematical Induction over the domain of the functions (always a subset of N).

28 Proof of RF = CF for Tower of Hanoi Solution RF: T 0 = 0, T n = 2T n 1 + 1, n > 0 CF: T n = 2 n 1, n 0 We prove by Mathematical Induction that RF = CF, i.e. that Base Case n = 0 n N T n = T n = 2 n 1 We verify: T 0 = 0, T 0 = = 0 and we get that Base Case is true: T 0 = T 0

29 Proof of RF = CF for Tower of Hanoi Solution RF: T 0 = 0, T n = 2T n 1 + 1, n > 0 CF: T n = 2 n 1, n 0 Inductive Assumption: T n 1 = T n 1 = 2 n 1 1 Inductive Thesis: T n = T n = 2 n 1 Proof: T k = def 2T k = ind 2(2 k 1 1) + 1 = 2 k = 2 k 1 = T k

30 Another Proof of RF = CF for Tower of Hanoi Solution Here is an interesting way to find a closed-form solution without having to guess that the solution is T n = 2 n 1. Consider what happens when we add 1 to the recursive formula RF 1, if n = 0; T n + 1 = 2T n = 2(T n 1 + 1), if n > 0. Now, letting U n = T n + 1, we get the following recurrence: 1, if n = 0; U n = 2U n 1, if n > 0. It s pretty easy (in any case easier than for the T n ) to see that the solution (proof by Mathematical Induction) to this recurrence is U n = 2 n. Since U n = T n + 1, we get T n = U n 1 = 2 n 1.

31 CHAPTER 1 PART TWO: Lines in Plane

32 Lines in the Plane The problem of Lines in the Plane was posed by JACOB STEINER, Swiss mathematician in 1826 PROBLEM: what s the maximum number of regions L n that can be defined in the plane by n lines? For n = 0, it s easy to see that there s only one region i.e. L 0 = 1. For n = 1 there re two regions no matter how the line s oriented - L 1 = 2.

33 Lines in the Plane If n = 2, then the maximum number of regions we can define is L 2 = 4 Four regions is the best we can do with two lines because the lines must either cross or not cross; if they cross, then the lines define four regions, and if they don t cross they define three.

34 Lines in the Plane Since we have L 0 = 1, L 1 = 2, and L 2 = 4, one might be led to conjecture that L n = 2 n. This immediately breaks down when we consider 3 lines - n = 3. No matter how the third line is placed, we can only split at most three pre-existing regions, i.e. we can add at most three new regions using the third line and L 3 = 7

35 Lines in the Plane The argument for n = 3 can be generalized as follows. Suppose that n 1 lines have already been drawn. First of all, note that adding a new line adds k new regions if and only if the new line crosses k of the old regions. Also, the new line crosses k of the old regions if and only if it hits the old lines in k 1 different places

36 Lines in the Plane Observe that if the new line crosses k old regions, then since each of the old regions is bounded by an old line, the new line must have hit k 1 boundaries, i.e. k 1 old lines. Conversely, if the new line hits k 1 of the old lines, then pick a direction along the new line and start from infinitely far away and proceed towards the first hit encountered in that direction. Each time the new line crosses an old line, the new line crosses into a new region. Hence after k 1 hits the new line has crossed over from the first old region into k 1 other old regions, i.e. the total number of regions the new line lies in is 1 + k 1 = k.

37 Recurrent Solution RF Since two lines can intersect in at most one point, the new line can hit the n 1 old lines in at most n 1 distinct points. This means that adding a new line can add at most n regions, i.e. we have that L n L n 1 + n, for n > 0.

38 Recursive Formula RF Actually, we also have One can argue it as follows. First, suppose n = 1 L n L n 1 + n, for n > 0. Then the inequality holds (trivially), since L 1 = 1 = = L Next, suppose we ve already drawn n 1 lines in a way that defines L n 1 regions. Note that if we were to draw the n th line such that it s parallel to one of the old lines, then we d miss out on intersecting that line; hence draw the n th line such that it is not parallel to any of the n 1 old lines.

39 Recursive Formula RF Also, we make sure that the new line doesn t intersect two old lines at the same point, i.e. it doesn t hit any intersection points between the old lines. A new line placed in this way then hits n 1 old lines inn 1 distinct points, which means that the new line has added n new regions to L n 1, i.e we proved that L n L n 1 + n and L n L n 1 + n. Hence we have the following recurrent solution RF to the problem: 1 if n = 0; L n = L n 1 + n if n > 0.

40 From RF to Closed Form Formula CF For our recursive formula RF, i.e. a function L : N N defined by a recursive formula RF L(0) = L 0 = 0, L(n) = L n = L n 1 + n we evaluate now its first few terms: L 0 = 1, L 1 = 2, L 2 = 4, L 3 = 7, L 4 = 11, L 5 = 16,... It is hard to see a general pattern based on first few terms, so we now try unfolding the recurrent solution RF instead.

41 From RF to Closed Form Formula CF L n = L n 1 + n = L n 2 + (n 1) + n = L n 3 + (n 2) + (n 1) + n. = L (n 2) + (n 1) + n n = 1 + i i=1 n(n + 1) =

42 Proof: RF = CF We prove by Mathematical Induction that for all n N, n(n + 1) L n = L n = BASE STEP: n = 0 L 0 = 1 and L 0 = 1 + 0(0+1) 2 = 1, and L 0 = L 0

43 Proof: RF = CF INDUCTIVE ASSUMPTION: L k = L k = 1 + k(k+1) 2, for all k = 1, 2,..., n 1 INDUCTIVE THESIS: L n = L n = 1 + n(n+1) 2 OBSERVE that we use here a different FORM of Mathematical Induction then the last time!

44 Proof: RF = CF PROOF: L n = def L n 1 + n = ind (n 1)n n 2 = n2 1 2 n + n = n n n(n + 1) = = L n

45 Using Lines with a Single Bend Let s now consider a slight variation of the original problem What happens if instead of using lines, we use lines with a single bend in them Remark: in the following investigations we will use term bent line for a line with a single bend

46 Using Lines with a Single Bend Problem What is the maximum number of regions Z n can be defined with n bent lines? in the plane that Intuitively, we can get more regions with fewer lines, because the bend can capture extra regions; for example, Z 2 = 7

47 Recurrent Formula Z n A key observation: a single bent line is like two intersecting straight lines, except that the parts of the lines on one side of their intersection have been chopped off. Hence, for example, the maximum number of regions that can be defined using a single bent line is equal to L 2 2, where L n is the maximum number of regions that can be defined using two straight lines, and n = 2 It turns out (see pg. 8 and Exercise 18 in Chapter 1) that the recurrent formula RF is Z n = L 2n 2n, for n 0.

48 Closed Form Formula Z n We use the closed-form solution we got for L n and get the following the closed form solution Z n Z n = RF L 2n 2n = CF 2n(2n + 1) 1 + 2n 2 = 2n 2 n + 1 = Z n

49 L n and Z n Observe that for large n, since the dominating term in L n is 1 2 n2 and the dominating term in Z n is 2n 2, we can get about 2 1/2 = 4 times as many regions using bent lines compared to using straight lines.

MI 4 Mathematical Induction Name. Mathematical Induction

MI 4 Mathematical Induction Name. Mathematical Induction Mathematical Induction It turns out that the most efficient solution to the Towers of Hanoi problem with n disks takes n 1 moves. If this isn t the formula you determined, make sure to check your data

More information

Recurrent Problems. ITT9131 Konkreetne Matemaatika. Chapter One The Tower of Hanoi Lines in the Plane The Josephus Problem

Recurrent Problems. ITT9131 Konkreetne Matemaatika. Chapter One The Tower of Hanoi Lines in the Plane The Josephus Problem Recurrent Problems ITT93 Konkreetne Matemaatika Chapter One The Tower of Hanoi Lines in the Plane The Josephus Problem Contents The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo:

More information

Appendix G: Mathematical Induction

Appendix G: Mathematical Induction Appendix G: Mathematical Induction Introduction In this appendix, you will study a form of mathematical proof called mathematical induction. To see the logical need for mathematical induction, take another

More information

Advanced Counting Techniques. Chapter 8

Advanced Counting Techniques. Chapter 8 Advanced Counting Techniques Chapter 8 Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence Relations Nonhomogeneous Recurrence Relations Divide-and-Conquer

More information

Binomial Coefficient Identities/Complements

Binomial Coefficient Identities/Complements Binomial Coefficient Identities/Complements CSE21 Fall 2017, Day 4 Oct 6, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ permutation P(n,r) = n(n-1) (n-2) (n-r+1) = Terminology

More information

Recursion: Introduction and Correctness

Recursion: Introduction and Correctness Recursion: Introduction and Correctness CSE21 Winter 2017, Day 7 (B00), Day 4-5 (A00) January 25, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Today s Plan From last time: intersecting sorted lists and

More information

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska LECTURE 2 CHAPTER 1 PART THREE: The Josephus Problem Flavius Josephus - historian of 1st century Josephus Story: During Jewish-Roman war

More information

SOLVING LINEAR RECURRENCE RELATIONS

SOLVING LINEAR RECURRENCE RELATIONS SOLVING LINEAR RECURRENCE RELATIONS Schaum's outline Sec. 6.6 6.9 Rosen Sec. 8.1 8. November 9, 017 margarita.spitsakova@ttu.ee ICY0001: Lecture 8 November 9, 017 1 / 47 Contents 1 Motivation examples

More information

Advanced Counting Techniques

Advanced Counting Techniques . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Advanced Counting

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/ SECTION 5.6 Defining Sequences Recursively Copyright Cengage Learning. All rights reserved.

More information

6.042/18.062J Mathematics for Computer Science March 17, 2005 Srini Devadas and Eric Lehman. Recurrences

6.042/18.062J Mathematics for Computer Science March 17, 2005 Srini Devadas and Eric Lehman. Recurrences 6.04/8.06J Mathematics for Computer Science March 7, 00 Srini Devadas and Eric Lehman Lecture Notes Recurrences Recursion breaking an object down into smaller objects of the same type is a major theme

More information

Part III, Sequences and Series CS131 Mathematics for Computer Scientists II Note 16 RECURRENCES

Part III, Sequences and Series CS131 Mathematics for Computer Scientists II Note 16 RECURRENCES CS131 Part III, Sequences and Series CS131 Mathematics for Computer Scientists II Note 16 RECURRENCES A recurrence is a rule which defines each term of a sequence using the preceding terms. The Fibonacci

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

1 Sequences and Summation

1 Sequences and Summation 1 Sequences and Summation A sequence is a function whose domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. For example, a m, a m+1,...,

More information

Chapter 8: Recursion. March 10, 2008

Chapter 8: Recursion. March 10, 2008 Chapter 8: Recursion March 10, 2008 Outline 1 8.1 Recursively Defined Sequences 2 8.2 Solving Recurrence Relations by Iteration 3 8.4 General Recursive Definitions Recursively Defined Sequences As mentioned

More information

Lecture 12 : Recurrences DRAFT

Lecture 12 : Recurrences DRAFT CS/Math 240: Introduction to Discrete Mathematics 3/1/2011 Lecture 12 : Recurrences Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last few classes we talked about program correctness. We

More information

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models Contents Mathematical Reasoning 3.1 Mathematical Models........................... 3. Mathematical Proof............................ 4..1 Structure of Proofs........................ 4.. Direct Method..........................

More information

4.1 Induction: An informal introduction

4.1 Induction: An informal introduction Chapter 4 Induction and Recursion 4.1 Induction: An informal introduction This section is intended as a somewhat informal introduction to The Principle of Mathematical Induction (PMI): a theorem that establishes

More information

3.1 Induction: An informal introduction

3.1 Induction: An informal introduction Chapter 3 Induction and Recursion 3.1 Induction: An informal introduction This section is intended as a somewhat informal introduction to The Principle of Mathematical Induction (PMI): a theorem that establishes

More information

Chapter12. Relations, Functions, and Induction

Chapter12. Relations, Functions, and Induction . Relations. Functions. Seuences.4 Mathematical Induction.5 Recurrence Relations Chapter Review Chapter Relations, Functions, and Induction In this chapter we introduce the concepts of a relation and a

More information

CS1800: Mathematical Induction. Professor Kevin Gold

CS1800: Mathematical Induction. Professor Kevin Gold CS1800: Mathematical Induction Professor Kevin Gold Induction: Used to Prove Patterns Just Keep Going For an algorithm, we may want to prove that it just keeps working, no matter how big the input size

More information

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3 EECS 70 Discrete Mathematics and Probability Theory Spring 014 Anant Sahai Note 3 Induction Induction is an extremely powerful tool in mathematics. It is a way of proving propositions that hold for all

More information

Cpt S 223. School of EECS, WSU

Cpt S 223. School of EECS, WSU Math Review 1 Why do we need math in a data structures course? To nalyze data structures and algorithms Deriving formulae for time and memory requirements Will the solution scale? Quantify the results

More information

What is proof? Lesson 1

What is proof? Lesson 1 What is proof? Lesson The topic for this Math Explorer Club is mathematical proof. In this post we will go over what was covered in the first session. The word proof is a normal English word that you might

More information

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality Math 336-Modern Algebra Lecture 08 9/26/4. Cardinality I started talking about cardinality last time, and you did some stuff with it in the Homework, so let s continue. I said that two sets have the same

More information

Reductions, Recursion and Divide and Conquer

Reductions, Recursion and Divide and Conquer Chapter 5 Reductions, Recursion and Divide and Conquer CS 473: Fundamental Algorithms, Fall 2011 September 13, 2011 5.1 Reductions and Recursion 5.1.0.1 Reduction Reducing problem A to problem B: (A) Algorithm

More information

Math Circle: Recursion and Induction

Math Circle: Recursion and Induction Math Circle: Recursion and Induction Prof. Wickerhauser 1 Recursion What can we compute, using only simple formulas and rules that everyone can understand? 1. Let us use N to denote the set of counting

More information

Math 110, Spring 2015: Midterm Solutions

Math 110, Spring 2015: Midterm Solutions Math 11, Spring 215: Midterm Solutions These are not intended as model answers ; in many cases far more explanation is provided than would be necessary to receive full credit. The goal here is to make

More information

Linear Recurrence Relations

Linear Recurrence Relations Linear Recurrence Relations Linear Homogeneous Recurrence Relations The Towers of Hanoi According to legend, there is a temple in Hanoi with three posts and 64 gold disks of different sizes. Each disk

More information

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

At the start of the term, we saw the following formula for computing the sum of the first n integers: Chapter 11 Induction This chapter covers mathematical induction. 11.1 Introduction to induction At the start of the term, we saw the following formula for computing the sum of the first n integers: Claim

More information

Main topics for the First Midterm Exam

Main topics for the First Midterm Exam Main topics for the First Midterm Exam The final will cover Sections.-.0, 2.-2.5, and 4.. This is roughly the material from first three homeworks and three quizzes, in addition to the lecture on Monday,

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 3 CHAPTER 1 SETS, RELATIONS, and LANGUAGES 6. Closures and Algorithms 7. Alphabets and Languages 8. Finite Representation

More information

One-to-one functions and onto functions

One-to-one functions and onto functions MA 3362 Lecture 7 - One-to-one and Onto Wednesday, October 22, 2008. Objectives: Formalize definitions of one-to-one and onto One-to-one functions and onto functions At the level of set theory, there are

More information

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.

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. 11 Recurrences A recurrence equation or recurrence counts things using recursion. 11.1 Recurrence Equations We start with an example. Example 11.1. Find a recurrence for S(n), the number of subsets of

More information

Why do we need math in a data structures course?

Why do we need math in a data structures course? Math Review 1 Why do we need math in a data structures course? To nalyze data structures and algorithms Deriving formulae for time and memory requirements Will the solution scale? Quantify the results

More information

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

CSCE 222 Discrete Structures for Computing. Review for Exam 2. Dr. Hyunyoung Lee !!! CSCE 222 Discrete Structures for Computing Review for Exam 2 Dr. Hyunyoung Lee 1 Strategy for Exam Preparation - Start studying now (unless have already started) - Study class notes (lecture slides and

More information

CHAPTER 4 SOME METHODS OF PROOF

CHAPTER 4 SOME METHODS OF PROOF CHAPTER 4 SOME METHODS OF PROOF In all sciences, general theories usually arise from a number of observations. In the experimental sciences, the validity of the theories can only be tested by carefully

More information

Discrete Mathematics. Spring 2017

Discrete Mathematics. Spring 2017 Discrete Mathematics Spring 2017 Previous Lecture Principle of Mathematical Induction Mathematical Induction: rule of inference Mathematical Induction: Conjecturing and Proving Climbing an Infinite Ladder

More information

Polynomial one or more monomials added or subtracted. (i.e. : 5x or 6xy-3 or 6xy - 5x + 3 or

Polynomial one or more monomials added or subtracted. (i.e. : 5x or 6xy-3 or 6xy - 5x + 3 or Polynomials Necessary Terms for Success Welcome back! We will now tackle the world of polynomials. Before we get started with performing operations or using polynomials for applications, we will need some

More information

Lecture 6 : Induction DRAFT

Lecture 6 : Induction DRAFT CS/Math 40: Introduction to Discrete Mathematics /8/011 Lecture 6 : Induction Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we began discussing proofs. We mentioned some proof

More information

MAC-CPTM Situations Project

MAC-CPTM Situations Project Prompt MAC-CPTM Situations Project Situation 51: Proof by Mathematical Induction Prepared at the University of Georgia Center for Proficiency in Teaching Mathematics 13 October 2006-Erik Tillema 22 February

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1 CS 70 Discrete Mathematics and Probability Theory Fall 013 Vazirani Note 1 Induction Induction is a basic, powerful and widely used proof technique. It is one of the most common techniques for analyzing

More information

Notes on ordinals and cardinals

Notes on ordinals and cardinals Notes on ordinals and cardinals Reed Solomon 1 Background Terminology We will use the following notation for the common number systems: N = {0, 1, 2,...} = the natural numbers Z = {..., 2, 1, 0, 1, 2,...}

More information

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

I. Induction. Po-Shen Loh June 16, 2003 I. Induction Po-Shen Loh June 16, 2003 1 News Flash From Zuming! Remind Po to take all the markers from CBA 337 Tonight s study session for Red/Blue is in Bessey 104 Future Red lectures are in NM B-7,

More information

What can you prove by induction?

What can you prove by induction? MEI CONFERENCE 013 What can you prove by induction? Martyn Parker M.J.Parker@keele.ac.uk Contents Contents iii 1 Splitting Coins.................................................. 1 Convex Polygons................................................

More information

Lecture 3: Sizes of Infinity

Lecture 3: Sizes of Infinity Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 3: Sizes of Infinity Week 2 UCSB 204 Sizes of Infinity On one hand, we know that the real numbers contain more elements than the rational

More information

Divide and Conquer. Recurrence Relations

Divide and Conquer. Recurrence Relations Divide and Conquer Recurrence Relations Divide-and-Conquer Strategy: Break up problem into parts. Solve each part recursively. Combine solutions to sub-problems into overall solution. 2 MergeSort Mergesort.

More information

CS 2110: INDUCTION DISCUSSION TOPICS

CS 2110: INDUCTION DISCUSSION TOPICS CS 110: INDUCTION DISCUSSION TOPICS The following ideas are suggestions for how to handle your discussion classes. You can do as much or as little of this as you want. You can either present at the board,

More information

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

Preparing for the CS 173 (A) Fall 2018 Midterm 1 Preparing for the CS 173 (A) Fall 2018 Midterm 1 1 Basic information Midterm 1 is scheduled from 7:15-8:30 PM. We recommend you arrive early so that you can start exactly at 7:15. Exams will be collected

More information

CHAPTER 8 Advanced Counting Techniques

CHAPTER 8 Advanced Counting Techniques 96 Chapter 8 Advanced Counting Techniques CHAPTER 8 Advanced Counting Techniques SECTION 8. Applications of Recurrence Relations 2. a) A permutation of a set with n elements consists of a choice of a first

More information

12 Sequences and Recurrences

12 Sequences and Recurrences 12 Sequences and Recurrences A sequence is just what you think it is. It is often given by a formula known as a recurrence equation. 12.1 Arithmetic and Geometric Progressions An arithmetic progression

More information

Methods for solving recurrences

Methods for solving recurrences Methods for solving recurrences Analyzing the complexity of mergesort The merge function Consider the following implementation: 1 int merge ( int v1, int n1, int v, int n ) { 3 int r = malloc ( ( n1+n

More information

Conjectures and proof. Book page 24-30

Conjectures and proof. Book page 24-30 Conjectures and proof Book page 24-30 What is a conjecture? A conjecture is used to describe a pattern in mathematical terms When a conjecture has been proved, it becomes a theorem There are many types

More information

Math 300: Foundations of Higher Mathematics Northwestern University, Lecture Notes

Math 300: Foundations of Higher Mathematics Northwestern University, Lecture Notes Math 300: Foundations of Higher Mathematics Northwestern University, Lecture Notes Written by Santiago Cañez These are notes which provide a basic summary of each lecture for Math 300, Foundations of Higher

More information

A linear equation in two variables is generally written as follows equation in three variables can be written as

A linear equation in two variables is generally written as follows equation in three variables can be written as System of Equations A system of equations is a set of equations considered simultaneously. In this course, we will discuss systems of equation in two or three variables either linear or quadratic or a

More information

Algorithms Design & Analysis. Analysis of Algorithm

Algorithms Design & Analysis. Analysis of Algorithm Algorithms Design & Analysis Analysis of Algorithm Review Internship Stable Matching Algorithm 2 Outline Time complexity Computation model Asymptotic notions Recurrence Master theorem 3 The problem of

More information

Induction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2

Induction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2 Induction 0-8-08 Induction is used to prove a sequence of statements P(), P(), P(3),... There may be finitely many statements, but often there are infinitely many. For example, consider the statement ++3+

More information

Problem Solving in Math (Math 43900) Fall 2013

Problem Solving in Math (Math 43900) Fall 2013 Problem Solving in Math (Math 43900) Fall 203 Week six (October ) problems recurrences Instructor: David Galvin Definition of a recurrence relation We met recurrences in the induction hand-out. Sometimes

More information

Nondeterministic finite automata

Nondeterministic finite automata Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the

More information

CMSC 132, Object-Oriented Programming II Summer Lecture 10:

CMSC 132, Object-Oriented Programming II Summer Lecture 10: CMSC 132, Object-Oriented Programming II Summer 2016 Lecturer: Anwar Mamat Lecture 10: Disclaimer: These notes may be distributed outside this class only with the permission of the Instructor. 10.1 RECURSION

More information

2 Systems of Linear Equations

2 Systems of Linear Equations 2 Systems of Linear Equations A system of equations of the form or is called a system of linear equations. x + 2y = 7 2x y = 4 5p 6q + r = 4 2p + 3q 5r = 7 6p q + 4r = 2 Definition. An equation involving

More information

University of Sheffield. School of Mathematics & and Statistics. Measure and Probability MAS350/451/6352

University of Sheffield. School of Mathematics & and Statistics. Measure and Probability MAS350/451/6352 University of Sheffield School of Mathematics & and Statistics Measure and Probability MAS350/451/6352 Spring 2018 Chapter 1 Measure Spaces and Measure 1.1 What is Measure? Measure theory is the abstract

More information

An analogy from Calculus: limits

An analogy from Calculus: limits COMP 250 Fall 2018 35 - big O Nov. 30, 2018 We have seen several algorithms in the course, and we have loosely characterized their runtimes in terms of the size n of the input. We say that the algorithm

More information

Lecture 4: Constructing the Integers, Rationals and Reals

Lecture 4: Constructing the Integers, Rationals and Reals Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 4: Constructing the Integers, Rationals and Reals Week 5 UCSB 204 The Integers Normally, using the natural numbers, you can easily define

More information

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska LECTURE 9a CHAPTER 2 SUMS Part 1: Introduction - Lecture 5 Part 2: Sums and Recurrences (1) - Lecture 5 Part 2: Sums and Recurrences (2)

More information

CS1800: Strong Induction. Professor Kevin Gold

CS1800: Strong Induction. Professor Kevin Gold CS1800: Strong Induction Professor Kevin Gold Mini-Primer/Refresher on Unrelated Topic: Limits This is meant to be a problem about reasoning about quantifiers, with a little practice of other skills, too

More information

Discrete Mathematics for CS Spring 2008 David Wagner Note 4

Discrete Mathematics for CS Spring 2008 David Wagner Note 4 CS 70 Discrete Mathematics for CS Spring 008 David Wagner Note 4 Induction Induction is an extremely powerful tool in mathematics. It is a way of proving propositions that hold for all natural numbers,

More information

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

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011 Math 31 Lesson Plan Day 2: Sets; Binary Operations Elizabeth Gillaspy September 23, 2011 Supplies needed: 30 worksheets. Scratch paper? Sign in sheet Goals for myself: Tell them what you re going to tell

More information

Section 7.2: One-to-One, Onto and Inverse Functions

Section 7.2: One-to-One, Onto and Inverse Functions Section 7.2: One-to-One, Onto and Inverse Functions In this section we shall developed the elementary notions of one-to-one, onto and inverse functions, similar to that developed in a basic algebra course.

More information

HOMEWORK #2 - MATH 3260

HOMEWORK #2 - MATH 3260 HOMEWORK # - MATH 36 ASSIGNED: JANUARAY 3, 3 DUE: FEBRUARY 1, AT :3PM 1) a) Give by listing the sequence of vertices 4 Hamiltonian cycles in K 9 no two of which have an edge in common. Solution: Here is

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

More information

MATH 250 TOPIC 13 INTEGRATION. 13B. Constant, Sum, and Difference Rules

MATH 250 TOPIC 13 INTEGRATION. 13B. Constant, Sum, and Difference Rules Math 5 Integration Topic 3 Page MATH 5 TOPIC 3 INTEGRATION 3A. Integration of Common Functions Practice Problems 3B. Constant, Sum, and Difference Rules Practice Problems 3C. Substitution Practice Problems

More information

The Principle of Linearity applications in the areas of algebra and analysis

The Principle of Linearity applications in the areas of algebra and analysis Proseminar Mathematisches Problemlösen University of Karlsruhe SS 6 The Principle of Linearity applications in the areas of algebra and analysis Franziska Häfner Contents Converting complex problems into

More information

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt Lecture 3 The Analysis of Recursive Algorithm Efficiency What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency

More information

MATH 2200 Final LC Review

MATH 2200 Final LC Review MATH 2200 Final LC Review Thomas Goller April 25, 2013 1 Final LC Format The final learning celebration will consist of 12-15 claims to be proven or disproven. It will take place on Wednesday, May 1, from

More information

Learning Objectives

Learning Objectives Learning Objectives Learn about recurrence relations Learn the relationship between sequences and recurrence relations Explore how to solve recurrence relations by iteration Learn about linear homogeneous

More information

Prompt. Commentary. Mathematical Foci

Prompt. Commentary. Mathematical Foci Situation 51: Proof by Mathematical Induction Prepared at the University of Georgia Center for Proficiency in Teaching Mathematics 9/15/06-Erik Tillema 2/22/07-Jeremy Kilpatrick Prompt A teacher of a calculus

More information

Cartesian Products and Relations

Cartesian Products and Relations Cartesian Products and Relations Definition (Cartesian product) If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) : (a A) and (b B)}. The following points are worth special

More information

1 Recursive Algorithms

1 Recursive Algorithms 400 lecture note #8 [ 5.6-5.8] Recurrence Relations 1 Recursive Algorithms A recursive algorithm is an algorithm which invokes itself. A recursive algorithm looks at a problem backward -- the solution

More information

Computational Complexity. This lecture. Notes. Lecture 02 - Basic Complexity Analysis. Tom Kelsey & Susmit Sarkar. Notes

Computational Complexity. This lecture. Notes. Lecture 02 - Basic Complexity Analysis. Tom Kelsey & Susmit Sarkar. Notes Computational Complexity Lecture 02 - Basic Complexity Analysis Tom Kelsey & Susmit Sarkar School of Computer Science University of St Andrews http://www.cs.st-andrews.ac.uk/~tom/ twk@st-andrews.ac.uk

More information

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False.

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False. Math 20 Exam 2 - Practice Problems. For each of the following, determine whether the statement is True or False. (a) {a,b,c,d} TRE (b) {a,b,c,d} FLSE (c) {a,b, } TRE (d) {a,b, } TRE (e) {a,b} {a,b} FLSE

More information

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra.

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. V. Borschev and B. Partee, October 26, 2006 p. 1 Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. 0. Preliminary notes...1 1. Freedom for algebras. Word

More information

Solving recurrences. Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms.

Solving recurrences. Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms. Solving recurrences Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms Example: Merge-Sort(A, p, r) 1: if p < r then 2: q (p + r)/2 3: Merge-Sort(A,

More information

Math 3000 Section 003 Intro to Abstract Math Homework 6

Math 3000 Section 003 Intro to Abstract Math Homework 6 Math 000 Section 00 Intro to Abstract Math Homework 6 Department of Mathematical and Statistical Sciences University of Colorado Denver, Spring 01 Solutions April, 01 Please note that these solutions are

More information

a 2n = . On the other hand, the subsequence a 2n+1 =

a 2n = . On the other hand, the subsequence a 2n+1 = Math 316, Intro to Analysis subsequences. This is another note pack which should last us two days. Recall one of our arguments about why a n = ( 1) n diverges. Consider the subsequence a n = It converges

More information

CONSTRUCTION OF THE REAL NUMBERS.

CONSTRUCTION OF THE REAL NUMBERS. CONSTRUCTION OF THE REAL NUMBERS. IAN KIMING 1. Motivation. It will not come as a big surprise to anyone when I say that we need the real numbers in mathematics. More to the point, we need to be able to

More information

An Application of First-Order Logic to a Problem in Combinatorics 1

An Application of First-Order Logic to a Problem in Combinatorics 1 An Application of First-Order Logic to a Problem in Combinatorics 1 I. The Combinatorial Background. A. Families of objects. In combinatorics, one frequently encounters a set of objects in which a), each

More information

Data Structure Lecture#4: Mathematical Preliminaries U Kang Seoul National University

Data Structure Lecture#4: Mathematical Preliminaries U Kang Seoul National University Data Structure Lecture#4: Mathematical Preliminaries U Kang Seoul National University U Kang 1 In This Lecture Set Concepts and Notation Relation Logarithm and Summations Recurrence Relations Recursion

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Asymptotic Analysis, recurrences Date: 9/7/17 2.1 Notes Homework 1 will be released today, and is due a week from today by the beginning

More information

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

SET THEORY. Disproving an Alleged Set Property. Disproving an Alleged Set. Example 1 Solution CHAPTER 6 CHAPTER 6 SET THEORY SECTION 6.3 Disproofs, Algebraic Proofs, and Boolean Algebras Copyright Cengage Learning. All rights reserved. Copyright Cengage Learning. All rights reserved. Disproving an Alleged

More information

Egyptian Fractions: Part I

Egyptian Fractions: Part I Egyptian Fractions: Part I Prepared by: Eli Jaffe October 8, 2017 1 Cutting Cakes 1. Imagine you are a teacher. Your class of 10 students is on a field trip to the bakery. At the end of the tour, the baker

More information

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Lecture 02 Groups: Subgroups and homomorphism (Refer Slide Time: 00:13) We looked

More information

MATH 22 FUNCTIONS: ORDER OF GROWTH. Lecture O: 10/21/2003. The old order changeth, yielding place to new. Tennyson, Idylls of the King

MATH 22 FUNCTIONS: ORDER OF GROWTH. Lecture O: 10/21/2003. The old order changeth, yielding place to new. Tennyson, Idylls of the King MATH 22 Lecture O: 10/21/2003 FUNCTIONS: ORDER OF GROWTH The old order changeth, yielding place to new. Tennyson, Idylls of the King Men are but children of a larger growth. Dryden, All for Love, Act 4,

More information

Finding Limits Graphically and Numerically

Finding Limits Graphically and Numerically Finding Limits Graphically and Numerically 1. Welcome to finding limits graphically and numerically. My name is Tuesday Johnson and I m a lecturer at the University of Texas El Paso. 2. With each lecture

More information

Reading 5 : Induction

Reading 5 : Induction CS/Math 40: Introduction to Discrete Mathematics Fall 015 Instructors: Beck Hasti and Gautam Prakriya Reading 5 : Induction In the last reading we began discussing proofs. We mentioned some proof paradigms

More information

In case (1) 1 = 0. Then using and from the previous lecture,

In case (1) 1 = 0. Then using and from the previous lecture, Math 316, Intro to Analysis The order of the real numbers. The field axioms are not enough to give R, as an extra credit problem will show. Definition 1. An ordered field F is a field together with a nonempty

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

Error Correcting Codes Prof. Dr. P. Vijay Kumar Department of Electrical Communication Engineering Indian Institute of Science, Bangalore

Error Correcting Codes Prof. Dr. P. Vijay Kumar Department of Electrical Communication Engineering Indian Institute of Science, Bangalore (Refer Slide Time: 00:15) Error Correcting Codes Prof. Dr. P. Vijay Kumar Department of Electrical Communication Engineering Indian Institute of Science, Bangalore Lecture No. # 03 Mathematical Preliminaries:

More information

CHAPTER 1: Functions

CHAPTER 1: Functions CHAPTER 1: Functions 1.1: Functions 1.2: Graphs of Functions 1.3: Basic Graphs and Symmetry 1.4: Transformations 1.5: Piecewise-Defined Functions; Limits and Continuity in Calculus 1.6: Combining Functions

More information

Math 475, Problem Set #8: Answers

Math 475, Problem Set #8: Answers Math 475, Problem Set #8: Answers A. Brualdi, problem, parts (a), (b), and (d). (a): As n goes from to 6, the sum (call it h n ) takes on the values,, 8, 2, 55, and 44; we recognize these as Fibonacci

More information