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
4 answers

Solving the recurrence relation $T(n)=T(n-1)+cn$

I've solved the recurrence relation $T(n)=T(n-1)+cn$ (where T(1)=1), getting $1+c(\frac{n(n+1)}{2}-1)$, but I can't seem to get the pre-replacement step involving $k$. Here's what I have: $T(n-1)+cn$ $T(T(n-2)+cn)+cn=T(n-2)+2cn$ $T(T(n-3)+cn)+2cn =…
mirai
  • 335
1
vote
1 answer

Deriving recursive definition from formula

I've found plenty of answer to how to do derive a formula from a recursive definition, but not how to do the reverse. For example, the formula $a_n = n(n+2)$ gives you the recursive definition of $a_1 = 3, a_{n+1} = b_n + 2n + 3$, but how would you…
1
vote
0 answers

Recurrence for the running time of a recursive version of insertion sort

I understand all the steps of the solution until the very last step (highlighted in yellow). It's not clear to me where we substitute equation (5) into. Since there were three dots below the 8th equation, I figure there were 3 more equations for a…
1
vote
2 answers

how to solve the following recurrence? $t(n)=[4-t(n-1)]^{-1}$

I am trying to solve the following recurrence : $T_n=\frac{1}{4-T_{n-1}}$ I tried various methods using range transformation but still can't figure it out.
patrice
  • 11
  • 1
1
vote
2 answers

Solving a non-linear recurrence relation.

I have a recurrence relation of the following form: $x(t+1)=\alpha x(t) t-\beta t$ Could anyone point me to a resource for how to solve the above for an arbitrary initial condition, $x(0)$?
tinyhippo
  • 153
1
vote
2 answers

How to solve $T(n) = T(n-1) + \log(n)$

I need to demonstrate that the recurrence $T(n) = T(n-1)+\log(n)$ is $T(n) \le cn\log(n)$ using the substitution method. I tried to substitute and I get $T(n) \le c(n-1)\log(n-1) + \log(n)$, but then I have no idea how to get rid of that…
Shoe
  • 157
1
vote
2 answers

terms of the recursion $x\mapsto (1/2)\cdot (x\cdot (2-x))$

As part of the programming I do, I recently stumbled into the sequence $\: \left\langle x_0,x_1,x_2,x_3,... \right\rangle \:$ defined as follows: $x_{\hspace{0.01 in}0} = 1 \qquad$ and $\qquad$ for all non-negative integers $n$, $\;\;\;…
user57159
1
vote
1 answer

solution to non-linear difference equation

Did anyone ever come across the global solution for a non-linear difference equation that looks like this: $y(t+1)=y(t)+a+b \sqrt{c y(t)+d}$. The initial condition is $y(0)=y_0$, and a,b,c and d are real numbers. Any help is more than…
I_S
  • 11
1
vote
5 answers

Solving Recurrence Relation 5

How to solve the recurrence relation given by the equation below $$T(n)=T(n-2)+T(n-4)+T(n-6)+...+T(0)$$ It seems to me that $T(n)$ will be exponential but i don't know how to proceed on this problem.
1
vote
0 answers

Finding the radian of a second-order eqn

I am really confused on what to do with the value d This is the solution I have now but not sure if it is correct or not.
JackyBoi
  • 477
1
vote
1 answer

Recursion relation for the number of ternary string that does not contain two consecutive characters.

Ternary strings are those that contain only 3 characters at most. For ex: abcbca is ternary string over set {a,b,c}, etc. Can anyone tell what will be the recursion relation for the string that does not contain consecutive characters , for ex:…
satyam
  • 11
1
vote
1 answer

Solving the recurrence relation $x_{n+2}-5x_{n+1}+6x_{n}=5^{n}+n$

SOLVE: $x_{n+2}-5x_{n+1}+6x_{n}=5^{n}+n$ How to deal with it? I use method: $r^2-5r+6r=0$ $x_{n}=A*2^{n}+B*3^{n}+..$ I can deal with similar problems: $x_{n+2}-5x_{n+1}+6x_{n}=5^{n}$ or $x_{n+2}-5x_{n+1}+6x_{n}=n$ but I have no idea for…
1
vote
0 answers

Solving the recurrence relation $T(n)=T(n−\lceil\sqrt{n}\:\rceil)+\Theta(n)$

I have an algorithm that at each step can discard $\lceil\sqrt{n}\:\rceil$ possibilities at a cost from $O(n)$. The solution to the recurrence relation below is related to the question of complexity of such…
M.Dara
  • 11
1
vote
1 answer

Solve the recurrence relation $T(n)=\sqrt nT(\sqrt n)+\ln n$

Recurrence relation is $T(n)=\sqrt nT(\sqrt n)+\ln n$ if $n>2$ otherwise $T(n)=1$. No rule can be applied here. Can anyone arrive with a solution.
ash
  • 11
1
vote
2 answers

Find all values of $ r $ such that $ a_n = r^n $ for $ n \in \mathbb{Z}_{\ge2} $ in a recurrence relation

I am trying to solve the following problem: Given the following recurrence relation: \begin{equation} a_n = 6a_{n-1} - 8a_{n-2} \ \text{ for } \ n \in \mathbb{Z}_{\ge2} \end{equation} Find all values of $ r $ so that when $ a_0 = 1 $ and $ a_1 = r $…
Donald
  • 831