Math.3336: Discrete Mathematics. Advanced Counting Techniques

Similar documents
Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Math.3336: Discrete Mathematics. Chapter 9 Relations

Math.3336: Discrete Mathematics. Combinatorics: Basics of Counting

Math.3336: Discrete Mathematics. Cardinality of Sets

Math.3336: Discrete Mathematics. Propositional Equivalences

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Math.3336: Discrete Mathematics. Mathematical Induction

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Math.3336: Discrete Mathematics. Nested Quantifiers

Math.3336: Discrete Mathematics. Proof Methods and Strategy

Learning Objectives

Advanced Counting Techniques. Chapter 8

Recurrence Relations

Advanced Counting Techniques

Linear Recurrence Relations

CS483 Design and Analysis of Algorithms

CS 2210 Discrete Structures Advanced Counting. Fall 2017 Sukumar Ghosh

2.1 Differential Equations and Solutions. Blerina Xhabli

SOLVING LINEAR RECURRENCE RELATIONS

Divide and Conquer. Recurrence Relations

Course Staff. Textbook

Handout 7: Recurrences (Cont d)

Algorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee

MATH 137 : Calculus 1 for Honours Mathematics. Online Assignment #2. Introduction to Sequences

EECS 1028 M: Discrete Mathematics for Engineers

Recursion and Induction

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

V. Adamchik 1. Recurrences. Victor Adamchik Fall of 2005

CS483 Design and Analysis of Algorithms

CS 4104 Data and Algorithm Analysis. Recurrence Relations. Modeling Recursive Function Cost. Solving Recurrences. Clifford A. Shaffer.

Welcome to Physics 161 Elements of Physics Fall 2018, Sept 4. Wim Kloet

CS Non-recursive and Recursive Algorithm Analysis

Lecture 12 : Recurrences DRAFT

Math Section Bekki George: 01/16/19. University of Houston. Bekki George (UH) Math /16/19 1 / 31

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

MATH 243E Test #3 Solutions

Recurrences COMP 215

MA/OR/ST 706: Nonlinear Programming Midterm Exam Instructor: Dr. Kartik Sivaramakrishnan INSTRUCTIONS

1 Recursive Algorithms

Recursion and Induction

Recursion and Induction

6.2 SOLVING EASY RECURRENCES

CSC2100B Data Structures Analysis

Introduction. Outline. EE3321 Electromagnetic Field Theory. Welcome! About this class Rules and syllabus Let s get started! 9/19/2018. E t.

Announcements Monday, September 18

Math 152: Applicable Mathematics and Computing

COE428 Notes Week 4 (Week of Jan 30, 2017)

Math 410 Linear Algebra Summer Session American River College

School of Mathematics and Science MATH 163 College Algebra Section: EFA

1.1 Administrative Stuff

CS173 Lecture B, November 3, 2015

Homework 1 Submission

SPRING 2014 Department of Physics & Astronomy, UGA PHYS 4202/6202 Electricity and Magnetism II (as of Jan. 07/2014)

MAT 211, Spring 2015, Introduction to Linear Algebra.

Differential Equations MTH 205

Section 5.2 Solving Recurrence Relations

CS Analysis of Recursive Algorithms and Brute Force

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Row Space, Column Space, and Nullspace

Section Instructors: by now you should be scheduled into one of the following Sections:

1 Examples of Weak Induction

NEW RIVER COMMUNITY COLLEGE DUBLIN, VIRGINIA COURSE PLAN

CS483 Design and Analysis of Algorithms

Math 1553 Introduction to Linear Algebra. School of Mathematics Georgia Institute of Technology

Math/EECS 1028M: Discrete Mathematics for Engineers Winter Suprakash Datta

AS 101: The Solar System (Spring 2017) Course Syllabus

San José State University Aerospace Engineering Department AE138: Vector Based Dynamics for Aerospace Applications Fall 2018

CHEM 4725/8725 Organometallic Chemistry. Spring 2016

CS261: Problem Set #3

Exam 2 Solutions. x 1 x. x 4 The generating function for the problem is the fourth power of this, (1 x). 4

COS 341: Discrete Mathematics

MATH 345 Differential Equations

Math 211 Lecture Notes: Sections

Math Section Bekki George: 08/28/18. University of Houston. Bekki George (UH) Math /28/18 1 / 37

IS 709/809: Computational Methods in IS Research Fall Exam Review

