0% found this document useful (0 votes)
204 views30 pages

DiscreteMaths Unit4 Notes

Uploaded by

faisaldabos
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)
204 views30 pages

DiscreteMaths Unit4 Notes

Uploaded by

faisaldabos
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/ 30

UNIT-IV

Recurrence Relation: Generating Functions, Function of Sequences Calculating


Coefficient of generating function, Recurrence relations, solving recurrence relation by
substitution and Generating funds. Characteristics solution of inhomogeneous
Recurrence Relation.
UNIT 4. Generating Functions:
In mathematics, a generating function is a formal power series in one indeterminate, whose Coefficients encode
information about a sequence of numbers an that is indexed by thenatural numbers. Generating functions were
first introduced by Abraham de Moivre in 1730,in order to solve the general linear recurrence problem. One can
generalize to formal powerseries in more than one indeterminate, to encode information about arrays of numbers
indexed by several natural numbers.
Generating functions are not functions in the formal sense of a mapping from a domain to a codomain; the name is
merely traditional, and they are sometimes more correctly called generating series.
Ordinary generating function
The ordinary generating function of a sequence an is

When the term generating function is used without qualification, it is usually taken to meanan ordinary generating
function.
If an is the probability mass function of a discrete random variable, then its ordinarygenerating function is called a
probability-generating function.
The ordinary generating function can be generalized to arrays with multiple indices. For example, the ordinary generating
function of a two-dimensional array am, n (where n and m are natural numbers) is
Example:

Exponential generating function

The exponential generating function of a sequence an

Function of Sequences: Generating functions giving the first few powers of the nonnegative integers are given
in the following table
There are many beautiful generating functions for special functions in number theory. A fewparticularly nice
examples are

For the partition function P, where is a q-Pochhammer symbol, and

For the Fibonacci numbers


Generating functions are very useful in combinatorial enumeration problems. For example, the subset sum
problem, which asks the number of ways to select out of Given integers such that their sum equals

can be solved using generating functions.

Calculating Coefficient of generating function:


By using the polynomial expansions, we can calculate the coefficient of a generatingfunction.
Recurrence relations:
Introduction: A recurrence relation is a formula that relates for any integer

n ≥ 1, the n-the term of a sequence A = {ar}∞r=0 to one or more of the terms a0,a1,….,an-1.

Definition. Suppose n and k are nonnegative integers. A recurrence relation of the form c0 (n)an+ c1(n)an-1 +
…. + Ck (n)an-k = f(n) for n ≥ k, where c0(n), c1(n),…., ck(n), and f(n) are functions of n is said to be a linear
recurrence relation. If c0(n) and ck(n) are not identically zero, then it is said to be a linear recurrence relation
degree k. If c0(n), c1(n),…., ck(n) are constants, then the recurrence relation is known as a linear relation with
constant coefficients. If f(n) is identically zero, then the recurrence relation is said to be homogeneous;
otherwise, itis inhomogeneous.

There are no general techniques that will enable one to solve all recurrence relations. There are techniques that
will enable us to solve linear recurrence relations with constant coefficients.
SOLVING RECURRENCE RELATIONS BY SUSTITUTION AND
GENERATING FUNCTIONS
We shall consider four methods of solving recurrence relations in this and the next twosections:
• Substitution (also called iteration),
• Generating functions,

• Characteristics roots, and


In the substitution method the recurrence relation for an is used repeatedly to solve for a general expression for an in terms of n. We desire that this expression involve no other
terms of the sequence except those given by boundary conditions.
Example
Solve the recurrence relation an = a n-1 + f(n) for n ³1 by substitution a1= a0 + f(1)a2 = a1 + f(2) = a0 + f(1)
+ f(2))
a3 = a2 + f(3)= a0 + f(1) + f(2) + f(3)
an = a0 + f(1) + f(2) +….+ f(n) n
= a0 + ∑ f(k)K = 1
Thus, an is just the sum of the f(k) „s plus a0.
More generally, if c is a constant then we can solve an = c a n-1 + f(n) for n ³1 in the sameway: a1 = c a0 + f(1)
a2 = c a1 + f(2) = c (c a0 + f(1)) + f(2) = c2 a0 + c f(1) + f(2)
a3= c a2 + f(3) = c(c 2 a0 + c f(1) + f(2)) + f(3) =c3 a0 + c2 f(1) + c f(2) + f(3)
an = c a n-1 + f(n) = c(c n-1 a0 + c n-2 f(1) +. . . + c n-2 + f(n-1)) +
f (n) =c n a0 + c n-1 f(1) + c n-2 f(2) +. . .+ c f(n-1) + f(n)
Or an = c n a0 + ∑c n-k f(k)

