Opracowanie językowe dr inż. J. Jarnicki

Slides:



Advertisements
Similar presentations
Geometric Sequences.
Advertisements

Discrete Mathematics Lecture 8 Alexander Bukharovich New York University.
CS 2210 (22C:19) Discrete Structures Advanced Counting
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
Discrete Structures Chapter 6 Recurrence Relations
A geometric sequence is a list of terms separated by a constant ratio, the number multiplied by each consecutive term in a geometric sequence. A geometric.
Analysis of Recursive Algorithms October 29, 2014
Expressing Sequences Explicitly By: Matt Connor Fall 2013.
Geometric Sequences and Series
Advanced Counting Techniques
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Lecture#16 Discrete Mathematics. Recursion Now, 1 is an odd positive integer by the definition base. With k = 1, = 3, so 3 is an odd positive integer.
RECURRENCE Sequence Recursively defined sequence
The Quadratic Formula. What does the Quadratic Formula Do ? The Quadratic formula allows you to find the roots of a quadratic equation (if they exist)
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
1 Recursion Recursive method –Calls itself (directly or indirectly) through another method –Method knows how to solve only a base case –Method divides.
Geometric Sequences.
Geometric Sequences & Series This chapter focuses on how to use find terms of a geometric sequence or series, find the sum of finite and infinite geometric.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
Infinite Geometric Series Recursion & Special Sequences Definitions & Equations Writing & Solving Geometric Series Practice Problems.
Internet Engineering Czesław Smutnicki Discrete Mathematics – Recursive Equations.
Daily Check 1)Find the first 3 terms of the following sequence: 2)Write the formula for the following arithmetic sequence. -2, 1, 4, 7, 10.
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence.
Mathematical Analysis of Recursive Algorithm CSG3F3 Lecture 7.
EXAMPLE 1 Evaluate recursive rules Write the first six terms of the sequence. a. a 0 = 1, a n = a n – b. a 1 = 1, a n = 3a n – 1 SOLUTION a. a 0.
{1, 1, 2, 3, 5, 8, 13, 21,...} What is this? Fibonacci Sequence.
Mathematics Medicine Sequences and series.
CSG523/ Desain dan Analisis Algoritma
CSG523/ Desain dan Analisis Algoritma
11.2 Arithmetic Sequences & Series
Opracowanie językowe dr inż. J. Jarnicki
11.3 Geometric Sequences & Series
Geometric Sequences.
11.3 Geometric Sequences & Series
Geometric Sequences and Series
11.2 Arithmetic Sequences.
Modeling with Recurrence Relations
Opracowanie językowe dr inż. J. Jarnicki
Introduction to Recurrence Relations
11.2 Arithmetic Sequences & Series
11.2 Arithmetic Sequences & Series
Opracowanie językowe dr inż. J. Jarnicki
11.3 Geometric sequences; Geometric Series
Arithmetic Progression
Series & Sequences.
Discrete Math (2) Haiming Chen Associate Professor, PhD
12.2A Arithmetic Sequences
Geometric Sequence The ratio of a term to it’s previous term is constant. This means you multiply by the same number to get each term. This number that.
12.3 Geometric Sequences & Series
9-3 Geometric Sequences & Series
Finite Geometric Series
Section 11.1 An Introduction to Sequences and Series
Section 5.7 Arithmetic and Geometric Sequences
Number Patterns.
9.3 Geometric Sequences and Series
Geometric Sequences.
CMSC Discrete Structures
Solving Recurrence Relations
Geometric Sequence The ratio of a term to it’s previous term is constant. This means you multiply by the same number to get each term. This number that.
Geometric Sequences and Series
Recurrence Relations Discrete Structures.
9.3 Geometric Sequences & Series
Arithmetic Sequences.
Sequences as Functions
Geometric Sequences and series
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
Use elimination to get rid of a1 and solve for d.
Copyright © Cengage Learning. All rights reserved.
Sequence.
Presentation transcript:

Opracowanie językowe dr inż. J. Jarnicki Internet Engineering Czesław Smutnicki Discrete Mathematics – Recursive Equations

CONTENTS Recursive equations Generating functions

