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
1 answer

Asymptotic of an interesting recurrence relation

I want to study the asymptotic behavior of the following recurrence relation: $y_1=1$; $y_{n+1}=y_n+\left(1+\frac{y_n}{n}\right)^{-n}$ for $n\ge 1$. I made an initial attempt and guessed that $y_n∼Log(n)$. Any referrence or hint about this might be…
Jack
  • 33
3
votes
2 answers

Solving the recursion $T(n) = T(n-1)\cdot T(n-2)$

Given $T(1) = a$ and $T(2) = b$, solve for $T(n)= T(n-1)\cdot T(n-2)$ [For the sake of clarity,that is $T(n-1)$ multiplied by $T(n-2)$ ] It was asked in one of the entrance tests for a PHD program. I have seen some websites in which they state…
3
votes
2 answers

What is wrong with my solution for the recurrence $T(n)=2T(\sqrt{n})+\lg\lg n$?

an someone explain where did I do a mistake? Solve the recurrence relation $$T(n)=2T(\sqrt{n})+\lg\lg n$$ Let$$\lg n = m$$ $$S(m) = 2S(m/2)+\lg m$$ We know (proved in class) that $$S(m) = O(m \lg m)$$ Therefore: $$T(n)= \Theta(\lg n \cdot \lg\lg…
RUstar
  • 33
3
votes
0 answers

Solve recurrence relation merge sort

I'd like to know how I can solve a recurrence relation like the one from merge sort. I know how to solve recurrence equations that start with $a(n)=a(n-1)+(n-1)$, but I don't know how to solve recurrence equations that start with $a(2n)$ like for…
3
votes
2 answers

"Multiplication" of two linear recurrence relations

Array $a_n$ is defined as: $$a_0 = 1, \quad a_{n+1} = k_{a1}a_{n} + k_{a0}$$ Array $b_n$ is defined as: $$b_0 = 1, \quad b_{n+1} = k_{b1}b_{n} + k_{b0}$$ Array $c_n$ is defined as: $$c_n = a_{n}b_{n}$$ ($k_{a1}$, $k_{a0}$, $k_{b1}$, $k_{b0}$ are…
VividD
  • 15,966
3
votes
0 answers

recurrence relation with non constant coefficients

I'm trying to solve a second order differential equation and I got a recurrence. Can someone help to solve $$n(n-1+q)a_{n}-a_{n-3}+e\cdot a_{n-2}=0$$ where $q$, $e$, and $a_{0}$ are some real numbers with $a_{1}=0$ and $a_{2}=-e\cdot…
3
votes
1 answer

Number of ternary strings without consecutive zeroes

I am looking for a number of ternary strings of length n, that dont contain consecutive zeroes. This was already asked, but I am NOT looking for reccurence relation. Instead, I found this formula, which produces the same result : $$ \frac{\sqrt3 +…
3
votes
4 answers

Solve the recurrence relation $a_n=3a_{n-1}+n^2-3$, with $a_0=1$.

Solve the recurrence relation $a_n=3a_{n-1}+n^2-3$, with $a_0=1$. My solutions: the homogeneous portion is $a_n=c3^n$, and the inhomogeneous portion is $a^*_n=-1/2n^2-3/4n+9/8$. This results in a final recurrence relation of…
atl
  • 451
3
votes
3 answers

How to solve the recurrence $T(n) = \frac{n}{2}T(\frac{n}{2}) + \log n$

I am trying to solve the recurrence below but I find myself stuck. $T(n) = \frac{n}{2}T(\frac{n}{2}) + \log n$ I have tried coming up with a guess by drawing a recurrence tree. What I have found is number of nodes at a level:…
Jeune
  • 145
2
votes
1 answer

How to solve a q-shift difference equation?

How to solve the q-shift difference equation $W(x)=(x-a)W(xq^{-2})$? Here $W(x)$ is the unknown function. Thank you very much.
LJR
  • 14,520
2
votes
1 answer

Repeated substitution gone wrong

It was an exam question. $$ f(n)= \begin{cases} 0 & \mbox{if } n \leq 1 \\ 3 f(\lfloor n/5 \rfloor) + 1 & \mbox{if } n > 1 \\ \end{cases}$$ So by calculating some I have $f(5) = 1$, $f(10) = 4$, $f(50) = 13$. I had to solve this recurrence. So to…
Lorac
  • 123
2
votes
0 answers

How to solve these recurrences

I have this recurrence and I have tried to solve it but I am completely lost. Master Theorem cannot be applied on this at-least not without some substitution or stuff. $ i)\quad T(n) = 4 T( \left \lfloor{\frac{n}{2}}\right \rfloor + 5) + n^2$ Any…
Wajahat
  • 225
2
votes
0 answers

Complicated 2-variable recurrence

I am analyzing some kind of construction for which size satisfies the following recursion: $P(n,k)=\frac{k}{2}\log \frac{k}{2} + 1 + \frac{n}{2} + P(\frac{n}{2},k) + P(\frac{n}{2},\frac{k}{2})$ $P(k,k)=\frac{1}{4}k\log^2k - \frac{1}{4}k\log k + k -…
karp
  • 79
2
votes
2 answers

Solve recursion $p[n,m] = p[n-1,m-1] + p[n+1,m-1] + p[n,m-1]$

How to solve the recursion: $$p[n,m] = p[n-1,m-1] + p[n+1,m-1] + p[n,m-1]$$ Ideally in general, but if you need base cases: $$p[n,0] = 0 \text{ (for } n \neq 0),$$ $$p[0,0] = 1$$ I've asked a similar question previously and believe $n^{m-2}$ is…
user2469
2
votes
0 answers

How to solve a first order inhomogenous recurrence relation?

I have a recurrence relation for a fund that starts a 50 million, 6 % interest every year, and an outtake of 2 million/year. How to find out a solution for what funds exists after n years? $$x_{n+1}=x_{n}*1.06-2$$ $$ x_{0}=50$$ Under are my…
bogen
  • 155