Generating function examples:


Find the generating functions for the following sequences.(a) 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, …
(b) 1, 1, 1, 1, 1, …
(c) 1, 3, 3, 1, 0, 0, 0, 0, …
Solution:
Characteristic roots of homogeneous recurrence relation:

Ex: Let ak = 5ak-1 - 6ak-2. Find the general solution.The relation has characteristic
equation:
x 2 = 5x - 6,
So x 2 - 5x + 6 = 0 hence (x - 2) (x - 3) = 0
Implying either (x - 2) = 0 or (x - 3) = 0thus x = 2,3
General Solution is an = C (2n) + D (3n ).
What is a Recurrence Relation?
A recurrence relation is an equation that defines a sequence based on its preceding terms. In simpler terms, it’s a way to
express each term in a sequence as a function of previous terms. Recurrence relations are especially useful in computer
engineering for analyzing recursive algorithms, understanding complex calculations, and solving problems that involve
repetitive structures.
Why are Recurrence Relations Important for Computer Engineering?
Computer engineering students encounter recurrence relations when analyzing the time complexity of recursive algorithms,
such as those in data structures (like trees and heaps), divide-and-conquer algorithms (e.g., mergesort), and other scenarios
where a problem is broken into smaller, similar sub-problems.
Understanding recurrence relations helps students:
•Analyze and predict performance: Recurrence relations reveal how an algorithm’s runtime grows as input size increases.
•Optimize recursive algorithms: By solving recurrence relations, students can determine whether their algorithms are efficient
and, if not, find ways to improve them.
•Model real-world systems: Recurrence relations can represent iterative processes in systems, such as resource allocation or
network behavior, allowing for predictions and optimizations.
Types of Recurrence Relations
1.Linear Recurrence Relations: Each term is a linear combination of previous terms. These are common in algorithmic
analysis.
1. Example: T(n)=2T(n−1)+1 (often seen in recursive algorithms where each step splits the problem in two)
2.Non-Linear Recurrence Relations: Involves terms that are multiplied or squared, creating non-linear combinations.
1. Example: T(n)=T(n−1)⋅T(n−2)
3. Homogeneous vs. Non-Homogeneous Recurrence Relations:
1. Homogeneous: Every term depends only on previous terms without any additional constant.
1. Example: T(n)=2T(n−1)
2. Non-Homogeneous: Includes an additional function or constant.
1. Example: T(n)=2T(n−1)+n

Solving Recurrence Relations


Solving a recurrence relation means finding an explicit formula for T(n), often referred to as the closed form. Here are some
methods commonly used:
1.Substitution Method: Substitute terms to identify a pattern or guess the solution.
2.Iteration Method: Expand the recurrence to observe how it behaves over successive steps.
3.Characteristic Equation Method: Used for linear homogeneous recurrence relations with constant coefficients (covered
below).
4.Master Theorem: Applicable to divide-and-conquer recurrences, providing a way to determine asymptotic behavior
without solving the relation directly.
Characteristic Equation Method
For a linear homogeneous recurrence relation with constant coefficients, such as:
T(n)=aT(n−1)+bT(n−2) we assume a solution of the form T(n) = r^n and substitute into the recurrence. This gives a
characteristic equation, a polynomial whose roots determine the general form of the solution.
Example
Consider the recurrence relation:
1.T(n)=4T(n−1)−4T(n−2)
2.Form the Characteristic Equation: Assume T(n) = r^n , substitute it, and get:
3.r^n = 4 r^{n-1} - 4 r^{n-2}
4.Simplify to:
r^2 - 4r + 4 = 0 which factors as (r - 2)^2 = 0, giving r=2 as a repeated root.
1.Write the General Solution: Since 2 is a repeated root, the solution has the form:
2.T(n)=(C1+C2n)⋅2^n where C1 and C2 are constants determined by initial conditions.
Applications in Computer Engineering
1.Algorithm Analysis: Divide-and-conquer algorithms (e.g., mergesort) can have their runtime expressed as recurrence
relations, which then determine their time complexity. For instance, mergesort’s recurrence relation is:
T(n)=2T(n/2)+O(n) Using methods like the Master Theorem, we find this resolves to T(n)=O(nlogn)