Advanced Counting Techniques. 7.1 Recurrence Relations

Welcome to Physics 211! General Physics I

Math 4377/6308 Advanced Linear Algebra I Dr. Vaughn Climenhaga, PGH 651A HOMEWORK 3

MATH 0409: Foundations of Mathematics COURSE OUTLINE

MATH 580, exam II SOLUTIONS

Section 7.2 Solving Linear Recurrence Relations

Exam is: Math Dr. Smithies Spring 2018 Review and Practice Test 3

CHAPTER 8 Advanced Counting Techniques

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

Discrete Mathematics. Kishore Kothapalli

Recursion: Introduction and Correctness

5. Sequences & Recursion

Announcements Tuesday, April 17

Course Information Course Overview Study Skills Background Material. Introduction. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics

AS The Astronomical Universe. Prof. Merav Opher - Fall 2013

Cpt S 223. School of EECS, WSU

Important Dates. Non-instructional days. No classes. College offices closed.

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Physics 101 covers. Forces Kinematics Energy/Momentum Rotations Fluids Waves/Sound Thermodynamics. Physics 101: Lecture 1, Pg 1

FINAL (CHAPTERS 7-9) MATH 141 SPRING 2018 KUNIYUKI 250 POINTS TOTAL

Important Dates. Non-instructional days. No classes. College offices closed.

Lake-Sumter State College Course Syllabus. South Lake Building 2 Room 339

Math Section TTH 5:30-7:00pm SR 116. James West 620 PGH

Recursion. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Transcription:

Math.3336: Discrete Mathematics Advanced Counting Techniques Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Spring 2019 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 1/18

