Recurrent Problems. ITT9131 Konkreetne Matemaatika. Chapter One The Tower of Hanoi Lines in the Plane The Josephus Problem
|
|
- Cora Bradley
- 6 years ago
- Views:
Transcription
1 Recurrent Problems ITT93 Konkreetne Matemaatika Chapter One The Tower of Hanoi Lines in the Plane The Josephus Problem
2 Contents The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo: Structural induction
3 Next section The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo: Structural induction
4 The Tower of Hanoi The Tower of Hanoi puzzle was invented by the French mathematician Edouard Lucas in 883. Using mathematical induction one can prove that For the Tower of Hanoi puzzle with n 0 (and 3 pegs), the minimum number of moves needed T n = n. Let's look at the example borrowed from Martin Hofmann and Berteun Damman.
5 The Tower of Hanoi The Tower of Hanoi puzzle was invented by the French mathematician Edouard Lucas in 883. Using mathematical induction one can prove that For the Tower of Hanoi puzzle with n 0 (and 3 pegs), the minimum number of moves needed T n = n. Let's look at the example borrowed from Martin Hofmann and Berteun Damman.
6 The Tower of Hanoi The Tower of Hanoi puzzle was invented by the French mathematician Edouard Lucas in 883. Using mathematical induction one can prove that For the Tower of Hanoi puzzle with n 0 (and 3 pegs), the minimum number of moves needed T n = n. Let's look at the example borrowed from Martin Hofmann and Berteun Damman.
7 Tower of Hanoi 5 Discs 3 4 5
8 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
9 Tower of Hanoi 5 Discs Moved disc from pole to pole.
10 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
11 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
12 Tower of Hanoi 5 Discs Moved disc from pole to pole.
13 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
14 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
15 Tower of Hanoi 5 Discs Moved disc from pole to pole.
16 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
17 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
18 Tower of Hanoi 5 Discs Moved disc from pole to pole.
19 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
20 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
21 Tower of Hanoi 5 Discs Moved disc from pole to pole.
22 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
23 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
24 Tower of Hanoi 5 Discs Moved disc from pole to pole.
25 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
26 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
27 Tower of Hanoi 5 Discs Moved disc from pole to pole.
28 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
29 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
30 Tower of Hanoi 5 Discs Moved disc from pole to pole.
31 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
32 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
33 Tower of Hanoi 5 Discs Moved disc from pole to pole.
34 Tower of Hanoi 5 Discs Moved disc from pole 3 to pole.
35 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
36 Tower of Hanoi 5 Discs Moved disc from pole to pole.
37 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
38 Tower of Hanoi 5 Discs Moved disc from pole to pole 3.
39 Tower of Hanoi 5 Discs OK 3 4 5
40 A recursive solution in Python #!/ usr /bin /env python3 import os def hanoi (n, start = ' ', step = ' ', stop = '3 ' ): ''' Solve the Hanoi tower with n disks, from start peg to stop peg, using step peg as a spool ''' if n > 0: hanoi (n -, start, stop, step ) move (n, start, stop ) hanoi (n -, step, start, stop ) def move (n, start, stop ): ''' Display move of disk n from start to stop ''' print ( " Disk % d : % s -> % s " % (n, start, stop )) if name == ' main ': n = int ( input ( 'How many disks? ' )) hanoi ( n ) Question: why does this program show that T n = n?
41 A recursive solution in Python #!/ usr /bin /env python3 import os def hanoi (n, start = ' ', step = ' ', stop = '3 ' ): ''' Solve the Hanoi tower with n disks, from start peg to stop peg, using step peg as a spool ''' if n > 0: hanoi (n -, start, stop, step ) move (n, start, stop ) hanoi (n -, step, start, stop ) def move (n, start, stop ): ''' Display move of disk n from start to stop ''' print ( " Disk % d : % s -> % s " % (n, start, stop )) if name == ' main ': n = int ( input ( 'How many disks? ' )) hanoi ( n ) Question: why does this program show that T n = n?
42 Warmup: What is wrong with this proof? Theorem All horses are the same color. Proof The thesis is clearly true for n =, so let n >. Put the n horses on a line. By inductive hypothesis, the n leftmost horses are the same color, and so do the n rightmost horses. Then the n horses in the middle are the same color. The rst and last horse must then be that color. Solution: For n = there are no n horses in the middle.
43 Warmup: What is wrong with this proof? Theorem All horses are the same color. Proof The thesis is clearly true for n =, so let n >. Put the n horses on a line. By inductive hypothesis, the n leftmost horses are the same color, and so do the n rightmost horses. Then the n horses in the middle are the same color. The rst and last horse must then be that color. Solution: For n = there are no n horses in the middle.
44 Next section The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo: Structural induction
45 Lines in the Plane Problem Popularly: How many slices of pizza can a person obtain by making n straight cuts with a pizza knife? Academically: What is the maximum number L n of regions dened by n lines in the plane? Solved rst in 86, by the Swiss mathematician Jacob Steiner.
46 Lines in the Plane small cases V V V L 0 = L = V V V V V 3 V V V 3 V 4 V 4 V 4 L = 4 L 3 = L + 3 = 7
47 Lines in the Plane small cases V V V L 0 = L = V V V V V 3 V V V 3 V 4 V 4 V 4 L = 4 L 3 = L + 3 = 7
48 Lines in the Plane generalization Observation: The n-th line (for n > 0) increases the number of regions by k i it splits k of the "old regions" i it hits the previous lines in k dierent places.
49 Lines in the Plane generalization Observation: The n-th line (for n > 0) increases the number of regions by k i it splits k of the "old regions" i it hits the previous lines in k dierent places.
50 Lines in the Plane generalization Observation: The n-th line (for n > 0) increases the number of regions by k i it splits k of the "old regions" i it hits the previous lines in k dierent places.
51 Lines in the Plane generalization Observation: The n-th line (for n > 0) increases the number of regions by k i it splits k of the "old regions" i it hits the previous lines in k dierent places. k must be less or equal to n. Why?
52 Lines in the Plane generalization Observation: The n-th line (for n > 0) increases the number of regions by k i it splits k of the "old regions" i it hits the previous lines in k dierent places. k = 3; places k = ; places
53 Lines in the Plane generalization () Therefore the new line can intersect the n "old" lines in at most "n- " dierent points, we have established the upper bound L n L n + n for n > 0. If n-th line is not parallel to any of the others (hence it intersects them all), and doesn't go through any of the existing intersection points (hence it intersects them all in dierent places) then we get the recurrent equation: L 0 = ; L n = L n + n for n > 0. n L n
54 Lines in the Plane generalization () Therefore the new line can intersect the n "old" lines in at most "n- " dierent points, we have established the upper bound L n L n + n for n > 0. If n-th line is not parallel to any of the others (hence it intersects them all), and doesn't go through any of the existing intersection points (hence it intersects them all in dierent places) then we get the recurrent equation: L 0 = ; L n = L n + n for n > 0. n L n
55 Lines in the Plane solving recurrence Observation: L n = L n + n = L n + (n ) + n = L n 3 + (n ) + (n ) + n = L (n ) + (n ) + n = + S n, where S n = (n ) + n
56 Lines in the Plane solving recurrence () Evaluation of S n = (n ) + n. Recurrent equation: S 0 = 0; S n = S n + n for n > 0. Solution (Gauss, 786): S n = (n ) + n +S n = n + (n ) S n = (n + ) + (n + ) + + (n + ) + (n + ) S n = n(n + ) n(n + ) S n =
57 Lines in the Plane solving recurrence () Evaluation of S n = (n ) + n. Recurrent equation: S 0 = 0; S n = S n + n for n > 0. Solution (Gauss, 786): S n = (n ) + n +S n = n + (n ) S n = (n + ) + (n + ) + + (n + ) + (n + ) S n = n(n + ) n(n + ) S n =
58 Lines in the Plane solving recurrence () Evaluation of S n = (n ) + n. Recurrent equation: S 0 = 0; S n = S n + n for n > 0. Solution (Gauss, 786): S n = (n ) + n +S n = n + (n ) S n = (n + ) + (n + ) + + (n + ) + (n + ) S n = n(n + ) n(n + ) S n =
59 Lines in the Plane solving recurrence (3) Theorem: Closed formula for L n L n = n(n + ) +, for n > 0. Proof (by induction ). Basis: L 0 = 0(0+) + =. Step: Let assume L n = n(n+) + and evaluate L n+ = L n + n + n(n + ) = + + n + n(n + ) + + n = + n(n + ) + (n + ) = + (n + )(n + ) = +. Q.E.D.
60 Next section The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo: Structural induction
61 The Josephus Problem Legend: During the Jewish-Roman war, Flavius Josephus, a famous historian of the rst century, was among a band of 4 Jewish rebels trapped in a cave by the Romans. Preferring suicide to capture, the rebels decided to form a circle and, proceeding around it, to kill every third remaining person until no one was left. But Josephus, together his friend, wanted to avoid being killed. So he quickly calculated where he and his friend should stand in the vicious circle
62 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
63 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
64 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
65 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
66 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
67 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
68 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
69 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
70 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
71 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
72 The Josephus Problem Our variation of the problem: we start with n people numbered to n around a circle we eliminate every second remaining person until only one survives Task is to compute the survivor's number, J(n) Example, n = The elimination order is, 4, 6, 8, 0, 3, 7,, 9. So, we have J(0) =
73 The Josephus Problem small numbers Evaluate J(n) for small n: n J(n) Properties J(n) is always odd; Recurrent equation J() = ; J(n) = J(n), for n ; J(n + ) = J(n) +, for n. 3 Closed formula J( m + l) = l +, for m 0 and 0 l < m.
74 The Josephus Problem small numbers Evaluate J(n) for small n: n J(n) Properties J(n) is always odd; Recurrent equation J() = ; J(n) = J(n), for n ; J(n + ) = J(n) +, for n. 3 Closed formula J( m + l) = l +, for m 0 and 0 l < m.
75 The Josephus Problem small numbers Evaluate J(n) for small n: n J(n) Properties J(n) is always odd; Recurrent equation J() = ; J(n) = J(n), for n ; J(n + ) = J(n) +, for n. 3 Closed formula J( m + l) = l +, for m 0 and 0 l < m.
76 The Josephus Problem recurrent equation () Case n = m. 0 First trip eliminates all even numbers. Then we change numbers and repeat: Old number k New number k' or k = k That correspondance between "old" and "new numbers" gives us that: J(n) = J(n)
77 The Josephus Problem recurrent equation () Case n = m. 0 First trip eliminates all even numbers. Then we change numbers and repeat: Old number k New number k' or k = k That correspondance between "old" and "new numbers" gives us that: J(n) = J(n)
78 The Josephus Problem recurrent equation () Case n = m +. First trip eliminates all even numbers. Then we change numbers and repeat: Old number k New number k' or k = k + That correspondence between "old" and "new numbers" givs us that: J(n + ) = J(n) +.
79 The Josephus Problem recurrent equation () Case n = m First trip eliminates all even numbers. Then we change numbers and repeat: Old number k New number k' or k = k + That correspondence between "old" and "new numbers" givs us that: J(n + ) = J(n) +.
80 The Josephus Problem application of recurrence The equation J() = ; J(n) = J(n), for n ; J(n + ) = J(n) +, for n. can be used for computing function for large arguments. For example J(86) = J(43) = 53 J(43) = J() + = 7 J() = J() = 3 J() = 7
81 The Josephus Problem closed formula Teoreem J( m + l) = l +, for m 0 and 0 l < m. Proof by induction over m. Basis If m = 0 then also l = 0, and J() = ; Step If m > 0 and m + l = n, then l is even and J( m +l) = J( m +l/) = (l/+) = l+ If m + l = n +, then considering that J(n + ) = + J(n) = + (l ) + = l + Q.E.D.
82 The Josephus Problem closed formula () Closed formula can be used for computing function J(n): Example We have 030 = 0 + 6, so J(030) = 6 + = 3.
83 Next section The Tower of Hanoi Lines in the Plane 3 The Josephus Problem 4 Intermezzo: Structural induction
84 Structural induction Premises Let S be a set having the following features: A set S B of basic cases is contained in S. Finitely many operations u i : S m i S, i =,...,n, exist such that, if x,...,x mi S, then u i (x,...,x mi ) S. 3 Nothing else belongs to S. Technique Let P be a property such that: Each base case x S B has property P. For every i =,...,n and every x,...,x mi S, if each value x,...,x mi has property P, then u i (x,...,x mi ) has property P. Then every element of S has property P.
85 Structural induction Premises Let S be a set having the following features: A set S B of basic cases is contained in S. Finitely many operations u i : S m i S, i =,...,n, exist such that, if x,...,x mi S, then u i (x,...,x mi ) S. 3 Nothing else belongs to S. Technique Let P be a property such that: Each base case x S B has property P. For every i =,...,n and every x,...,x mi S, if each value x,...,x mi has property P, then u i (x,...,x mi ) has property P. Then every element of S has property P.
86 Mathematical induction as a special case of structural induction Premises The set S = N of natural numbers is constructed as follows: A set S B = {0} of basic cases is contained in N. A single operation, the successor, s : N N, exists such that, if n N, then s(n) N. 3 Nothing else belongs to N. Technique Let P be a property such that 0 has property P. For every n N, if n has property P, then s(n) has property P. Then every n N has property P.
87 Mathematical induction as a special case of structural induction Premises The set S = N of natural numbers is constructed as follows: A set S B = {0} of basic cases is contained in N. A single operation, the successor, s : N N, exists such that, if n N, then s(n) N. 3 Nothing else belongs to N. Technique Let P be a property such that 0 has property P. For every n N, if n has property P, then s(n) has property P. Then every n N has property P.
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 informationcse547, 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 informationcse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska
cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska LECTURE 1 INTRODUCTION Course Web Page www.cs.stonybrook.edu/ cse547 The webpage contains: detailed lectures notes slides; very detailed
More informationSEQUENCES, 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 information1 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 informationPart 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 informationChapter 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 informationData 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 Logarithms Summations Recurrence Relations Recursion Induction Proofs
More information5. Sequences & Recursion
5. Sequences & Recursion Terence Sim 1 / 42 A mathematician, like a painter or poet, is a maker of patterns. Reading Sections 5.1 5.4, 5.6 5.8 of Epp. Section 2.10 of Campbell. Godfrey Harold Hardy, 1877
More informationarxiv: v1 [math.co] 30 Mar 2018
A VARIANT ON THE FELINE JOSEPHUS PROBLEM arxiv:1803.340v1 [math.co] 30 Mar 2018 ERIK INSKO AND SHAUN SULLIVAN Abstract. In the Feline Josephus problem, soldiers stand in a circle, each having l lives.
More informationAdvanced 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 informationBinomial 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 informationRecursion: 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 informationAdvanced 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 informationData 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 informationMI 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 informationHandout 7: Recurrences (Cont d)
ENGG 2440B: Discrete Mathematics for Engineers Handout 7: Recurrences (Cont d) 2018 19 First Term Instructor: Anthony Man Cho So October 8, 2018 In the last handout, we studied techniques for solving linear
More informationA sequence is k-automatic if its n th term is generated by a finite state machine with n in base k as the input.
A sequence is k-automatic if its n th term is generated by a finite state machine with n in base k as the input. 1 Examples of automatic sequences The Thue-Morse sequence 011010011001011010010 This sequence
More information6.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 informationSums. ITT9131 Konkreetne Matemaatika
Sums ITT9131 Konkreetne Matemaatika Chapter Two Notation Sums and Recurrences Manipulation of Sums Multiple Sums General Methods Finite and Innite Calculus Innite Sums Contents 1 Sequences 2 Notations
More information1 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 informationAutomatic sequences, logarithmic density, and fractals. Jason Bell
Automatic sequences, logarithmic density, and fractals Jason Bell 1 A sequence is k-automatic if its n th term is generated by a finite state machine with n in base k as the input. 2 Examples of automatic
More informationExercises. Template for Proofs by Mathematical Induction
5. Mathematical Induction 329 Template for Proofs by Mathematical Induction. Express the statement that is to be proved in the form for all n b, P (n) forafixed integer b. 2. Write out the words Basis
More informationCHAPTER 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 informationChapter 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 informationConcrete Mathematics: A Portfolio of Problems
Texas A&M University - San Antonio Concrete Mathematics Concrete Mathematics: A Portfolio of Problems Author: Sean Zachary Roberson Supervisor: Prof. Donald Myers July, 204 Chapter : Recurrent Problems
More informationWhy 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 informationRecursion and Induction
Recursion and Induction Themes Recursion Recursive Definitions Recurrence Relations Induction (prove properties of recursive programs and objects defined recursively) Examples Tower of Hanoi Gray Codes
More informationRecursion and Induction
Recursion and Induction Themes Recursion Recursive Definitions Recurrence Relations Induction (prove properties of recursive programs and objects defined recursively) Examples Tower of Hanoi Gray Codes
More informationChapter12. 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 informationUse mathematical induction in Exercises 3 17 to prove summation formulae. Be sure to identify where you use the inductive hypothesis.
Exercises Exercises 1. There are infinitely many stations on a train route. Suppose that the train stops at the first station and suppose that if the train stops at a station, then it stops at the next
More informationCSC 344 Algorithms and Complexity. Proof by Mathematical Induction
CSC 344 Algorithms and Complexity Lecture #1 Review of Mathematical Induction Proof by Mathematical Induction Many results in mathematics are claimed true for every positive integer. Any of these results
More informationAppendix 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 informationIntroduction This is a puzzle station lesson with three puzzles: Skydivers Problem, Cheryl s Birthday Problem and Fun Problems & Paradoxes
Introduction This is a puzzle station lesson with three puzzles: Skydivers Problem, Cheryl s Birthday Problem and Fun Problems & Paradoxes Resources Calculators, pens and paper is all that is needed as
More informationCHAPTER 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 informationCMSC 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 informationIntermediate Math Circles March 11, 2009 Sequences and Series
1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Intermediate Math Circles March 11, 009 Sequences and Series Tower of Hanoi The Tower of Hanoi is a game
More informationDiscrete Mathematics
Discrete Mathematics I- MCA / III- CS & IS LECTURE NOTES (B. E OF VTU) VTU-EDUSAT Programme-17 Dr. V. Lokesha Professor of Mathematics DEPARTMENT OF MATHEMATICS ACHARYA INSTITUTE OF TECNOLOGY Soldevanahalli,
More informationAlgorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee
Algorithm Analysis Recurrence Relation Chung-Ang University, Jaesung Lee Recursion 2 Recursion 3 Recursion in Real-world Fibonacci sequence = + Initial conditions: = 0 and = 1. = + = + = + 0, 1, 1, 2,
More information15-451/651: Design & Analysis of Algorithms October 31, 2013 Lecture #20 last changed: October 31, 2013
15-451/651: Design & Analysis of Algorithms October 31, 2013 Lecture #20 last changed: October 31, 2013 In the last lecture, we defined the class NP and the notion of NP-completeness, and proved that the
More informationMathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)?
How does discrete math help us Helps create a solution (program) Helps analyze a program How does discrete math help (CS160)? Helps create a solution (program) q Logic helps you understand conditionals
More informationDivide 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 informationCpt 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 informationDiscrete Mathematics U. Waterloo ECE 103, Spring 2010 Ashwin Nayak May 17, 2010 Recursion
Discrete Mathematics U. Waterloo ECE 103, Spring 2010 Ashwin Nayak May 17, 2010 Recursion During the past week, we learnt about inductive reasoning, in which we broke down a problem of size n, into one
More informationDiscrete 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 informationPractical Session #3 - Recursions
Practical Session #3 - Recursions Substitution method Guess the form of the solution and prove it by induction Iteration Method Convert the recurrence into a summation and solve it Tightly bound a recurrence
More informationBasic Proof Techniques
Basic Proof Techniques Joshua Wilde, revised by Isabel Tecu, Takeshi Suzuki and María José Boccardi August 13, 2013 1 Basic Notation The following is standard notation for proofs: A B. A implies B. A B.
More informationMathematical Fundamentals
Mathematical Fundamentals Sets Factorials, Logarithms Recursion Summations, Recurrences Proof Techniques: By Contradiction, Induction Estimation Techniques Data Structures 1 Mathematical Fundamentals Sets
More informationLearning 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 informationIntroduction to Induction (LAMC, 10/14/07)
Introduction to Induction (LAMC, 10/14/07) Olga Radko October 1, 007 1 Definitions The Method of Mathematical Induction (MMI) is usually stated as one of the axioms of the natural numbers (so-called Peano
More informationRecursion and Induction
Recursion and Induction Themes Recursion Recurrence Definitions Recursive Relations Induction (prove properties of recursive programs and objects defined recursively) Examples Tower of Hanoi Gray Codes
More informationChapter 2 - Basics Structures
Chapter 2 - Basics Structures 2.1 - Sets Definitions and Notation Definition 1 (Set). A set is an of. These are called the or of the set. We ll typically use uppercase letters to denote sets: S, A, B,...
More informationn n P} is a bounded subset Proof. Let A be a nonempty subset of Z, bounded above. Define the set
1 Mathematical Induction We assume that the set Z of integers are well defined, and we are familiar with the addition, subtraction, multiplication, and division. In particular, we assume the following
More informationCS1802 Optional Recitation Week 11-12: Series, Induction, Recurrences
CS1802 Discrete Structures Recitation Fall 2017 Nov 19 - November 26, 2017 CS1802 Optional Recitation Week 11-12: Series, Induction, Recurrences 1 Sequences, Series and Recurrences PB 1. Prove that n k=0
More informationCS 2210 Discrete Structures Advanced Counting. Fall 2017 Sukumar Ghosh
CS 2210 Discrete Structures Advanced Counting Fall 2017 Sukumar Ghosh Compound Interest A person deposits $10,000 in a savings account that yields 10% interest annually. How much will be there in the account
More informationDiscrete Mathematics & Mathematical Reasoning Induction
Discrete Mathematics & Mathematical Reasoning Induction Colin Stirling Informatics Colin Stirling (Informatics) Discrete Mathematics (Sections 5.1 & 5.2) Today 1 / 11 Another proof method: Mathematical
More informationReductions, 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 informationarxiv:math/ v1 [math.co] 8 Oct 2003
arxiv:math/0310109v1 [math.co] 8 Oct 2003 Shortest paths in the Tower of Hanoi graph and finite automata Dan Romik February 1, 2008 Abstract We present efficient algorithms for constructing a shortest
More informationMathematical Induction. Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition)
Mathematical Induction Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition) Motivation Suppose we want to prove that for every value of n: 1 + 2 + + n = n(n + 1)/2. Let P(n) be the predicate
More information3 - Induction and Recursion
November 14, 2017 3 - Induction and Recursion William T. Trotter trotter@math.gatech.edu Using Recurrence Equations (1) Basic Problem How many regions are determined by n lines that intersect in general
More informationKonkretna matematika
ITT9131 Konkreetne Matemaatika Concrete mathematics Konkretna matematika Jaan Penjam Silvio Capobianco TTÜ arvutiteaduse instituut, teoreetilise informaatika õppetool Küberneetika Instituudi tarkvarateaduse
More information4.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 informationInduction. Induction. Induction. Induction. Induction. Induction 2/22/2018
The principle of mathematical induction is a useful tool for proving that a certain predicate is true for all natural numbers. It cannot be used to discover theorems, but only to prove them. If we have
More informationDiscrete Structures Lecture Sequences and Summations
Introduction Good morning. In this section we study sequences. A sequence is an ordered list of elements. Sequences are important to computing because of the iterative nature of computer programs. The
More informationLinear 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 informationThe 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 information1 True/False. Math 10B with Professor Stankova Worksheet, Discussion #9; Thursday, 2/15/2018 GSI name: Roy Zhao
Math 10B with Professor Stankova Worksheet, Discussion #9; Thursday, 2/15/2018 GSI name: Roy Zhao 1 True/False 1. True False When we solve a problem one way, it is not useful to try to solve it in a second
More informationDiscrete 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 informationSession 7: Pseudoproofs and Puzzles - Handout
Session 7: Pseudoproofs and Puzzles - Handout Many who have had an opportunity of knowing any more about mathematics confuse it with arithmetic, and consider it an arid science. In reality, however, it
More informationReading and Writing. Mathematical Proofs. Slides by Arthur van Goetham
Reading and Writing Mathematical Proofs Slides by Arthur van Goetham What is a proof? Why explanations are not proofs What is a proof? A method for establishing truth What establishes truth depends on
More informationAnother Proof By Contradiction: 2 is Irrational
Another Proof By Contradiction: 2 is Irrational Theorem: 2 is irrational. Proof: By contradiction. Suppose 2 is rational. Then 2 = a/b for some a, b N +. We can assume that a/b is in lowest terms. Therefore,
More informationChapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60
MATH 213 Chapter 2: Basic Structures Dr. Eric Bancroft Fall 2013 Dr. Eric Bancroft MATH 213 Fall 2013 1 / 60 Chapter 2 - Basics Structures 2.1 - Sets 2.2 - Set Operations 2.3 - Functions 2.4 - Sequences
More informationAnalysis of Algorithms
September 29, 2017 Analysis of Algorithms CS 141, Fall 2017 1 Analysis of Algorithms: Issues Correctness/Optimality Running time ( time complexity ) Memory requirements ( space complexity ) Power I/O utilization
More informationPRINCIPLE OF MATHEMATICAL INDUCTION
Chapter 4 PRINCIPLE OF MATHEMATICAL INDUCTION Analysis and natural philosopy owe their most important discoveries to this fruitful means, which is called induction Newton was indebted to it for his theorem
More information3.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 informationDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK UNIT-I SUB NAME: DESIGN AND ANALYSIS OF ALGORITHMS. PART A (2 Marks)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK UNIT-I SUB CODE: CS2251 DEPT: CSE SUB NAME: DESIGN AND ANALYSIS OF ALGORITHMS SEM/YEAR: III/ II PART A (2 Marks) 1. Compare the order of growth
More informationCSC236 Week 2. Larry Zhang
CSC236 Week 2 Larry Zhang 1 Announcements Tutorials start this week. Problem Set 1 will be out by Friday 2 Mathematical Induction 3 Mathematical Induction It s a proof technique It s an old proof technique
More informationReview 3. Andreas Klappenecker
Review 3 Andreas Klappenecker Final Exam Friday, May 4, 2012, starting at 12:30pm, usual classroom Topics Topic Reading Algorithms and their Complexity Chapter 3 Logic and Proofs Chapter 1 Logic and Proofs
More informationMath 378 Spring 2011 Assignment 4 Solutions
Math 3 Spring 2011 Assignment 4 Solutions Brualdi 6.2. The properties are P 1 : is divisible by 4. P 2 : is divisible by 6. P 3 : is divisible by. P 4 : is divisible by 10. Preparing to use inclusion-exclusion,
More informationWILLIAM LOWELL PUTNAM MATHEMATICAL COMPETITION. (3k(k + 1) + 1), for n 1.
Problem A1. Find the sum n (3k(k + 1) + 1), for n 1. k=0 The simplest way to solve this problem is to use the fact that the terms of the sum are differences of consecutive cubes: 3k(k + 1) + 1 = 3k 2 +
More informationCOMPSCI 105 S Principles of Computer Science. Recursion 2
COMPSCI 105 S2 2014 Principles of Computer Science Recursion 2 Exercise } We can determine how many digits a positive integer has by repeatedly dividing by 10 (without keeping the remainder) until the
More informationChapter 8 Answers. Lesson a. This a bipartite graph. b. 1, 4, 9 c. Number of Couples
Chapter 8 Answers Lesson 8.1 1. a. 2. a. This a bipartite graph. b. 1, 4, 9 c. Number of Couples d. 2n 1 e. H n = H n 1 + 2n 1 Number of Handshakes Recurrence Relation 1 1 2 4 H 2 = H 1 + 3 3 9 H 3 = H
More informationAnalysis of Algorithm Efficiency. Dr. Yingwu Zhu
Analysis of Algorithm Efficiency Dr. Yingwu Zhu Measure Algorithm Efficiency Time efficiency How fast the algorithm runs; amount of time required to accomplish the task Our focus! Space efficiency Amount
More informationOn generalized Frame-Stewart numbers
On generalized Frame-Stewart numbers Jonathan Chappelon and Akihiro Matsuura August 31, 2010 Abstract For the multi-peg Tower of Hanoi problem with k 4 pegs, so far the best solution is obtained by the
More informationThe Trees of Hanoi. Joost Engelfriet
The Trees of Hanoi Joost Engelfriet Leiden Institute of Advanced Computer Science Leiden University, The Netherlands j.engelfriet@liacs.leidenuniv.nl Abstract The game of the Towers of Hanoi is generalized
More informationThe associativity of equivalence and the Towers of Hanoi problem
Information Processing Letters 77 (2001) 71 76 The associativity of equivalence and the Towers of Hanoi problem Roland Backhouse a,, Maarten Fokkinga b a School of Computer Science and IT, University of
More informationPUTNAM TRAINING MATHEMATICAL INDUCTION. Exercises
PUTNAM TRAINING MATHEMATICAL INDUCTION (Last updated: December 11, 017) Remark. This is a list of exercises on mathematical induction. Miguel A. Lerma 1. Prove that n! > n for all n 4. Exercises. Prove
More information2. a. Consider the definition-based algorithm for finding the difference betweentwonxnmatrices.
Chapter 2 This file contains the exercises, hints, and solutions for Chapter 2 of the book Introduction to the Design and Analysis of Algorithms, 3rd edition, by A. Levitin. The problems that might be
More informationMAT 300 RECITATIONS WEEK 7 SOLUTIONS. Exercise #1. Use induction to prove that for every natural number n 4, n! > 2 n. 4! = 24 > 16 = 2 4 = 2 n
MAT 300 RECITATIONS WEEK 7 SOLUTIONS LEADING TA: HAO LIU Exercise #1. Use induction to prove that for every natural number n 4, n! > 2 n. Proof. For any n N with n 4, let P (n) be the statement n! > 2
More informationCS 5321: Advanced Algorithms - Recurrence. Acknowledgement. Outline. Ali Ebnenasir Department of Computer Science Michigan Technological University
CS 5321: Advanced Algorithms - Recurrence Ali Ebnenasir Department of Computer Science Michigan Technological University Acknowledgement Eric Torng Moon Jung Chung Charles Ofria Outline Motivating example:
More informationAdvanced Counting Techniques. 7.1 Recurrence Relations
Chapter 7 Advanced Counting Techniques 71 Recurrence Relations We have seen that a recursive definition of a sequence specifies one or more initial terms and a rule for determining subsequent terms from
More informationAssignment #2 COMP 3200 Spring 2012 Prof. Stucki
Assignment #2 COMP 3200 Spring 2012 Prof. Stucki 1) Construct deterministic finite automata accepting each of the following languages. In (a)-(c) the alphabet is = {0,1}. In (d)-(e) the alphabet is ASCII
More information{ 0! = 1 n! = n(n 1)!, n 1. n! =
Summations Question? What is the sum of the first 100 positive integers? Counting Question? In how many ways may the first three horses in a 10 horse race finish? Multiplication Principle: If an event
More informationCS 5321: Advanced Algorithms Analysis Using Recurrence. Acknowledgement. Outline
CS 5321: Advanced Algorithms Analysis Using Recurrence Ali Ebnenasir Department of Computer Science Michigan Technological University Acknowledgement Eric Torng Moon Jung Chung Charles Ofria Outline Motivating
More informationCHAPTER 8: MATRICES and DETERMINANTS
(Section 8.1: Matrices and Determinants) 8.01 CHAPTER 8: MATRICES and DETERMINANTS The material in this chapter will be covered in your Linear Algebra class (Math 254 at Mesa). SECTION 8.1: MATRICES and
More informationCombinatorics. But there are some standard techniques. That s what we ll be studying.
Combinatorics Problem: How to count without counting. How do you figure out how many things there are with a certain property without actually enumerating all of them. Sometimes this requires a lot of
More informationLegendre s Equation. PHYS Southern Illinois University. October 18, 2016
Legendre s Equation PHYS 500 - Southern Illinois University October 18, 2016 PHYS 500 - Southern Illinois University Legendre s Equation October 18, 2016 1 / 11 Legendre s Equation Recall We are trying
More informationFibonacci numbers. Chapter The Fibonacci sequence. The Fibonacci numbers F n are defined recursively by
Chapter Fibonacci numbers The Fibonacci sequence The Fibonacci numbers F n are defined recursively by F n+ = F n + F n, F 0 = 0, F = The first few Fibonacci numbers are n 0 5 6 7 8 9 0 F n 0 5 8 55 89
More informationProof Techniques 1. Math Camp n = (1 = n) + (2 + (n 1)) ( n 1. = (n + 1) + (n + 1) (n + 1) + n + 1.
Math Camp 1 Prove the following by direct proof. Proof Techniques 1 Math Camp 01 Take any n N, then n is either even or odd. Suppose n is even n m for some m n(n + 1) m(n + 1) n(n + 1) is even. Suppose
More informationPolar Form of Complex Numbers
OpenStax-CNX module: m49408 1 Polar Form of Complex Numbers OpenStax College This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 4.0 In this section, you will:
More information