2.Data Structures: Recurrences define the operations on trees, heaps, and other recursive structures. For example, inserting
into a binary search tree (BST) on average has recurrence:
T(n)=T(n/2)+1 which, through the characteristic equation, gives a time complexity of O(logn).

3. Dynamic Programming: Many dynamic programming problems are defined by recurrence relations, where an optimal
solution for a problem depends on solutions to subproblems. For example, the Fibonacci sequence is defined by:
F(n)=F(n−1)+F(n−2) which has applications in areas like sequence analysis, optimization, and modeling in computer
engineering.

Summary
For computer engineering students, mastering recurrence relations is critical because it allows them to understand and
optimize recursive processes. The ability to analyze and solve these relations leads to a better grasp of algorithm efficiency,
computational complexity, and efficient system design—key skills for developing robust and scalable software systems.
Find the recurrence relation : s(n) = a^n
To find a recurrence relation for the sequence s(n) = a^n , let’s analyze how each term relates to the previous one.
Step 1: Express s(n) in Terms of s(n−1)
We know that:
s(n) = a^n Since s(n-1) = a^{n-1}, we can rewrite s(n) in terms of s(n-1):
s(n)=a⋅s(n−1)
Step 2: Formulate the Recurrence Relation
The recurrence relation for s(n) is therefore:
s(n)=a⋅s(n−1)
Step 3: Specify the Initial Condition
To completely define the recurrence, we need an initial condition. Typically, we start with:
s(0)= a^0 = 1
Final Recurrence Relation
The recurrence relation for the sequence s(n)= a^n is:
s(n)=a⋅s(n−1),with s(0)=1
Now let's explore the sum of the terms of the sequence s(n)=a^n from n=0 to some arbitrary value n=k.
Given:
s(n) = a^n we want to find: n=0∑k​s(n)=0∑k​a^n

Step 1: Recognize the Series as a Geometric Series


The sequence a^0, a^1, a^2,, a^k is a geometric series with the first term a^0 = 1 and common ratio a. For a geometric series,
the sum S of the first k+1 terms is given by:
S=∑n=0ka^n =n= 1-a^(k+1​)/(1-a)for a not eq to 1.
Step 2: Evaluate the Sum for a=1
If a=1 each term in the series is 1, so:
n=0∑k​1=k+1Final Result
Thus, the sum of the first k+1 terms of s(n)= a^n is:
frac{1 - a^{k+1}}/{1 - a} & k + 1 if a =1,if a=1.​
To solve the recurrence relation:
a(n)−5a(n−1)+6a(n−2)=0 we can use the characteristic equation method.

Step 1: Set up the Characteristic Equation


Assume a solution of the form a(n)= r^n . Substituting into the recurrence relation gives:
r^n - 5r^{n-1} + 6r^{n-2} = 0
Dividing by r^{n-2}(assuming r≠0 ), we obtain the characteristic equation:

r^2 - 5r + 6 = 0
Step 2: Solve the Characteristic Equation
Now, we factor the quadratic equation:
r^2 - 5r + 6 = (r - 2)(r - 3) = 0
This gives the roots:
r=2andr=3
Step 3: Write the General Solution
Since we have two distinct roots r=2 and r=3 , the general solution to the recurrence relation is:
a(n)=C1⋅2^n + C2. 3^n where C1 ,C2​ are constants determined by initial conditions.
Final Solution
The general solution to the recurrence relation a(n)−5a(n−1)+6a(n−2)=0 is:
a(n)=C1⋅2^n + C2.3^n

To fully determine C1 and C2, we would need specific initial values, such as a(0) and a(1).
1. Define Recurrence Relation. Give an example. [2] CO4 BTL2
2. List and define the types of generating functions. [2] CO4 BTL2

3. Determine generating function for [2] CO4 BTL5

i) ar=3^r +4^(r+1)
ii) ar=5
4. Explain in brief the homogeneous recurrence relation with [2] CO4 BTL5
example
5. Explain in brief the non-homogeneous recurrence relation with example [2] CO4 BTL5

6. What is characteristic equation. Define characteristic roots. [2] CO4 BTL2


7. What is general solution? Write the homogeneous solution of zero. [2] CO4 BTL2
8. Determine the generating function of numeric functions [2] CO4 BTL5

i) ar=3^r
ii) ar=5(2)^r
9. Define homogeneous solution and particular solution. Write the [2] CO4 BTL2
particular solution of a constant.
10. Write the particular solution if [2] CO4 BTL2
i) root and b value is same
ii) root and b value is different
11. a). Write the homogeneous solution when nature of roots is [3] CO4 BTL2

