Questions tagged [recurrence-relations]

Questions regarding functions defined recursively, such as the Fibonacci sequence.

A recurrence relation is an equation that recursively defines a sequence or multidimensional array of values: once one or more initial terms are given, each further term of the sequence or array is defined as a function of the preceding terms.

Simple examples include the geometric sequence $a_{n}=r a_{n-1}$, which has the closed-form $a_{n}=r^n a_0$, the aforementioned Fibonacci sequence with initial conditions $f_0=0,f_1=1$ and recurrence $f_{n+2}=f_{n+1}+f_n$, and series: the sequence $S_n =\sum_{k=1}^{n} a_k$ can be written as $S_n= S_{n-1}+a_n$.

The term order is often used to describe the number of prior terms used to calculate the next one; for instance, the Fibonacci sequence is of order 2.

See the Wikipedia page for more information.

8985 questions
1
vote
1 answer

Solving the recurrence $T(n) = T(n/2) + cn \cdot \lg \lg n - 1$

I'm trying to solve the recurrence $$ \begin{eqnarray} T(n) & = & T\left( \frac{n}{2} \right) + cn\lg \lg n - 1\\ T(2) & = & 0 \end{eqnarray} $$ where $\lg n = \log_2 n$ to get the higher-order term exactly (in terms of $c$, presumably). I first…
xjtian
  • 165
1
vote
1 answer

Is the solution to this recurrence correct?

I'm working on a problem that resulted in the following recurrence (which I think is wrong, but that's not the question here): $$ (n-i)*2i*Z_i = n(n-1) + (n-i)(i+1)Z_{i+1} + (n-i)(i-1)Z_{i-1} $$ Subject to $Z_n = 0$. The solution for $i=1$ to the…
1
vote
0 answers

General solution to recurrence $f_{x,y}=-f_{{x-1},{y-1}}f_{{x},{y-1}}f_{{x+1},{y-1}}-f_{{x},{y-1}}f_{{x+1},{y-1}}+f_{x,{y-1}}+f_{{x+1},{y-1}}$?

Does anyone have any idea how to solve this recurrence relation in the general case? $$f_{x,y}=-f_{{x-1},{y-1}}f_{{x},{y-1}}f_{{x+1},{y-1}}-f_{{x},{y-1}}f_{{x+1},{y-1}}+f_{x,{y-1}}+f_{{x+1},{y-1}}$$ I can solve the relation corresponding to each…
alspmrg
  • 11
1
vote
2 answers

Closed form of a specific recurrence relation

I have the following equation which I am trying to find the closed form for: $$ x_{n+1} = \frac{1}{2}-\frac{x_{n}}{2}$$ So far rearranging and substituting has yielded the following equations: $$2x_{n+1}+ x_{n-1} = 1$$ $$2x_{n+1} = x_{n}+…
Muzzi
  • 13
1
vote
1 answer

Proof for the general solution of difference equation

Can some give me a proof of the general solution to difference equation? For example in my time series book I have the following difference equation: $u_n - \alpha_1 u_{n-1} - \alpha_2 u_{n-2} = 0, \;\;\;\;\;\alpha_2 \neq 0 \;\;\; n = 2, 3, ...$…
jjepsuomi
  • 8,619
1
vote
2 answers

Second-order difference equation solution

Say we have a second-order difference equation: $$x_n = x_{n-1} + x_{n-2} $$ Many of the notes that I have found online regarding how to solve this type of equation will have a step such as "guess" $x_n=Ar^n$. What is the intuition behind this…
1
vote
1 answer

How do I solve an LTI difference equation where a Kronecker delta or a unit step is the input?

In my mind, the steps are 1: Find the homogeneous solution using the characteristic equation 2: Use "undetermined coefficients" method of finding the particular solution. However, what is the form of the particular solution for these kinds of…
1
vote
2 answers

Total cost at a depth of i for $T(n) = 4T(n/2 + 2) + n$

What is the total cost at a depth of i for the recurrence relation $T(n) = 4T(n/2 + 2) + n$? I understand that at a depth of i, the number of nodes is $4^i$. Without the $ + 2 $ term the total cost at a depth i would be $4^i * n/2^i$, but the $+2$…
1
vote
0 answers

What is the method to solve the relation: $a_n = \frac{a_{n-1}}{a_{n-2}}$, with $a_0 = k_0$ and $a_1 = k_1$?

Below I did a development of the recurrence starting in $k_0$ and $k_1$. (with $k_0, k_1 \neq 0$) Note that the sequence is alternated and we get a constants values for each class of $n$: $$a_n = \begin{cases} k_0, & \text{if $n$ is {0,6,12,...}}…
Fractall
  • 103
1
vote
1 answer

Find a closed-form solution for the following recurrence

$$T(n) =\begin{cases}5, & \text{if $n=1$} \\2T(n-1)+3n+1, & \text{if $n\geq 2$}\end{cases}$$ Now the answer is as such: $T(n)=5\cdot 2^{n-1}+\sum_{i=2}^n2^{n-i}(3i+1)$, which I certainly understand. $=(3n+6)2^{n-1}-3n-1-3\sum_{i=1}^{n-2}i\cdot…
Andes Lam
  • 354
1
vote
1 answer

finding the closed form of $ T(n) = 4T(n/4) + 5n$

I am trying to use "telescoping" demonstrated in this tutorial https://www.youtube.com/watch?v=lPCS2FFyqNA to solve this recurrence relation. I started it off below, but quickly lost my way. Might anyone show the process for breaking down this…
1
vote
1 answer

Recurrence relation to find number of ways to cover $2 \times n$ board with $2$ types of blocks

My task is to work out the generating function of $a_n$ series, in which $a_n$ is the number of ways to cover $2 \times n$ board with arbitrarily rotated blocks of type $A$ (bigger) and $B$ (smaller): For the base of recurrence we should consider…
whiskeyo
  • 454
1
vote
3 answers

Simple Solutions to Homogeneous Recursions

Let $b_n - 2b_{n-2} + b_{n-3} = 0$ be a linear homogeneous recursion. I was able to solve this using a characteristic equation but deriving coefficients became incredibly messy. However, I thought this should be a very simple recursion to solve. …
user71443
  • 223
1
vote
0 answers

How to show the asymptotic behavior of a recurrence relation?

I have a question on a recurrence relation, which is $$f(x) = (1-(1-e^{-1})\frac{x}{x+1})x.$$ Consider a sequence starting from 1, i.e. $\{f^n(1)\}$. I find that when $n$ is large, $f^n(1)$ is very close to $\frac{1}{(1-e^{-1})n}$ by using a program…
1
vote
1 answer

Solve the recurrence relation $T(n)=2T(\frac{n}{2})+2$ when n is a power of 2

When n is 1, $T(n)=0$, when n is 2, $T(n)=2$, and when n is greater than 2, $T(n)=2T(\frac{n}{2})+2$. I am supposed to solve this exactly, not in big O notation. Since n is a power of 2, let…