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
2
votes
3 answers

Solve the following recurrence equation exactly:

Solve the following recurrence equation exactly: $$T(1) = a, T(2) = b$$ $$T(n) = T(n–2) + c$$ I'm not sure what this is asking, can someone provide some insight?
Ryde91s
  • 83
  • 1
  • 6
2
votes
1 answer

Strange square brackets in recurrence equation

I have the following recurrence given: $$a_{0}=1$$ $$a_{1}=1$$ $$a_{n}=3a_{n-2}+3a_{n-1}$$ Why is that equal to something like this?: $$a_{n}=3a_{n-2}+3a_{n-1}-2[n=1]+[n=0 ]$$ What are those brackets?
khernik
  • 1,369
2
votes
1 answer

How to solve non-homogeneous recurrence relation?

The relation is $$T(n) = T(n-1)+T(n-2)-T(n-3)+1 \quad \quad (1)$$ I tried in this way but stuck at a point . Please Help $$T(n+1) = T(n)+T(n-1)-T(n-2)+1 \quad \quad (2)$$ Subtracting $(2)$ from $(1)$ we get $$T(n+1) = 2T(n)-2T(n-2)+T(n-3) \quad…
2
votes
2 answers

If $a_{n+1} = u a_n+v a_{n-1}$, what recurrence does $a_{n+1}a_n$ satisfy?

If $a_{n+1} = u a_n+v a_{n-1}$ , what recurrence does $a_{n+1}a_n$ satisfy? You can assume that $u^2+4v > 0$. A starter question, which I have done some work on: If $a_{n+1} = 3 a_n - a_{n-1}$ , what recurrence does $a_{n+1}a_n$ satisfy? My results…
marty cohen
  • 107,799
2
votes
1 answer

How to solve the recurrence relation $T(n) = T(n - log(n)) + cn$

This recurrence relation $$ T(n) = T(n - \log(n))+cn $$ is one I came up with from a computer science problem I was studying, but I'm not sure what a closed form or precise time complexity would be. This isn't a homework problem or anything and I'm…
e13
  • 23
  • 4
2
votes
4 answers

Closed form solution to simple recurrence

I have this recurrence : $$f(i) = \begin{cases} 0 &i=0\\ 1 &i=M\\ \frac{f(i-1) + f(i+1)} 2& 0 < i < M \end{cases}$$ I have guessed that $$f(i) = \frac i M$$ and proved it via induction. What is the right way of solving it without guessing ? Later…
Cosmin1490
  • 23
  • 3
2
votes
2 answers

Solving $ T(n) = 1 + 2( T(n-2) + T(n-3) +\cdots+T(0) ) $

I have the following recurrence relation which I have obtained from an algorithm: $$ T(n) = 1 + 2( T(n-2) + T(n-3)+\cdots+T(0) ) $$ with base case $T(0) = 1$ and $ T(1) = 1 $ I would like to be able to compute an analytic formula for this as the…
elaRosca
  • 1,093
2
votes
1 answer

How to solve recurrence relation $x_{n+1} + 2x_n = 3^n$ when $x_0 = 0$

I've taken these steps: The defining equation is $r^{n+1} + 2r^n = 0$ Which we can then rewrite as $r + 2 = 0$ And we get that $r = -2$ Assuming that $x_n = x_n^h + x_n^p$ Then the homogenous solutions $x_n^h$ are $A(-2)^n$ And to find $x_n^p$ we…
2
votes
0 answers

How to solve the recurrence relation $f(n) = 1 - (1 - f(n - 1) \times (1 - p)) ^ 2$ to find a closed-form solution?

A friend of mine gave me a math problem whose answer turned out to be $$f(n) = 1 - (1 - f(n - 1) \times (1 - p)) ^ 2$$ for some fixed $p$. I'm trying to find a closed-form solution to the recurrence, if this is possible... but no matter what I try…
user541686
  • 13,772
2
votes
1 answer

Solution of recurrence relation $T(n) = \sum_{i=0}^{n-1}T(i) + n$

I would like to prove the solution to the recurrence equation $T(n) = \sum_{i=0}^{n-1}T(i) + n$ . By manually drawing out the recursion tree, I think T(n) = O($2^n$). Indeed, assuming the same for T(n) and proving by induction for T(n+1) also…
2
votes
1 answer

Solving a 3 variable recurrence relation in which the variables swap around

I was looking into a recurrence relation related to the Tower of Hanoi and how many times a particular $a,b,c$ appears where $a$ disks are on the left peg, $b$ disks are on the middle peg, and $c$ disks are on the right peg, with the final tower on…
Sherlock9
  • 245
2
votes
1 answer

Explicit form for recurrence relation

I am interested in a closed formula for this kind of sum. Let's assume $f$ is a function well-defined on $\mathbb{N}$. Let's define the following recurrence formula: $\left\{ \begin{array}{c} f_0(x) = f(x),\space x \in \mathbb{N}\\ f_{n+1}(x) =…
2
votes
2 answers

How to find the values of arbitrary constants from the initial conditions of the recurrence relation?

I have recurrence relation $x_{n+4}-3x_{n+3}+4x_{n+2}-8x_{n}=0,x_0=0$. Here I tried to solve it using the characteristic equation method. I got roots $t=-1,t=2$. General solution looks like this $a_n=(-1)^nC_1+2^nC_2$ but how can I find $C_1$ and…
sln
  • 115
2
votes
1 answer

Solving recursion $x_{n+1}=\frac{Cx_n}{1-x_n}$

Is there an exact solution (or can we get bounds on) the recurrence $$x_{n+1}=\frac{C x_n}{1-x_n},$$ where $C\in(0,1)$ and $x_0\in[0,1-C)$? I can quickly show that the solution degreases to $0$ as $n\rightarrow \infty$, but the best I can do it's to…
Niebla
  • 444
2
votes
2 answers

Is it possible to find the explicit formula for the recurrence relation $a_n = b_{n}a_{n-1} + a_{n-2}$, where $b_{n}$ are known?

Given $a_n = b_{n}a_{n-1} + a_{n-2}$ with starting conditions: $a_0 = 0,\ a_1 = 1$ I need the explicit form of $a_n$. $b_n$ are known. For example, let's say $[b_2,b_3,b_4,b_5] = [1,2,3,1]$. The first few terms of the sequence are: $0,\ 1,\ b_2,\…