i) real and distinct ii) real and repeated iii) distinct complex
b). Determine the discrete numeric function for 7z^2 ÷(1-2z)(1+3z) [3] CO4 BTL5
c). Solve the difference equation by boundary conditions. ar -5 ar-1 + 6 ar-2 [6] CO4 BTL6

= 2^r + r , r>=2, a0=1, a1=1


12. a). Solve an =2 an-1 - an-2 , n>=2, with a1=1.5, a2=3 [6] CO4 BTL6
b). Find numeric function for [6] CO4 BTL5

i) 2÷ (1- 4z^2 ) ii) 5÷ (1- z )


13. a). Determine the discrete numeric sequence for [3] CO4 BTL2
i) 1 (1+z)
ii) 1/ (1-5z)
b). Determine the discrete numeric function for (2 + 3z – 6z^2 )÷(1-2z) CO4 BTL5
[3]
c). Solve the difference equation by boundary conditions. ar +6 ar-1 + 12 ar- [6] CO4 BTL6

2 +8 ar-3 = 2^r , r>=3, a0=0, a1=0 , a2=2


14. a). Solve the difference equation by boundary conditions. an=2 an-1 + 3 an-2 [6] CO4 BTL6

+5^n , n>=2, a0= -2, a1=1 .


b). Solve the difference equation by boundary conditions. an - 3 an-1 =2 , [6] CO4 BTL6
n>=1, a0= 1 .
15. a). Find the homogeneous solution for the recurrence relation [6] CO4 BTL6
an=6 an-1 - 11 an-2 +6 an-3 with a0= 2, a1=5 , a2=5
To find the generating function for the sequence a_r = 3^r + 4^{r+1} , we need to define a generating function A(x) such
that:
A(x)=∑r=0∞arxr Given that a_r = 3^r + 4^{r+1} , we can split this as:
A(x)=∑r=0∞ (3^r + 4^{r+1}) x^r . This can be separated into two generating functions:
A(x)=∑r=0∞ 3^r x^r + 4^{r+1} x^r
Step 1: Find the Generating Function for ∑r=0∞ 3^r x^r
The first part, ∑r=0∞ 3^r x^r, is a geometric series with common ratio 3x, which converges for ∣x∣<1/3|x|
∑r=0∞3^r x^r = 1/{1 - 3x}
Step 2: Find the Generating Function for ∑r=0∞4^{r+1} x^r
For the second part, ∑r=0∞ 4^{r+1} x^r , we can factor out 4 from each term, rewriting it as:
∑r=0∞4∑r=0∞(4x)r 4^{r+1} x^r = 4∑∞​4r+1xr=4^r.
This is also a geometric series with common ratio 4x, which converges for ∣x∣<1 /4 :
4∑r=0∞ (4x)^r = 4/{1 - 4x}
Step 3: Combine the Results
Now we combine the two parts to find the generating function A(x):
A(x)= {1}/{1 - 3x} + {4}/{1 - 4x}
This is the generating function for the sequence a_r = 3^r + 4^{r+1} .
Determine the discrete numeric function for 7z^2 ÷(1-2z)(1+3z)
To determine the discrete numeric function for the rational function f(z) = (7z^2) / ((1 - 2z)(1 + 3z)), we can find its power series expansion
around z = 0 and identify the coefficients c_n in the series f(z) = Σ (c_n * z^n). Here's the process:
1.Partial Fraction Decomposition:
2.First, rewrite the denominator: (1 - 2z)(1 + 3z) = 1 + z - 6z^2.
3.Rewrite f(z) as: f(z) = 7z^2 / (1 + z - 6z^2).
4.Decompose 1 / ((1 - 2z)(1 + 3z)) into partial fractions: 1 / ((1 - 2z)(1 + 3z)) = α / (1 - 2z) + β / (1 + 3z).
5.Solving for α and β: 1 = α(1 + 3z) + β(1 - 2z). Comparing coefficients: α + β = 1, 3α - 2β = 0. Solving these gives α = 2/5 and β = 3/5.
6.Rewrite Using Partial Fractions:
7.Using α and β, rewrite f(z): f(z) = 7z^2 * [(2/5) / (1 - 2z) + (3/5) / (1 + 3z)].
8.Expand into Power Series:
9.Expand (1 / (1 - 2z)) and (1 / (1 + 3z)) using geometric series: 1 / (1 - 2z) = Σ (2z)^n for n = 0 to ∞, 1 / (1 + 3z) = Σ (-3z)^n for n = 0 to ∞.
10.Multiply by coefficients: (2/5) * (1 / (1 - 2z)) = (2/5) * Σ (2z)^n, (3/5) * (1 / (1 + 3z)) = (3/5) * Σ (-3z)^n.
11.Multiply by 7z^2: f(z) = (7z^2 / 5) * [Σ (2^(n+1) * z^n) + Σ ((-1)^n * 3^(n+1) * z^n)].
12.Combine Terms:
13.Combine the series: f(z) = (7z^2 / 5) * Σ [(2^(n+1)) + ((-1)^n * 3^(n+1))] * z^n.
14.Adjust the exponent of z to n + 2: f(z) = Σ [(7/5) * ((2^(n+1)) + ((-1)^n * 3^(n+1)))] * z^(n+2).
15.Identify Coefficients:
16.Let k = n + 2. Then, n = k - 2, and the coefficient c_k of z^k is:
1. If k < 2, c_k = 0.
2. If k >= 2, c_k = (7/5) * [2^(k-1) + ((-1)^(k-2) * 3^(k-1))].
17.Final Discrete Function:
18.The discrete numeric function f(n) is:
1. f(n) = 0 if n = 0 or 1.
2. f(n) = (7/5) * [2^(n-1) + ((-1)^(n-2) * 3^(n-1))] for n >= 2.
Find the generating function for a sequence where each term ar=5

