Solving an inhomogenous linear recurrence with two approaches gives back inconsistent results. In t

Winigefx

Winigefx

Answered question

2022-06-13

Solving an inhomogenous linear recurrence with two approaches gives back inconsistent results.
In the textbook Mathematics for Computer Science (2004) by Lehman there is an example question in chapter 13.4.1 that tries to solve an inhomogenous recurrence:
f ( 1 ) = 1 f ( n ) = 4 f ( n 1 ) + 3 n
By the textbook's method where you first solve the homogenous recurrence f ( n ) = 4 f ( n 1 ), and then find a particular solution for f ( n ) = 4 f ( n 1 ) + 3 n , and then guess the particular solutino to be of the form d 3 n . Finally you solve for the constants, giving the answer of f ( n ) = 5 2 4 n 3 n + 1 . However by another method gives a different answer f ( n ) = 2 4 n 1 3 n 1 . The method is shown as follows:
a n = 4 a n 1 + 3 n a n 3 n + 1 3 = 4 3 ( a n 1 3 n 1 + 1 3 )
Solve f(n) as a regular geometric sequence and I had the above result. What's gone wrong with my approach? Or did I miss something in the transformation?

Answer & Explanation

Zayden Wiley

Zayden Wiley

Beginner2022-06-14Added 21 answers

Step 1
a n = 4 a n 1 + 3 n a n 3 n = 4 3 a n 1 3 n 1 + 1 a n 3 n + k = 4 3 ( a n 1 3 n 1 + k ) + 1 k 3
Now choose k = 3 so that 1 k / 3 = 0, and let b n = a n 3 n + 3. Then
b n = { 4 3 b n 1 if  n > 1 a 1 3 1 + 3 = 10 3 if  n = 1
So b n = 10 3 ( 4 3 ) n 1 ,,
which implies that a n = 3 n ( b n 3 ) = 3 n ( 10 3 ( 4 3 ) n 1 3 ) = 10 4 n 1 3 n + 1 = 5 2 4 n 3 n + 1
Step 2
An alternative approach is to let A ( z ) = n 1 a n z n be the ordinary generating function and deduce
a 1 z 1 + n 2 a n z n = a 1 z 1 + 4 n 2 a n 1 z n + n 2 3 n z n A ( z ) = z + 4 z A ( z ) + ( 3 z ) 2 1 3 z .
So A ( z ) = z + ( 3 z ) 2 1 3 z 1 4 z = z + 6 z 2 ( 1 4 z ) ( 1 3 z ) = 1 2 + 5 / 2 1 4 z 3 1 3 z = 1 2 + 5 2 n 0 ( 4 z ) n 3 n 0 ( 3 z ) n = 5 2 n 1 ( 4 z ) n 3 n 1 ( 3 z ) n = n 1 ( 5 2 4 n 3 n + 1 ) z n ,
which immediately implies that a n = 5 2 4 n 3 n + 1 ..

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?