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

Recurrence equations with 2 or more recursive calls

How can I solve the following recurrence equation? Is there a general approach to solve rec. equation with more recursive calls? $$A(n) = 2A(n-1) + A(n-5)$$ $$A(0) = 1 , A(1) = 2,A(2) = 4, A(3) = 8, A(4) = 16$$ When i try to use methods from more…
0
votes
0 answers

Find the tight bound for the following.

Find a tight bound for the following recurrence. $$T(1) = 2$$ $$T(n) = T(\frac{n}{3}) + 4n$$ Using the master's theorem, I have: $$ 1 > \log{_3}{1}$$ $$k > \log{_b}{a}$$ Thus, I can conclude that $T(n) = O(n^k)$ The problem is that this seems…
TheValars
  • 505
0
votes
0 answers

solving a two variable recurrence

i have the following two variable recurrence: $$f(i,n+1) = f(i-1,n)*\frac{n-i+1}{n} + f(i,n)*\frac{i}{n}$$ $$f(0,n) = (\frac{1}{n})^{n-2}$$ $$f(i,0) = 0$$ I'm not sure which method can I try to solve this. How can i solve this equation for f(i,n+1)?…
0
votes
1 answer

finding number of subsets so that there are no two consecutive numbers in them

I already had a look at the following problem: For a given set $\{1, \dots, n\}$, how many sets are there so that there are no two consecutive numbers in them? The answer could be found by using recurrence relations, namely: $$ M_n = M_{n-1} +…
mdot
  • 947
0
votes
1 answer

Uniqueness of a solution class for a homogeneous recurrence equation

I have a homogeneous recurrence equation. $x_i = (1-p)x_{i-1} + px_{i+1}, p \in (0,1)$ Using the classical methods (solving the characteristic polynomial) I can show that if $p=1/2$, then the sequences described by $x_i = c_1+c_2i$ are solutions…
zesy
  • 2,565
0
votes
1 answer

A way to solve the recurrence relation $T_i = T_{i-1} + 2 T_{i-2} + 2^{i - 2} - (i - 2)^2$

Given the recurrence relation $$ T_i = T_{i-1} + 2 T_{i-2} + 2^{i - 2} - (i - 2)^2,\quad T_0 = 0,\quad T_1 = 1. $$ I need to solve it. I tried to solve the relation using generating function, but eventually I came to system of linear equations with…
J.Exactor
  • 215
0
votes
3 answers

problem in solving recurrence relation

I'm not able to find particular solution of $a_n-2a_{n-1}$=$3*2^n$ What i've tried Given RR is $a_n-2a_{n-1}$=$3*2^n$ For the particular solution observe the r.h.s of the equation(1) It is $3*2^n$=(a constant)*$2^n$ Consider the P.S =(a…
CY5
  • 195
0
votes
2 answers

Closed form for a certain recurrence relation

Can anybody give me a closed form for the (limit of the) recurrence relation $a_0 = 0$, $a_{n+1} = \frac12\cdot\big(1 + a_n^2\big)$? And more general: Can anybody give me a closed form for the (limit of the) recurrence relation $b_0 = 0$, $b_{n+1} =…
tender
  • 11
0
votes
2 answers

Running time recurrence relation, solving using induction

I am having a hard time figuring out how to solve such problems, here is the one I am trying to solve: T(n) = 1, if n = 1 T(n) = T(n/6) + 2T(n/3) + O(n), if n > 1 I need to show that T(n) is O(n) using induction. I am thinking that my induction step…
0
votes
1 answer

Recurrence relationship with 2 sided boundary conditions (not at 0 and 1, but at 0 and $N$)

I have a seemingly straightforward homogeneous second degree recurrence relationship. $$Z(a+2) = 3 Z(a+1) - 2 Z(a) $$ If given boundary condition of $a$ at 0 and 1, I could solve it using standard methods. I won't bore people with detail here.…
0
votes
1 answer

solving recurrence relations to solve a and b

I am asked A department store offers a budget of account to its customers. Each month interest is charged on any outstanding debt, while a fixed sum has to be repaid at the end of each month. A customer had an outstanding debt on 3…
dagda1
  • 825
0
votes
1 answer

Solve recurrence $a(n+1)= \frac{a(n)}{a(n)+2}$ with $a(0)=1$

Solving recurrence $a(n+1)= \cfrac{a(n)}{a(n)+2}$ with $a(0)=1$ Do I have to make a replace? Can someone help with initial steps? Thanks.
0
votes
2 answers

long term recurrence relations and how to recorrect the deficit

I have the following question: In a sales drive a building society is trying to gain new customers. In any 6 month period it estimates that it loses 1.5% of its customers to competitors and attracts 7000 new customers. It has 0.5 million …
dagda1
  • 825
0
votes
1 answer

Recurrence Relation Question with a sequence

I have stumbled upon a sequence (0,1,4,15,64...) as the solution to a computer science problem I have been studying. The sequence is known and is given by a(n) = n(a(n-1) + 1), a(0) = 0. My question is whether or not it is appropriate to prove this…
0
votes
1 answer

How do I find the constant values of this closed form? (linear recurrence)

I found the closed form of a linear recurrence problem but I'm having trouble finding the constant values of the closed form: $$\begin{align*} f(n)&= C_1(-1)^n + nC_2(-1)^n + C_32^n\\ f(0)&=0\\ f(1)&=1\\ f(2)&=7\;. \end{align*}$$ I don't know what…