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

How do I solve the following recursion $g(n) =\sqrt n\cdot g(\sqrt n) +2n + \frac{n-\sqrt n}2$?

I am trying to solve the following recurrence relation : $$g(n) =\sqrt n\cdot g(\sqrt n) +2n + \frac{n-\sqrt n}2$$ The Master theorem does not fulfill because of $\sqrt n$, so I tried to change the variables $m=\log(n)$ and then got stuck when I…
3
votes
0 answers

how to solve this recursive equation $a_{n+2}=n(a_{n+1}-xa_n)$

How to solve the following recursive equation? $$a_1=1,a_2=0$$ $$a_{n+2}=n(a_{n+1}-xa_n),\quad n\geqslant 1.\tag{1}$$ From (1) we have $$a_{3}=-x, \quad a_4 = -2 x, $$ $$a_5 = 3 (-2 + x) x, \quad a_6 = 4 x (-6 + 5 x),\cdots$$ This problem showed up…
mike
  • 5,604
3
votes
3 answers

Recurrence relation, find general term

How do you find the general term of this recurrence relation? $A(n)=c n+A(\lfloor n/2 \rfloor)$ for $n>2$, $ A(n) = 1 $ for $n=2$, where $c$-constant
mira
  • 31
3
votes
1 answer

How to derive closed-form solution to recurrence relation involving reciprocal

I have been trying to find the closed-form solution for: $$T(n) = \dfrac{1}{2}\left(T(n-1)+\dfrac{1}{T(n-1)}\right)$$ I wasn't getting anywhere, so I tried WolframAlpha, which gave me: $$T(n) = -i\cot(k2^n)$$ For some $k$. So far so good. With a bit…
tohoho
  • 153
3
votes
1 answer

Asymptotic of $T(n) = T(n-2) + \frac{1}{ \lg n}$

Trying to determine asymptotic of $$T(n) = T(n-2) + \displaystyle\frac{1}{ \lg n}$$ $$\lg n = \log_{2}n $$ Last term $\frac{1}{ \lg n}$ give me a lot of trouble. Iterative method doesn't work. Tried change of variables, there is nothing to change.
newprint
  • 155
3
votes
3 answers

Solving a non-homogeneous linear recurrence relation

So i have this non-homogeneous linear recurrence relation to solve: $$a_{n}=2a_{n-1}-a_{n-2}+2^n+2$$ $a_{1}=7$ and $a_{2}=19$ I know that the non-homogeneous part is $2^n$ and i know how to solve homogeneous linear recurrence relations, but when i…
3
votes
1 answer

Solving recurrence relation $T(n) = \sqrt{2T\left(\frac n2\right)} + \log_2n$

How to solve the recurrence relation: $\displaystyle T(n) = \begin{cases} \sqrt{2T\left(\frac n2\right)} + \log_2(n) & \mbox{if }\ n>2\\ 1 & \mbox{if }\ n\leq2 \end{cases}$ n is set of all real numbers I am not sure how to remove the sqrt, by some…
3
votes
3 answers

Why does this method for solving recurrence relations work in some cases and not in others?

I have been reading on recurrence relations and I have seen that some of them are really easy to solve, for example: $$a_{n+1}=a_n^2$$ Starting from $n=0$ and substituting yields a pattern that is simple enough to take advantage of, after a proof by…
GuPe
  • 7,318
3
votes
0 answers

Is it possible to find the nth term of this recursive sequence?

I have the following sequence: $$x_n= y - sgn(x_{n-1}) \cdot |b\cdot x_{n-1} - c|^{0.5}$$ $$x_1=0$$ Is there a way to find $x_n$ without knowing $x_{n-1}$?
Nico A
  • 4,934
  • 4
  • 23
  • 49
3
votes
1 answer

Tough Recurrence Relation

I'm trying to find a recurrence equation solution to $$f(n)=a(n)f(n-1)+f(n-2)$$ with the initial conditions that $f(-1)=0, f(-2)=1$ and $$a(n)=\frac{c}{2}(1+(-1)^n)-\frac{d}{n+1}(1-(-1)^n)$$ with some constants $c$ and $d$. Alternatively we could…
tyobrien
  • 3,469
3
votes
5 answers

Prove upper bound for recurrence

I am working on problem set 8 problem 3 from MIT's Fall 2010 OCW class 6.042J. This is covered in chapter 10 which is about recurrences. Here is the problem: $$A_0 = 2$$ $$A_{n+1} = A_n/2 + 1/A_n, \forall n \ge 1$$ Prove $$A_n \le \sqrt2 + 1/2^n, …
3
votes
2 answers

recurrence relation number of bacteria

Assume that growth in a bacterial population has the following properties: At the beginning of every hour, two new bacteria are formed for each bacteria that lived in the previous hour. During the hour, all bacteria that have lived for two hours…
arina
  • 55
3
votes
0 answers

Solving recurrence relation, no clue how to approach

I'm trying to solve the following recurrence relation $$T(n)\le T\left(\frac{3n}{4}\right)+T\left(\frac{n}{\log n}\right)+C\cdot{n}\log\log n$$ The answer should be $T(n)=\Theta(n \log\log n)$ and I can show it by induction, but how should one…
Galc127
  • 4,451
3
votes
2 answers

Solution to recurrence relation: $f(x) = f(x-2)+f(x/2)$ for even $x$, $f(x)=f(x-1)$ for odd $x$.

I need to find a solution for, or at least a way to compute efficiently, the following recurrence equation: $$f(x) = \begin{cases} f(x-2)+f(x/2), & \text{if $x$ is even} \\ f(x-1), & \text{if $x$ is odd.} \end{cases}$$ Also, $f(0)=f(1)=1$. I…
mustafa
  • 33
3
votes
2 answers

Linear multivariate recurrences with constant coefficients

In the theory of univariate linear recurrences with constant coefficients, there is a general method of solving initial value problems based on characteristic polynomials. I would like to ask, if any similar method is known for multivariate linear…
042
  • 1,025