LectureNote MA221 03oct
LectureNote MA221 03oct
Lecture 22:
Counting: Permutations and Combinations contd. and
Recurrence equations
n + 1 objects
Different k-combinations
𝐶 𝑛 + 1, 𝑘
• H(n) = 2n - 1
• H(1) =1
• 2n – 1 = 2(2n-1 - 1) + 1
H(n) is solution of (1)
Solving Recurrence Equations
• A recurrence equation specifies a sequence of values
{1, 3, 7, 15, … , hn, …}
• Recurrence equation Recurrence function
• The above sequence satisfies the recurrence:
hn = 2 hn-1 + 1 if n 2
= 1, if n = 1
• Solving a recurrence equation Finding a sequence satisfying the
recurrence
• Instead of the whole sequence, just find the nth term as a function of n
• A recurrence equation may have more than one solution
an = 2 an-1 - an-2 if n 2
Solution 1 {0,3,6,9,…, an,… } {an = 3n}, n 0
Solution 2 {5,5…, an,… } {an = 5}, n 0
Iterative Method for Solving Recurrence
Equations
• Find the sequence satisfying a0 = 2
the recurrence: a1 = a 0 + 3 = 2 + 3
an = an-1 + 3 if n 1
a2 = a1 + 3 = 2 + 2*3
= 2, if n = 0
a3 = a2 + 3 = 2 + 3*3
an = an-1 + 3 …
= an-2 + 3 + 3 = an-2 + 2*3
= an-3 + 3 + 2*3 = an-3 + 3*3
=…
an = an-1 + 3 = [2 + (n-1)*3] + 3
= an-n + n*3 = 2 + 3n – closed form
= 2 + 3n
formula
Backward substitution Forward substitution
Linear Homogenous Recurrence Equation of Degree 𝑘
with Constant Coefficient
• Generic form:
an = c1 an-1 + c2 an-2 + c3 an-3 + … ck an-k
where c1, … ck, are real numbers, with ck 0
• an is a linear function of previous terms. Degree 𝑘 because ck 0 but ci may
be equal to Zero for i= 1, 2, ..