0% found this document useful (0 votes)
8 views9 pages

LectureNote MA221 03oct

Discrete Maths notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views9 pages

LectureNote MA221 03oct

Discrete Maths notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Discrete Mathematics

Lecture 22:
Counting: Permutations and Combinations contd. and
Recurrence equations

Partha Sarathi Mandal


IIT Guwahati
Combinatorial Proofs
• Pascal’s identity 𝐶 𝑛 + 1, 𝑘 = 𝐶 𝑛, 𝑘 + 𝐶(𝑛, 𝑘 − 1)

n + 1 objects

Different k-combinations
𝐶 𝑛 + 1, 𝑘

After fixing x1 there are n remaining,


out of which k-1 to be chosen, then After excluding x1 there are n remaining,
include x1 to each of the group. out of which k to be chosen.
k-combinations containing x1
k-combinations NOT containing x1 𝐶 𝑛, 𝑘
𝐶 𝑛, 𝑘 − 1
Lectures on
• Recurrence equations
• Counting using recurrence equations
Counting using Recurrence Equations
• Many counting problems get significantly simplified by Recurrence equations
• fact (n) = n. fact (n)
• fib(n) = fib(n-1) + fib(n-2)
• Example: number of n-bit strings that don’t have two consecutive 0’s
• Let 𝐴(𝑛) denote the number of 𝑛-bit strings with no two consecutive 0’s.
• A(1), A(2),…
• Structure of n-bit strings with no two consecutive 0’s
1 (𝑛-1)-bit strings with no two consecutive 0’s 0 1 (𝑛-2)-bit strings with no two consecutive 0’s

𝐴(𝑛-1) such strings 𝐴(𝑛-2) such strings


𝐴(𝑛) = 𝐴(𝑛-1) + 𝐴(𝑛-2) , if n  3
= 2 , if n =1
= 3 , if n =2
Solving Recurrence Equations
• Finding closed-form formula for recurrence equations
H(n) = 2H(n-1) + 1 if n  2 ----- (1)
= 1, if n = 1
• Compute H(100)
= 2 H(99) + 1
= 2 [2H(98) + 1] + 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, ..

• Example: fn = fn-1 + fn-2


• Degree 2
• Example: an = an-1 + an-22
• Non-linear
• Example: hn = 2 hn-1 + 1
• Non-homogeneous
Linear Homogenous Recurrence Equation of Degree 𝑘
with Constant Coefficients
an = c1 an-1 + c2 an-2 + c3 an-3 + … ck an-k with ck  0

• Given k initial conditions a0 = V0 , a1 = V1 , … , ak-1 = Vk-1


• Unique solution (sequence), satisfying the recurrence relation
• Proof follows using strong induction A recurrence equation may have more than one solution
an = 2 an-1 - an-2 if n  2
{V0 , V1 , … , Vk-1 , Vk , Vk+1}
Solution 1: {0,3,6,9,…, an,… }  {an = 3n}, n  0
• Frist k terms of the sequence given Solution 2: {5,5,5…, an,… }  {an = 5}, n  0
• Fixing V0 , V1 , … , Vk-1  Vk
• Fixing V0 , V1 , … , Vk-1  Vk+1 Solution can be made unique for specific initial
conditions like a0 = 0, a1 = 3 implies an = 3n

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy