3chapt2 & 3-1
3chapt2 & 3-1
RECURRENCE RELATIONS
The recursive definition for the Fibonacci sequence is composed of two parts, namely, the
equation: fn = fn-1 + fn-2, n 0 and the values f0 = 0 and f1=1.
Note that a recursive definition is well defined if and only if it satisfies conditions (i) and (ii)
above. If any one of these two properties is lacking, the recursive definition may not describe the
required phenomenon in a unique manner.
NONHOMOGENEOUS RELATION
Examples
Classify the following recurrence relations
For 0 ≤ n≤ 12, let pn denote the amount of Gallo’s deposit at the end of n months. Then, clearly
we have the relation: 0.005 pn-1= The interest earned on the amount pn-1 during the month, Thus;
Pn = pn-1+ 0.005 pn-1 for a 1 ≤ n ≤ 12 and p0 = $ 1000 …. (*)
represents the problem recursively. What remains is, therefore, to solve this recurrence relation
with its initial condition.
Hence, the relation in (*):
The method of undetermined coefficients, then, solves the homogeneous and the
nonhomogeneous parts separately. If the homogeneous solution (the solution of homogeneous
part) and the particular solution (the solution of the nonhomogeneous part) are denoted by an(h)
and an(p), respectively, then the general or total solution a is the sum of these two solutions:
an = an(h) + an(p).
Note that
(1) The homogeneous solution an(h) is obtained by the application of the standard methods of
solving linear homogeneous recurrence relations with constant coefficients discussed in the
preceding units of this chapter.
Example 1
Solve the recurrence relation:
an - 7an-1 + 12 an-2 = 1, n ≥ 2 with boundary conditions: a0 = 0 and a1 = 1.
Solution:
(1) Homogeneous Solution
The associated homogeneous relation is:
an – 7an-1 + 12an-2 = 0 and its characteristic equation is:
To evaluate the arbitrary constant c, we substitute the initial condition a0 = 1 in the total solution.
Thus
Example 3
Find the particular solution of the recurrence relation:
an + 5an-1 + 6an-2 = 3n2
Solution:
f(n) =3n2 an(p) = A2n2 + A1n+ A0 by (2) of GUIDE TABLE
Substituting the expression for an(p) in the RR:
Since f(n) = 5 (4)n is an exponential function and 4n is a homogeneous solution, the particular
solution will be: an(p)= An(4)n substituting this solution in the recurrence relation, we get:
Example 5
Find an explicit sequence of n that solves the recurrence relation:
Solution:
deg (v1)= 2
deg (v2)= 3
deg (v3)= 2
deg (v4)= 3
Definition: -
i) A vertex is said to be even if its degree is even number and odd if its degree is odd number.
ii) A vertex of degree zero is called isolated vertex.
iii) A vertex of degree one is called pendant vertex.
A graph with only one vertex is trivial.
Edges are adjacent if they share a common end vertex.
Minimum and maximum degree
Let G be a graph. The minimum and maximum degrees of G are denoted by δ (G) and
Δ(G) respectively and given by:
δ (G)= min {deg(v);v ɛ V (G)}& Δ (G) = max {deg v; v ɛ V (G)}
Example: Find the minimum and maximum degree of G given below.
Examples
Draw the adjacency matrix for:
Solution: Let the vertex set be ordered and labeled as V = {v1, v2, v3, v4}
Then the adjacency matrix A is:
Solution: Let the vertex set be ordered and labeled as V = {v1, v2, v3, v4}
Then the adjacency matrix A is:
Note:
1. Sum of all the entries in every row is the degree of the vertex leading the row if there is no
loop and the sum plus n if there are n loops at this vertex.
𝛼 is an open path from p4 to p6 but it is not a cycle and not a trial as well
𝛽 is not a path since there is no edge {p2,p6}in G.
is a trial (no edge is used twice) but not a cycle.
The sequence 𝛿 is a simple path as well as a trial between p4 and p6 but not the shortest path
between p4 and p6.
The shortest path between p64 and p6 is (p4,p5,p6) which has length 2.
The sequence p is a circuit of length 5.
Connectivity on nondirected graph
A graph G is connected if there is a path between any two of its vertices. That is, a graph is
connected if it is possible to go from any vertex to any other by following the edges of the graph.
A graph that is not connected is said to be disconnected.
Solution:
G is a connected graph because every pair of vertices in G forms a path.
H is a disconnected graph because no path can be constructed from vi, i = 1,2,3,4 to
vj, j = 5, 6, 7.
Theorem: - A connected graph with n-vertices must have at least n-1 edges. (i.e, E ≥n -1).
Example 2: a) A connected graph with 2 vertices must have at least (2-1) = 1 edge.
𝑛
Corollary: If G is a simple graph with number of vertices n ≥ 3 and if deg(v)≥ for all vertices v
2
in G, then G is Hamiltonian.
Example 2 : Consider the simple graph G and H given below.
G1 is a degenerate tree.
Since these graphs G1, G2, and G3 are connected acyclic graphs, i.e., connected graphs with no
cycles, then they are trees.
G4 is a forest not a tree as it is not connected.
Example 2:- Which of the following graphs is a tree. If the graph is not a tree, justify why it is
not.
Note: - For any connected graph G, we can find a spanning tree of G by Cutting - down method
We start by choosing any cycle in G and remove one of its edges - (destroying a cycle containing
this edge). We repeat this procedure until no cycle is left in the resulting graph.
Example: - In the graph G above remove the edges:
VY (destroying the cycle VWYV)
ZY (destroying the cycle VWYZV)
YX (destroying the cycle WXYW). Now, there is no cycle left and this procedure gives the first
spanning tree of G.
Welch-Powel algorithm
Step 1: Order the vertices according to decreasing sequence of degrees.
Step 2: Assign the first color c1, to the first vertex in the sequence and then in sequential order,
assign c1, to each vertex w/c is not adjacent to a previous vertices.
Step 3: Repeat step2 with a second color c2 and the subsequence of non-colored vertices.
Step 4: Repeat step 3 with color c3, the c4 and so on.
Example: Use Welch – Powel algorithm to find X(G).
Solution
Ordering the vertices in decreasing order of degrees we get:
{A5, A7, A3, A4, A2, A1, A6, A8}.
Now assign the first color c1 for A5 and A1.
Then we obtain the subsequence {A7, A3, A4, A2, A6, A8}to assign the second color c2.
That is assign c2 for A7, A6 and A2
Finally assign the third color c3 for A3, A4 and A8
G is 3 colorable
X (G) = 3