let's set up the generating function A(x)as follows:


A(x)=∑r=0∞ a_r x^r Since ar=5 a for all r, we can write this as:
A(x)=∑r=0∞5 x^r
Step 1: Factor Out the Constant
We can factor out the constant 5:
A(x)=5∑r=0∞ x^r
2: Recognize the Series as a Geometric Series
The series ∑r=0∞ x^r is a geometric series with a common ratio of x, which converges for 1∣x∣<1 and has the sum:
∑r=0∞xr= {1}/{1 - x}
Step 3: Substitute the Sum
Substituting this into our expression for A(x):
A(x)=5⋅ {1}/{1 - x}
Final Answer
The generating function for the sequence ar=5 is:
A(x)=5 /.{1 - x}
solve the recurrence relation
a_n = 2a_{n-1} - a_{n-2}, ,n≥2with initial conditions a1=1.5 and a2=3,

let's proceed by using the characteristic equation method.


Step 1: Set up the Characteristic Equation
Assume a solution of the form a_n = r^n.. Substituting into the recurrence relation gives:
r^n = 2r^{n-1} - r^{n-2} . Dividing by r^{n-2} (assuming r≠0) results in the characteristic equation: r^2 - 2r + 1 = 0
Step 2: Solve the Characteristic Equation
The characteristic equation : r^2 - 2r + 1 = 0 can be factored as: ((r - 1)^2 = 0 Thus, we have a repeated root r=1.
Step 3: Write the General Solution
When there is a repeated root r=1, the general solution to the recurrence relation is:
a_n = (C_1 + C_2 n).1^n where C_1 and C_2 are constants to be determined by the initial conditions.
Step 4: Apply Initial Conditions
Now, we use the initial conditions to solve for C_1 and C_2.
1.For n=1: a1=C1+C2⋅1=1.5 so, C1+C2=1.5
2.For n=2n = 2n=2: a2=C1+C2⋅2=3 so, C1+2C2=3
3.Now, we have the system of equations:
{C1+C2=1.5 C1+2C2=3 Subtract the first equation from the second to solve for C2 :
(C1+2C2)−(C1+C2)=3−1.5 This simplifies to: C2​=1.5. Substitute C2=1.5 back into the first equation: C1+1.5=1.5 Thus:C1=0
Final Solution
Now that we have C1=0 and C2=1.5, the solution to the recurrence relation is:
an=1.5n So, the sequence {an} is given by:
an=1.5n for n≥1
Find numeric function for Find numeric function for

i) 2÷ (1- 4z^2 ) ii) 5÷ (1- z )


