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

How to solve given recurrence relation for a given n and k?

Given a recurrence relation as follows: $$ T(n,k) = \begin{cases} 1, & \text{if $n \leq k$} \\ T(n-1,k) + T(n-2,k) +... + T(n-k,k) & \text{otherwise} \end{cases} $$ Find $T(n,k)$. Link to question: https://www.codechef.com/problems/KFIB As the…
user3243499
  • 369
  • 5
  • 16
1
vote
1 answer

Recurrence relationer of intersection points formed by the diagonals of a convex polygon.

Derive a recurrence relation to represent the number of intersection points formed by the diagonals of a convex polygon with n vertices. Show that the solution of the recurrence relation is $\binom n4$. I have derived the recurrence relation but…
1
vote
3 answers

Can a recurrence relation have more than one exact solution?

Can a homogeneous linear second degree relations with constant coefficients have more than one exact solution? Consider the following $T(n) + aT(n - 1) + bT (n - 2) = 0$ Some equations of this form have a general solution of the form: $T(n) = c_1r^n…
1
vote
2 answers

Solving $a_k=a_{k-1}^2 -2$

How do I solve this recurrence relation for a given $a_0$? I only know how to do linear ones by substituting $a_k=\lambda^k$ and solving for $\lambda$ but this doesn't work here
user544680
1
vote
2 answers

general solution for a recurrence relation

I have the following recurrence relation: $$x_1=1, x_2=a, x_{n+2}=ax_{n+1}-x_n\hspace{1cm}(*)$$ If we assume that $x_n=r^n$ is a solution for the relation $x_{n+2}=ax_{n+1}-x_n$, then I can deduce that $r=\frac{a+\sqrt{a^2-4}}{2}$ or…
Chilote
  • 4,239
1
vote
2 answers

How to find the order of a recurrence relation

I have some homework that I'm working on where there is a whole section of problems I need to solve taking the following form: "Assume that T(1) = 1, and find the order of function T(n)." I have no idea what this means, really, and I'm having…
1
vote
3 answers

Solve the recurrence relation with no initial conditions

Solve the recurrence relation $$a_n = 6a_{n-1} − 12a_{n−2} + 8a_{n−3} + 3$$ I forgot how to these kind of questions. I remember that the condition for $n$ should be $n \ge 3$. How should I approach after? Thank you.
1
vote
1 answer

How to solve this weird recurrence relation

So i have the following recurrence relation: $f(x) = f(x-2) + f(x-3)$ $f(1) = 1$, $f(2) = 2$, $f(3) = 2$ And also absolutely no idea how to solve it, does anyone have a hint?
1
vote
1 answer

Solving recurrent equation $a_1=3; a_2=1; a_n = a_{n-1} + 2a_{n-2}+2$

I have the following recurrent equation $ a_1=3\\a_2=1\\a_n=a_{n-1}+2a_{n-2}+2 $ and I cannot seem to be able to solve it correctly. According to wolframalpha and my math textbook (that contains results but not the actual process), the result should…
kubci98
  • 113
1
vote
1 answer

recureence relation $T(n,m) = 2T(\frac{3n}{2},\frac{m}{2})+O( n^2 )$

What is asymptotic order of $T(n,m)$ where $$T(n,m) = 2T\left(\frac{3n}{2},\frac{m}{2}\right)+O( n^2 )$$
mahdi
  • 341
1
vote
1 answer

Recurrence Relations Calling Each Other

I have n recurrence relations of the following form: For $i=1$: $v_1(t) = \frac{1}{2}v_1(t-1) + \frac{1}{2}v_2(t-1)$ for $1
Jannik
  • 355
1
vote
1 answer

Proving recurrence equation $T(n)=T(\frac{n}{4})+T(\frac{n}{2})+n^2$ is $\theta(n^2)$

$T(n)=T(\frac{n}{4})+T(\frac{n}{2})+n^2$ I tried to solve this problem by recurrence equation. By recursion tree, I can know the rule of cost, $\frac{5^0}{4^0}n^2, \frac{5^1}{4^1}n^2, \frac{5^2}{4^4}n^2....$ But There is no height, so I used upper…
haram
  • 147
1
vote
1 answer

Use the substitution $A_n=r^n$ to solve each of the recurrence relation

Use the substitution $A_n=r^n$ to solve each of the recurrence relation: (a)$2A_n=7A_{n-1}-3A_{n-2}; n \ge 0;A_0=A_1=1$ (b)$2S_n=7S_{n-1}-3S_{n-2}; n \ge 0;S_0=S_1=1$ This is a problem in my study guide and (a) and (b) seems the same problem to me.…
nova_star
  • 463
1
vote
2 answers

Floor function equivalence

For $k\ge0$ and integer Given this function $f(k)=\frac{1}{2}(3^k-1)$ Which is equal to this recurrence relation $f(k)=3f(k-1)+1$ It follows that $f(k-1)=\frac{f(k)-1}{3}$ But I am also told that $f(k-1)=\left\lfloor\frac{f(k)}{3}\right\rfloor$ I am…
johnson
  • 482
1
vote
2 answers

Methods to solving $a_{n+1} = \frac{a_{n}}{a_{n} - 1}$

I have looked on the Wiki page for recurrence relation, and there is a section titled "rational difference equations", which fits my problem of solving $$a_{n+1} = \frac{a_{n}}{a_{n}-1}.$$ But the method on that page does not seem to work. Can…
Freddie
  • 1,759