HANOI TOWERS A B C

HANOI TOWERS cont. lr(n) – the number of moves (for n discs). n=0, lr(0)=0 n=1 ALG(1) K1: move disc on C. lr(1)=1 n=2 ALG(2) K1: small on B; K2: large on C K3: small on C; lr(2)=3 n=3 ALG(3) K1: small on C; K2: medium on B K3: small on B K4: large on C K5: small on A K6: medium on C K7: small on C lr(3)=7 n=4 ALG(4) KROK 1: 3 upper discs from A on B (alg. ALG(3)) lr(3) KROK 2: large na C 1 move KROK 3: 3 upper discs from B on C (alg. ALG(3)) lr(3) --------------------- lr(4)=2lr(3)+1

HANOI TOWERS cont. Generally lr(n)=2lr(n-1)+1=2n-1 with initial condition lr(0)=0. n 1 2 3 4 5 6 7 8 lr(n) 15 31 64 127 255

FIBONACCI NUMBERS Fibonacci numbers 1 2 3 5 8 13 21 34 55 89 ... 1 2 3 5 8 13 21 34 55 89 ... Recursive formula F1 = 1; F2 = 1; Fn = Fn-1 + Fn-2 , dla n > 2 b) Analytically

RABBITS M R RA pary 1 1 2 3 5 8 okresy 1 2 3 4 5 6

CIRCLES Similarly for n=3 we have: 1 + 3 + 3 + 1 = 8 = 23 1 = 20 1 + 1 = 2 = 21 1 + 2 + 1 = 4 = 22 2 1 4 3 Similarly for n=3 we have: 1 + 3 + 3 + 1 = 8 = 23 for n=4 we have: 1 + 4 + 6 + 4 +1 = 16 = 24

SOLUTION METHOD. CASE STUDY I Given recursive sequence: (1) an = 2 an-1 + 1, n > 1 with initial value a1=1 The sequence starts from: 1, 3, 7, 15, 31, 63. ... Find algebraic formula for the n-th element of the sequence. For n-1 we have: a n-1 =2 an-2 + 1 , which we substitute into equation (1). Such substitution we continue until we obtain a1, so an = 2·an-1 + 1 = 2·(2·an-2 + 1) + 1 = 22·an-2 + 2 + 1 = = 22·(2·an-3 + 1) + 2 + 1 = 23·an-3 + 22 + 21 + 20 = . . . = 2kan-k + 2k-1 + 2k-2 + ... + 22 + 21 + 20 = = 2n-1 + 2n-2 + ... + 22 + 21 + 20 = 2n – 1

SOLUTION METHOD. CASE STUDY I. cont This is the sum of a geometric sequence with the ratio q=ai+1/ai =2 and a1=1; so S= (1-2n)/(1-2) = - (1-2n) = 2n –1. Therefore an=2n –1. We can check this below. n an=2an-1 + 1 an = 2n - 1 1 2 3 4 5 2*1 + 1 = 3 2*3 + 3 = 7 2*7 + 1 = 15 2*15 + 1 = 31 22 – 1=3 23 –1 =7 24 – 1=15 25 – 1=31

SOLUTION METHOD. CASE STUDY II. Consider the equation: sn = asn-1 + bsn-2 where values s0 and s1 are known, and a,b - are certain constants Case a) either a = 0 or b = 0 If b=0 then sn = asn-1 for n  1. Therefore s1 = as0 , s2 = as1 = a2 s0, ... and finally sn = ans0. If a = 0 then sn = bsn-2 for n  2. Therefore s2=bs0 , s4=bs2 =b2s0 and finally … s2n =bns0 n  N Similarly s3 = bs1 , s5 = bs3 = b2s1 and finally s2n+1 = bns1 n  N

SOLUTION METHOD. CASE STUDY II. cont Case b) a ≠ 0 or b ≠ 0 has characteristics equation x2 - ax - b = 0 This equation follows from the supposition for the given constant c. Hence dividing by C we obtain then r is the root of the equation x2 - ax - b = 0

Thank you for your attention DISCRETE MATHEMATICS Czesław Smutnicki