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

Solving recurrence equation in two variables

I have a recurrence, $$F(n, m) = F(n-1, m) + F(n, m-1) + F(n-1,m-1) $$ $$F(n,1) = 0$$ $$F(1,n) = 2*(n-1)$$ I would like to compute $F(N,M)$ in terms of $N$ and $M$. The system is defined for $1 \leq n \leq N$ and $1 \leq m \leq M$ where $N$ and…
J.Jack
  • 47
0
votes
1 answer

Use recurrence relations to find strings with odd numbers of 0's

You are given all n-digit strings in which each digit is 0, 1, or 2. Using the product rule and/or the sum rule, count the number of these strings that have an odd number of 0’s when n (the number of digits in the string) is equal to (a) 1 I got…
0
votes
2 answers

Solving recurrence relation $T(n) = T(n/3) + T(n/2) + n^3$

Solve the recurrence relation $T(n) = T(n/3) + T(n/2) + n^3$. Could someone help me with this question here? I have tried the problem using recurrence tree but it starts getting complicated pretty quick. How would one approach to solve such…
0
votes
2 answers

Solving the given recurrence relation by substitution

The problem $T(n)=2T\left(\frac{n}{2}\right)+\log{n}$ $T(1)=1$ I was able to come up with the solution $\Theta{(n)}$ using Master theorem. But I want to get the same solution using expansion or I guess this is also called as substitution method. I…
RajS
  • 1,317
0
votes
1 answer

Solving simple random walk recurrence

Suppose that for $1 \leq k < N$, $p_k = \dfrac{1}{2}(p_{k+1} + p_{k-1})$. Let $b_k = p_k - p_{k-1}$. I am trying to prove that $b_k = b_{k-1}$. I've tried rearranging the terms in $p_k - p_{k-1}$ but was not able to get anywhere. I would appreciate…
0
votes
3 answers

Solve recurrence equation.

Solve recurrence equation: $$\frac{y_{t+2}-y_{t+1}}{y_{t+1}} = 0.995 \frac{y_{t+1}-y_{t}}{y_{t}} $$ A friend gave me this question, but I'm not familiar with recurrence equations. I can solve it for $$k_t := \frac{y_{t+1}-y_t}{y_t} =…
user370967
0
votes
2 answers

Solve the second order linear non-homogeneous difference equations

Consider the following linear difference equation $$ f_{k} = 1 + \frac{1}{2} f_{k+1} + \frac{1}{2} f_{k-1}, 1\le k \le n-1$$ with $f_0 = f_n = 0$. How do I find the solution? I consider the homogeneous version $$ f_{k+1} - 2f_k + f_{k-1} = -1$$ and…
3x89g2
  • 7,542
0
votes
3 answers

Using a summation factor to solve a recurrence

On Princeton's Analysis of Algorithms, they discuss solving recurrence relations and they come across a line that I can't seem to decipher \begin{align} n(n-1)a_n &=(n-1)(n-2)a_{n-1} +…
phandaman
  • 107
0
votes
1 answer

Complexity of $T(n)=T(n - \sqrt{n})+n$

What is complexity of $T(n)=T(n - \sqrt{n})+n$ I tried to solve this with a few methods that I know but none of them helped me. So I decided to ask you for help.
0
votes
2 answers

Linear non-homogeneous recurrence relation problem

Solve the recurrence relation $$a_n = 2a_{n−1} + 3 · 2^{n}, a_{0} = 5 $$. Can someone help me understand this question with a simple step? I don't need a high level solution, any basic step will be appreciated. Thank you.
0
votes
1 answer

How does exactly author construct the difference equations for a tiling problem of a floor?

In the book of Difference equations by Peterson, at page 73 - 74, it is given that Example 3.22. (a tiling problem) In how many ways can the floor of a hallway that is three units wide and n units long be tiled with tiles, each of which is two…
Our
  • 7,285
0
votes
1 answer

Recurrence Function

I found them in a test but just able to solve and there are no answers announced, so please check my answer for $$I(2,n)\ ,\ I(3,n)\ ,\ I(5,3)$$ given $$I(m,1) =I(1,n) =1\ and\ I (m+1,n) +I (m,n+1) =I (m+1,n+1)$$ These are my answer $$I(2,n) =…
0
votes
1 answer

Difference equations: number of ways to distribute k candy to n boxes

In the book of Difference equations: an introduction with applications, 2nd Edition by Peterson, at page 10, question 1.11, it is asked that However, shouldn't it that formula be $$D(n,k) = D(n-1, k-1) + n * D(n-1, k)$$ I mean, the boxes are…
Our
  • 7,285
0
votes
1 answer

The number of strings of length n that only contain digits among 0...4, and do not contain the string 00.

I know similar questions have been asked before and I've had a look through them but I'm still struggling to understand, so please bear with me. The question asks you to find a recurrence relation for A of n. Solution to the question I'm not making…
0
votes
0 answers

Solving recurrence relation containing floor $A(n) = A(\left \lfloor{\frac{n}{2}}\right \rfloor)$

If you have a recurrence relation like the following, when you are solving it by iteration how do you simplify the terms? $A(n) = A(\left \lfloor{\frac{n}{2}}\right \rfloor)$ and $A(\left \lfloor{\frac{n}{2}}\right \rfloor) = A(\left…
glockm15
  • 587