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

Solving recurrence $T(n) = 8T(\frac n3) +T(\frac n3 + 1) + n$

Solving recurrence $T(n) = 8T(\frac n3) +T(\frac n3 + 1) + n$ Is there some general idea when solving recurrences like this? I tried substituting $n\to 3n$ and got: $T(3n) = 8T(n) + T(n + 1)$ which is a little more approachable but still, I can't…
C. Cristi
  • 3,283
1
vote
0 answers

Solving special recurrence relation in two variables?

Consider a function of two variables $f(x,y)$. I am interested in solving the recurrence relation $$a \left(f(x,y-1)-f(x,y+1)\right)=b \left(f(x-1,y)-f(x+1,y)\right)$$ for a most general $f(x,y)$, where $a$ and $b$ are constants. Unfortunately, I am…
Kagaratsch
  • 2,239
1
vote
1 answer

Inhomogeneous recurrence relation: $x(n) = 2x(n-1)+(n\bmod 2)$

How can I solve a recurrence relation given as $$x(n)=\begin{cases} 2 x(n-1)+1 &n=\text{odd}\\2 x(n-1) & n=\text{even}\end{cases}$$ I know how to solve them individually,$x(n)=a(2^n)$,where $a$=constant (for homogenous part) and $x(n)$=some…
user71067
  • 113
1
vote
1 answer

Stuck finding a recursive recurrence relation.

I am analyzing the following algorithm: QUANT(n): if n == 0 or n == 1: return 1 else return (n-1)*QUANT(n-1) + n I need to find the recurrence relation of this algorithm and prove it using mathematical induction. Here is what I have tried so…
user52272
1
vote
1 answer

Solving Recurrence Solve $\ T(n)= n^2/2* T(n/2)+n^4/8*T(n/4),T(1)=T(2)=1 $

Well... I've tried hard... The problem is Solve $\ T(n)= n^2/2* T(n/2)+n^4/8*T(n/4),T(1)=T(2)=1 $ for all values of n that is a power of 2. Actually, I do only know that I can let $\ n=2^m$ ...However, I have no idea than:(
1
vote
1 answer

Difference equation general solution of an inhomogenous LDE (recurrence relation)

I am having troubles in understanding the answer $L=(\rho-1)^2(\rho -3)$ of one my exercises. Consider the difference equation: $$ y(n+1) - 2 y(n) = 3n + 3^n\tag{1} $$ Determine the general solution of (1). Answer We use the annihilator method to…
1
vote
2 answers

Recurrence. Nonhomogeneous recurrence relation.

Given the following recurrence relation: $$ {a_{n+1}}={(a_{n})}^2-2 ,\\a_0=\frac{5}{2}$$ Prove that $\left \lfloor{a_{n}}\right \rfloor $ is a power of 2 for every natural number n, using recurrence equation transformations ( i.e. without…
1
vote
1 answer

Is there a solution for this non-linear recurrence relation?

One statistics course of mine has the following recurrence. $$p(n)=\frac{0.16p(n-1)+0.8p(n-2)+0.72p(n-3)}{n}$$ Assuming I know $p(0),$ is there a general formula for getting a solution?
1
vote
2 answers

Give an asymptotic upper bound of this recurrence relation : $T(n) = 2\cdot T(n^{1/2}) + n$

I unrolled the recursion and got this: $T(n) = 2^k\cdot T(n^{1/2^k}) + [2^0\cdot n^{1/2^0} + 2^1\cdot n^{1/2^1} + 2^2\cdot n^{1/2^2}+\cdots+2^{k-1}\cdot n^{1/2^{k-1}}]$ I considered every $n^{1/2^i}$ as $n$. $\begin{align} T(n)&\leq 2^k\cdot…
1
vote
2 answers

Solve the recurrence relation f() = f(/2) + 1.

I am looking for some feedback/guidance on how to solve this recurrence relation. $\mathit f(n)$ = $\mathit f \left( \frac n 2 \right) +1$ where $\mathit n=2^{k}$, $\mathit k = 1, 2, 3 . . . $ and $\mathit f(1) = 1$ So far this is what I have, but I…
Chairman Meow
  • 796
  • 1
  • 8
  • 24
1
vote
3 answers

closed form for this recurrence

I am having trouble figuring out if the following recurrence has a closed form: $$f(n)=2f(n-1)+(n-1)2^{n-2}$$ I have never really done such problems, so I dont know what is a good strategy. I will appreciate any hints! Edit: $f$ is defined for…
etotheipi
  • 349
1
vote
2 answers

Finding a closed form solution for recurrence

Consider the following recurrence: $P(1) = 3$ $P(n) = 3nP(n-1)$ I have to find a closed form for this recurrence. Expanding it a bit, we get: $$P(n) = 3nP(n-1) = 3n(3(n-1)P(n-2)) = 3n(3(n-1)3(n-2)P(n-3)) = 3^3n(n-1)(n-2)P(n-3)$$ The pattern looks…
1
vote
2 answers

Determine a formula where $f: \mathbb{N}\rightarrow \mathbb{N} $ and $f$ is given by $ f(n+2)=(1/2)(f(n+1)+f(n))$.

Determine a formula where $f: \mathbb{N}\rightarrow \mathbb{N} $ and f is given by $ f(n+2)=(\frac{1}{2})(f(n+1)+f(n))$ and $f(1)=1, f(2)=2$. I can't manage to transcribe a recursive formula to an explicit function. This is not a duplicate…
1
vote
1 answer

How to solve this recurrence relation: $T(n)=n⋅T(\sqrt n)+O(1)$?

How to solve this recurrence relation: $T(n)=n⋅T(\sqrt n)+O(1)$? I tried to use telescoping to substract, but I get stucked.. $T(n) = nT(\sqrt n)+ O(1)$ $T(n) = nT(\sqrt n) + c$ $T(n) = n(\sqrt nT(n^{1/4}) + c)+ c$ $T(n) =n^{3/2}T(n^{1/4}) + nc+…
1
vote
5 answers

Solving a nonhomogeneous linear recurrence relation

Let's have a look at this supposedly simple relation: $$ \begin{cases} f(n)=2\cdot f(n-1)+n \\ f(1)=1 \end{cases} $$ After a few expansions, for $n=5$, we get $$ \begin{align} f(5)&=2(2(2(2f(1)+2)+3)+4)+5) \\ &=2^4f(1)+\sum_{i=0}^{3}{2^i\cdot…
matan129
  • 159