Course Information/Office Hours Instructor: Dr. Blerina Xhabli Office hours: TuTh 10:30am 12:00pm (PGH 202) Tutor/Grader: An Vu Office hours: MonWed 2:30pm 4:00pm (Fleming #11) Class meets every TuTh 1:00 pm - 2:30 pm Course webpage: http://www.math.uh.edu/ blerina/ The class webpage contains contact info, office hours, slides from lectures, and important announcements. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 2/18

Assignments to work on Homework #10 due Thursday, 4/25, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 3/18

Chapter 8 Advanced Counting Techniques Chapter 8 Overview Applications of Recurrence Relations Section 8.1 Solving Linear Recurrence Relations Section 8.2 Homogeneous Recurrence Relations Nonhomogeneous Recurrence Relations Divide-and-Conquer Algorithms and Recurrence Relations Section 8.3 Generating Functions Section 8.4 Inclusion-Exclusion Section 8.5 Applications of Inclusion-Exclusion Section 8.6 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 4/18

Section 8.1 Applications of Recurrence Relations Recall the Recursively Defined Sequences: In previous lectures, we looked at recursively-defined sequences Example: What sequence is this? 1, 2, 3, 4, 5, 6, 7, 8,... a 0 = 1 a n = a n 1 + 1 Another example: Fibonacci numbers 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,... f 0 = 1 f 1 = 1 f n = f n 1 + f n 2 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 5/18

Recurrence Relations Recursively defined sequences are often referred to as recurrence relations The base cases in the recursive definition are called initial values of the recurrence relation Example: Write recurrence relation representing number of bacteria in n th hour if colony starts with 5 bacteria and doubles every hour? a 0 = 5 a n = 2 a n 1 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 6/18

Closed Form Solutions Recurrence relations are often very natural to define, but we usually need to find closed form solution. Closed form solution defines n th number in the sequence as a function of n What is closed form solution to the following recurrence? a 0 = 0 a n = a n 1 + n Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 7/18

Closed Form Solutions of Recurrence Relations Given an arbitrary recurrence relation, is there a mechanical way to obtain the closed form solution? Not for arbitrary, but for a subclass of recurrence relations A linear homogeneous recurrence relation with constant coefficients is a recurrence relation of the form: a n = c 1 a n 1 + c 2 a n 2 +... + c k a n k where each c i is a constant and c k is non-zero The value of k is called the degree of the recurrence relation The recurrence relation for Fibonacci numbers is a degree 2 linear homogeneous recurrence Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 8/18

Examples and Non-Examples Which of these are linear homogenous recurrence relations with constant coefficients? a n = a n 1 + 2a n 5 yes a n = 2a n 2 + 5 no, not homogeneous a n = a n 1 + n no, not homogeneous a n = a n 1 a n 2 no, non-linear a n = n a n 1 linear homogenous but not constant coeff. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 9/18

Characteristic Polynomial Cook-book recipe for solving linear homogenous recurrence relations with constant coefficients Definition: The characteristic equation of a recurrence relation of the form a n = c 1 a n 1 + c 2 a n 2 +... c k a n k is r k = c 1 r k 1 + c 2 r k 2 +... + c k i.e., Replace a n i with r n i (n k) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 10/18

Characteristic Equation Examples What are the characteristic equations for the following recurrence relations? f n = f n 1 + f n 2 r 2 = r + 1 a n = 2a n 1 r = 2 a n = 2a n 1 + 5a n 3 r 3 = 2r 2 + 5 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 11/18

Characteristic Roots The characteristic roots of a linear homogeneous recurrence relation are the roots of its characteristic equation. What are the characteristic roots of the following recurrence relations? a n = 2a n 1 + 3a n 2 r 1 = 3, r 2 = 1 f n = f n 1 + f n 2 r 1 = 1+ 5 2, r 2 = 1 5 2 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 12/18

Theorem I: Solving Linear Homogenous Recurrence Relations Let a n = c 1 a n 1 + c 2 a n 2 +... + c k a n k be a recurrence relation with k distinct characteristic roots r 1,..., r k. Then the closed form solution for a n is of the form: a n = α 1 r n 1 + α 2 r n 2 +... + α k r n k Furthermore, given k initial conditions, the constants α 1,..., α k are uniquely determined Note: Won t do the formal proof because requires a good amount of linear algebra. In class, we demonstrated the basic needed tools behind the proof. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 13/18

Example I Find a closed form solution for the recurrence a n = a n 1 + 2a n 2 with initial conditions a 0 = 2 and a 1 = 7 Characteristic equation: r 2 r 2 = 0 Characteristic roots: r 1 = 2, r 2 = 1 Thus, the general solution is a n = α 1 2 n + α 2 ( 1) n. Coefficients: α 1 = 3, α 2 = 1 { a0 = α 1 2 0 + α 2 ( 1) 0 { = 2 a 1 = α 1 2 1 + α 2 ( 1) 1 = 7 α1 + α 2 = 2 2α 1 α 2 = 7 Closed-form solution: a n = 3 2 n ( 1) n Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 14/18

Example II Derive the closed form solution for the Fibonacci sequence f n = f n 1 + f n 2 with initial conditions f 0 = 0 and f 1 = 1 From earlier, characteristic equation has two distinct roots at r 1 = 1+ 5 2, r 2 = 1 5 2 Hence, solution is of the form: ( 1 + ) n ( 5 1 ) n 5 f n = α 1 + α 2 2 2 Compute α 1, α 2 using initial conditions f 0 = 0 and f 1 = 1 in the general solution above: α 1 = 1 5, α 2 = 1 5 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 15/18

Towers of Hanoi Given 3 pegs where first peg contains n disks Goal: Move all the disks to a different peg (e.g., second one) Rule 1: Larger disks cannot rest on top of smaller disks Rule 2: Can only move the top-most disk at a time Question: How many steps does it take to move all n disks? Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 16/18

A Recursive Solution Solve recursively T n is number of steps to move n disks Base case: n = 1, move disk from first peg to second: T 1 = 1 Induction: Suppose we can move n 1 disks in T n 1 steps; how many steps does it take to move T n disks? Idea: First move the topmost n 1 disks to peg 3; can be done in T n 1 steps Now, move bottom-most disk to peg 2 takes just 1 step Finally, recursively move n 1 disks in peg 3 to peg 2 can be done in T n 1 steps Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 17/18

Towers of Hanoi, cont. Initial condition: T 1 = 1 Recurrence relation: T n = 2T n 1 + 1 Now we will find closed form solution for T n : We can use an iterative approach to solve this recurrence relation by repeatedly expressing T n in terms of the previous terms of the sequence: T n = 2T n 1 + 1 = 2(2T n 2 + 1) + 1 = 2 2 T n 2 + 2 + 1 = 2 2 (2T n 3 + 1) + 2 + 1 = 2 3 T n 3 + 2 2 + 2 + 1. = 2 n 1 T 1 + 2 n 2 + 2 n 3 + + 2 + 1 substitute T 1 = 1 = 2 n 1 + 2 n 2 + 2 n 3 + + 2 + 1 geometric series = 2 n 1 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Advanced Counting Techniques 18/18