The formula for a geometric series expansion is: we use the formula for a geometric series:
1/(1−x) =∑n=0∞x^n,for ∣x∣<1.Here, we rewrite f(z) in a similar form: frac{1}/{1 - z} ∑∞​z^n,for ∣z∣<1.
f(z)=2⋅1/(1−4z^2) ., so: Multiply the series expansion by 5:
f(z)=2⋅∑n=0∞(4z^2) f(z)=5⋅1/(1−z)=5⋅∑n=0∞z^n.
Expanding the powers of 4z^2: .This simplifies to:
f(z)=2⋅∑n=0∞4^n (z^2)^n. f(z)=∑n=0∞5z^n.
This simplifies to: Step 2: Identify the Numeric Function
f(z)=2⋅∑n=0∞ 4^n z^{2n}. The coefficients of z^n in the series expansion are all
Identify the Numeric Function equal to 5. Thus, the numeric function is:
The coefficients of z^n are zero for all odd n, because only z^{2n} an=5,for all n≥0.
terms appear in the expansion.
For even n = 2k, the coefficient is:
a(2k) =2⋅4k=4^k .Thus:
an={2⋅2^2k,n=2k (even),0,n is odd.
.​Final Answer
The numeric function is:
an={2⋅4n/2,n is even,0,n is odd..​
Solve the difference equation by boundary conditions. an=2 an-1 + 3 an-2 +5^n , n>=2, a0= -2, a1=1 .

1. Solve the Homogeneous Equation: Consider the homogeneous part of the equation: a_n^{(h)} = 2a_{n-1}^{(h)} +
3a_{n-2}^{(h)}.
2. Assuming a solution of the form a_n^{(h)} = r^n, the characteristic equation is: r^2 = 2r + 3, which simplifies to: r^2 -
2r - 3 = 0.
3. Solving this quadratic equation: r = (2 ± sqrt(4 + 12)) / 2 = (2 ± 4) / 2, yields roots: r_1 = 3 and r_2 = -1.
4. Therefore, the general solution to the homogeneous equation is: a_n^{(h)} = C_1(3^n) + C_2((-1)^n).
5. Find a Particular Solution: For the nonhomogeneous equation, we seek a particular solution a_n^{(p)}. Since the
nonhomogeneous term is 5^n, and 5 is not a root of the characteristic equation, we try: a_n^{(p)} = A * 5^n.
Substituting into the equation: A * 5^n = 2A * 5^{n-1} + 3A * 5^{n-2} + 5^n.
1. Dividing through by 5^n: A = (2A/5) + (3A/25) + 1.
2. Solving for A: A = 13A/25 + 1, A(1 - 13/25) = 1, A = 25/12.
3. Thus, the particular solution is: a_n^{(p)} = (25/12) * 5^n.
4. Form the General Solution: The general solution is the sum of the homogeneous and particular solutions: a_n =
a_n^{(h)} + a_n^{(p)} = C_1(3^n) + C_2((-1)^n) + (25/12) * 5^n.
6. Apply Initial Conditions to Find Constants: Using a_0 = -2: -2 = C_1 + C_2 + (25/12), C_1 + C_2 = -49/12. Using a_1 = 1:
1 = 3C_1 - C_2 + (125/12), 3C_1 - C_2 = -113/12. 5. Solve for C_1 and C_2: Adding the two equations: (C_1 + C_2) +
(3C_1 - C_2) = -49/12 - 113/12, 4C_1 = -162/12, C_1 = -27/8. Substituting back: C_2 = -49/12 - C_1 = -49/12 + 27/8,
C_2 = -17/24.
7. 6. Final Solution: The explicit solution to the difference equation is: a_n = -(27/8) * (3^n) - (17/24) * ((-1)^n) + (25/12)
* (5^n)
Step 2: Find a Particular Solution
Solve the difference equation by boundary conditions. ar The non-homogeneous term is 2^r. We will look for a particular
solution of the form:
+6 ar-1 + 12 ar-2 +8 ar-3 = 2^r , r>=3, a0=0, a1=0 , a_r^(p) = K * 2^r
Substitute a_r^(p) into the original difference equation:
a2=2 K * 2^r + 6 * K * 2^{r-1} + 12 * K * 2^{r-2} + 8 * K * 2^{r-3} = 2^r
First, consider the associated homogeneous equation: Divide both sides by 2^r: K + 6K * (1/2) + 12K * (1/4) + 8K *
Copy code (1/8) = 1
a_r + 6 * a_{r-1} + 12 * a_{r-2} + 8 * a_{r-3} = 0 K + 3K + 3K + K = 1
Assume a solution of the form: 8K = 1 ; K = 1/8
a_r = λ^r Therefore, the particular solution is: a_r^(p) = (1/8) * 2^r
Substitute into the homogeneous equation: λ^r + 6 * λ^{r-1} + Step 3: Form the General Solution
12 * λ^{r-2} + 8 * λ^{r-3} = 0 Combine the homogeneous and particular solutions:
Divide both sides by λ^{r-3}: λ^3 + 6λ^2 + 12λ + 8 = 0 a_r = a_r^(h) + a_r^(p)
This is the characteristic equation: a_r = (-2)^r * (C1 + C2 * r + C3 * r^2) + (1/8) * 2^r
λ^3 + 6λ^2 + 12λ + 8 = 0 Since (-2)^r = (-1)^r * 2^r, we can write:
Finding Roots: a_r = 2^r * [ (-1)^r * (C1 + C2 * r + C3 * r^2) + (1/8) ]
(λ + 2)(λ^2 + 4λ + 4) = 0 Step 4: Apply Initial Conditions
Factor the quadratic: (λ + 2)^3 = 0 Use the initial conditions to solve for C1, C2, and C3.
General Solution to the Homogeneous Equation: C1 = -1/8 C2 = 1/4 C3 = 0 Therefore, the solution is: a_r = 2^r *
Since λ = -2 is a root of multiplicity 3, the general solution is: [ (-1)^r * ( (-1/8) + (1/4) * r ) + (1/8) ]
a_r^(h) = (-2)^r * (C1 + C2 * r + C3 * r^2) Simplify the expression if desired.
where C1, C2, and C3 are constants. Answer:
The solution to the difference equation is: a_r = 2^r * [ (-1)^r *
( (1/4) * r - (1/8) ) + (1/8) ]
Determine the discrete numeric function for (2 + 3z – 6z^2 )÷(1-2z)
Let G(z) = (2+3z-6z^2)/(1-2z) = 3z + 2 / (1 - 2z)

Now, express the generating function as:


G(z) = 3z + 2 * Σ (2z)^n, where the sum is from n=0 to infinity.
G(z) = 3z + 2(1 + 2z + 4z^2 + 8z^3 + ...)
Simplify:
G(z) = 2 + 3z + 4z + 8z^2 + 16z^3 + ...
Combine like terms:
G(z) = 2 + (3z + 4z) + 8z^2 + 16z^3 + ...
G(z) = 2 + 7z + 8z^2 + 16z^3 + ...
From the expanded series, the coefficients ana_nan​ are:
•a₀ = 2; a₁ = 7. ; aₙ = 2ⁿ⁺¹ for n ≥ 2
Conclusion
The discrete numeric function corresponding to the given generating function is:
aₙ = { 2, if n = 0 ; 7, if n = 1 and 2ⁿ⁺¹, if n ≥ 2 }
Explicit formula: a₀ = 2, a₁ = 7, and for n ≥ 2, aₙ = 2ⁿ⁺¹.
Solve the difference equation by boundary conditions. an - 3 an-1 =2 , n>=1, a0= 1 .
The corresponding homogeneous difference equation is: aₙ - 3aₙ₋₁ = 0.
The characteristic equation is: r - 3 = 0.
So, the solution to the homogeneous equation is:
aₙ^(h) = C * 3ⁿ, where C is a constant.
For the non-homogeneous equation aₙ - 3aₙ₋₁ = 2, we use the method of undetermined coefficients.
Assume a particular solution of the form: aₙ^(p) = A,
where A is a constant. Substitute aₙ^(p) = A into the equation:
A - 3A = 2. ⟹ A = -1.
Thus, a particular solution is: aₙ^(p) = -1.
The general solution is the sum of the homogeneous and particular solutions:
aₙ = aₙ^(h) + aₙ^(p) = C * 3ⁿ - 1.
Apply the Initial Condition
Use the initial condition a₀ = 1:
a₀ = C * 3⁰ - 1 = C - 1.
Since a₀ = 1, we have:
C - 1 = 1 ⟹ C = 2.
Final Solution
The solution to the difference equation is:
aₙ = 2 * 3ⁿ - 1.
From the equations:
Find the homogeneous solution for the recurrence relation
1.C1+C2+C3=2,
an=6 an-1 - 11 an-2 +6 an-3 with a0= 2, a1=5 , a2=5 2.C1+2C2+3C3=5,
Rewrite the recurrence relation as: 3.C1+4C2+9C3=5,
aₙ - 6aₙ₋₁ + 11aₙ₋₂ - 6aₙ₋₃ = 0. eliminate C1C₁C1​ by subtracting Equation 1 from
The characteristic equation is: r³ - 6r² + 11r - 6 = 0. Equations 2 and 3:
•Subtract Equation 1 from Equation 2:
The characteristic polynomial r3−6r2+11r−6r³ - 6r² + 11r - 6r3−6r2+11r−6 (C₁ + 2C₂ + 3C₃) - (C₁ + C₂ + C₃) = 5 - 2,
can be factorized. Using trial roots: C₂ + 2C₃ = 3. (Equation 4)
•Substitute r = 1: 1³ - 6(1²) + 11(1) - 6 = 0. •Subtract Equation 1 from Equation 3:
So r = 1 is a root. Thus, the characteristic equation becomes: (C₁ + 4C₂ + 9C₃) - (C₁ + C₂ + C₃) = 5 - 2,
(r - 1)(r - 2)(r - 3) = 0. 3C₂ + 8C₃ = 3. (Equation 5)
The general solution is: Solve Equations 4 and 5 for C2 and C3:
aₙ = C₁(1ⁿ) + C₂(2ⁿ) + C₃(3ⁿ),or equivalently: aₙ = C₁ + C₂(2ⁿ) + C₃(3ⁿ), •Multiply Equation 4 by 3 and subtract from Equation 5
where C₁, C₂, and C₃ are constants to be determined. 3(C₂ + 2C₃) = 3 ⟹ 3C₂ + 6C₃ = 9,
Step 4: Use Initial Conditions to Solve for Constants (3C₂ + 8C₃) - (3C₂ + 6C₃) = 3 - 9,
Use the initial conditions a0=2,a1=5,a2=5a₀ = 2, a₁ = 5, a₂ = 2C₃ = -6 ⟹ C₃ = -3.
5a0​=2,a1​=5,a2​=5: •Substitute C3=−3 into Equation 4:
1.For n = 0: a₀ = C₁ + C₂(2⁰) + C₃(3⁰) C₁ + C₂ + C₃ = 2. (Equation 1) C₂ + 2(-3) = 3,
2.For n = 1: a₁ = C₁ + C₂(2¹) + C₃(3¹) C₁ + 2C₂ + 3C₃ = 5. (Equation 2) C₂ - 6 = 3 ⟹ C₂ = 9.
3.For n = 2: a₂ = C₁ + C₂(2²) + C₃(3²) Finally, substitute C2=9 and C3=−3
C₁ + 4C₂ + 9C₃ = 5. (Equation 3) into Equation 1:
Final Solution C₁ + 9 - 3 = 2,
The homogeneous solution is: aₙ = -4 + 9(2ⁿ) - 3(3ⁿ). C₁ + 6 = 2 ⟹ C₁ = -4.
Obtain particular solution for ar + 5 ar-1 + 6 ar-2 = 3 r^2 – 2 r +1
First, solve the homogeneous version of the recurrence Expand and collect terms for r^2, r, and constants.
relation: 1.Coefficient of r^2: Combine terms to find the coefficient of
aₐ + 5aₐ₋₁ + 6aₐ₋₂ = 0. r^2: 12P*r^2.
Assume a solution of the form aₐ = λʳ. Substituting into the Set 12P = 3, so P = 1/4.
homogeneous equation gives: 2.Coefficient of r: Combine terms to find the coefficient of r:
λ³ + 5λ² + 6λ = 0 12Q - 34P.
The general homogeneous solution is: Set 12Q - 34P = -2. Substituting P = 1/4, solve for Q: Q = 13/24.
ar(h) = K1(-2)^r + K2(-3)^r. 3.Constant terms: Combine terms to find the constant: 12R +
29P - 17Q.
Assume a Particular Solution Set 12R + 29P - 17Q = 1. Substituting P = 1/4 and Q = 13/24,
The right-hand side is a quadratic polynomial: 3r^2 - 2r + 1. solve for R: R = 71/288.
Assume a particular solution of the form: Step 5: Write the Particular Solution
ar(p) = Pr^2 + Qr + R, where P, Q, and R are constants to be The particular solution is:
determined. ar(p) = (1/4)*r^2 + (13/24)*r + (71/288).
Substitute into the Recurrence Relation Final Answer
Compute the following: The particular solution to the recurrence relation is:
1.ar(p) = Pr^2 + Qr + R. ar(p) = (1/4)*r^2 + (13/24)*r + (71/288).
2.ar-1(p) = P*(r - 1)^2 + Q*(r - 1) + R.
3.ar-2(p) = P*(r - 2)^2 + Q*(r - 2) + R.
Substitute these into the recurrence relation:
[Pr^2 + Qr + R] + 5[P*(r - 1)^2 + Q*(r - 1) + R] + 6[P*(r - 2)^2 + Q*(r - 2)
+ R] = 3r^2 - 2r + 1.

You might also like