Tagged Questions

Questions regarding functions defined recursively, such as the Fibonacci sequence.

learn more… | top users | synonyms

-1
votes
1answer
43 views

Tight asymptotic upper and lower bounds

I have a equation: $T(n) = 4T(n/3) + n\ln n$ In this equation, I have to give tight asymptotic upper and lower bounds. What does that mean? I know I can apply Master theorem (which gives me theta ...
3
votes
5answers
105 views

Solve $ x_{n+1} - x_n = 2n + 3$

Solve $$ x_{n+1} - x_n = 2n + 3, x_0 = 1, n \ge 0$$ I would try to find a homogen solution and used $$ r^2 - r = 0$$ and got $$x^h_n = A1^n$$ but this seems wrong and I'm stuck on how to continue. ...
0
votes
2answers
26 views

What is the intuitive idea behind looking for a solution of the form an=r^n for a linear homogeneous recurrence relation?

In my textbook, under solving linear homogeneous recurrence relations, it says that the basic approach for solving them is to look for a solution of the form an = rn, which yields the characteristic ...
1
vote
2answers
18 views

Recurrence Problem involving multiple dependencies.

I have 3 equations :- $r_n=r_{n-1}+5m_{n-1}$ $m_n = r_{n-1} + 3m_{n-1}$ $p_n = 5m_{n-1}$ The initial values of the sequences are $$r_0=3, m_0=1, p_0=0$$ How can I get the formula to get the nth ...
0
votes
1answer
25 views

limit of $f_n(a) = a^{f_{n-1}(a)}$ as $n$ approaches infinty for small values of $a$

So a friend started, in boredom, calculating values of what I have formalized as $f_n(a) = a^{f_{n-1}(a)}$ (also $f_0(a)=a$) for $a = 1.1$. He noticed that on his calculator it was not changing value ...
0
votes
0answers
13 views

A question on bivariate recurrence

Is there a way to get a closed form of this recurrence (albeit approximate): $$A(n ,k ) = {1 \over {d^k}}A(n-1, k-1) + (1 - {1 \over {d^k}})A(n-1,k)$$ Where, $n,k \ge 0$ and $d \ge 2$ are integers. ...
0
votes
0answers
36 views

Solving Recurrence Relations (Nonlinear?)

I'm not sure the term, but how do you solve a recurrence relation with a multiplicative factor in the index, so as opposed to $a_n=a_{n-1}+a_{n-2}$ we have something like $a_n=a_{\frac{n}{2}}$. I know ...
0
votes
1answer
22 views

How many partitions are there?

How many partitions are there for $\{1,\cdots,100\}$ for $3$ sets, $A,B,C$, such that $A$ cannot contain consecutive numbers ($\left|a-b\right|=1$) Anyway, I thought about using recurrence ...
1
vote
1answer
39 views

Limit of a recursive function

I have a recursive functoin: $$\log^{'}(n) = \begin{cases} & 1 \text{ if } n \leqslant 1 \\ & 1 + log^{'}(\log(n))\text{ otherwise} \end{cases}$$ This function grows VERY slowly. Is this ...
2
votes
1answer
30 views

Recurrence relation of the following sequence?

This is the code: for (unsigned int i = 0; i < n; ++i) if (i % 2 == 0) ++k; And this is the output for when ...
0
votes
1answer
86 views

Prove this recurrence relation? (catalan numbers)

$$C_0 = 1,\quad C_{n+1} = C_0C_n + C_1C_{n−1}+ \cdots + C_kC_{n−k} + \cdots + C_nC_0\text{ ?}$$ Where Cn denotes the number of ways of writing a valid list of open and closed parentheses of length ...
0
votes
1answer
69 views

The solution of recurrence $T(n) = 2T(\lfloor{n/2}\rfloor + 17) + n$ is $O(n\lg n)$

Given, $T(n) = 2T(\lfloor{n/2}\rfloor + 17) + n$. Show that the solution to T(n) is $O(n\lg(n))$. Here's what I tried - Assumption: $T(\lfloor n/2 \rfloor) \le c(\lfloor n/2\rfloor + 17)\cdot ...
1
vote
1answer
62 views

Segner's Recurrence Relation [closed]

Why is Segner's Recurrence Relation formula valid. Does anyone know how to prove it? I can't seem to understand why this formula works/is true. $$C_0 = 1,\quad C_{n+1} = C_0C_n + C_1C_{n−1}+ \cdots ...
1
vote
1answer
35 views

How do I create a function from this code? [closed]

Here is the code: for (int i = 1; i < n; i *= 2) ++k; I need to express this as a function. I don't know where to begin.
1
vote
2answers
37 views

$n$th derivative of $e^{-x^2}$

I observed that $f^{(n)}(x)= \begin{cases} e^{-x^2} & \text{if $n=0$}\\ -2xe^{-x^2} & \text{if $n=1$}\\ f^{(n-1)}(x)-f^{(n-2)}(x) & \text{otherwise.} \end{cases}$ How to get the closed ...
1
vote
1answer
59 views

Properties of a recursively-defined sequence using induction

This is a homework problem. Not expecting the solution, just a nudge in the right direction! $N$ is a function defined inductively as follows: $$N(1) = N(2) = N(3) = 1$$ $$N(n) = N(n−1) + N(n−3) ...
0
votes
1answer
55 views

Find Recurrence Relation of Code

Suppose A(n) be the number of stars that wrote with the following example. for n>=3, i want calculate the recurrence relation for this code. any idea or solution? ...
2
votes
2answers
49 views

Help with a recurrence relation

I have been battling with the following: $$T\left(n\right)=3T\left(\frac{n}{2}\right)+n\log(n)$$ I have tried expanding it but the term $n\log(n)$ gets very messy. What is the approach for solving ...
0
votes
1answer
27 views

Why does the sign change here?

They give the recurrence relation as: $$T(n) − 4T(n − 1) + 3T(n − 2) = 0,\ T(0) = 0,\ T(1) = 2$$ And then they say it can be written as the following for $n > 1$: $$T(n) = 4T(n − 1) − 3T(n − 2)\ ...
1
vote
2answers
36 views

Help with proof by induction

The author generates a Tower of Hanoi and looks at the sequence: $$1, 3, 7, 15, 31, 63,...$$ He guesses the recurrence relation from the first few terms: $$H_{n} = 2^{n} - 1$$ Now he wants to ...
1
vote
3answers
45 views

recurrence relation of a finite sequence

Suppose I have a sequence of vectors $v_1,v_2,\ldots,v_n$ and for $k=1,2,\ldots,n-2$ $$v_{k+2}=av_{k+1}+bv_k, \quad a,b\in \mathbb R.$$ Can I deduce that $v_{k}=Ax_1^k+Bx_2^k, k=1,2,\ldots,n$ in which ...
1
vote
0answers
12 views

Is there a way to express a closed form for a partial derivative of this recurrence relation?

Here's the relation: if $n\ge j:$ then $$ \sigma(n,j,d) = d \cdot\left( \log j-\sigma\left(\frac{n}{j}, 1+d, d \right)\right)+\sigma(n, j+d, d )$$ And here's the terminating condition if $n < j$ ...
2
votes
1answer
34 views

Time Complexity of one Example Code

i see an example on my note for calculating Time Complexity, but i couldn't understand. anyone could help me.
1
vote
2answers
72 views

How does this simplification work?

The following recursive function was given: $$T\left(n\right) = T\left(n - 1\right) + x$$ The author stated that by using repeated substitution we can solve the recurrence relation: The basic ...
2
votes
1answer
25 views

Time Complexity of one Challenging Example

Anyone would help me to calculate the order (time complexity) of this example ?
0
votes
1answer
44 views

Which case of the Master theorem applies to the recurrence $T(n)= 100T(n/99)+\log(n!)$?

How to use the Master theorem to solve $T(n)= 100T(n/99)+\log(n!)$? I was given this question, and I can't figure out which case of the master theorem goes here. Thanks for your suggestions.
2
votes
1answer
70 views

Solving recurrence relation

If I have the following recurrence relation, $$T(n) = T(\lfloor n/2 \rfloor) + T(\lceil n/2 \rceil) + n $$ How would I show that $T(n)\le cn\lg(n)+dn $ for some reals $c$ and $d$?
2
votes
1answer
62 views

The sequence $(a_0,a_1,a_2,\cdots,)$ satisfies $ a_{n+1}=a_n+2a_{n−1}$. What is $a_5$?

Assume that the sequence $(a_0,a_1,a_2,\cdots,)$ satisfies the recurrence $\displaystyle a_{n+1}=a_n+2a_{n−1}$. We know that $a_0=4$ and $a_2=13$. What is $a_5$? I got $a_1=5, a_3=23, a_4=49, a_5=95$ ...
1
vote
0answers
34 views

Finding Function Representation of Recursive Sequence

I was trying to find one of the roots of $x^2 + 4x + 3 = 0$ by deriving a continued fraction from the recursive formula $x = -3/x - 4$ (every step of the approximation you increase the recursion by ...
0
votes
1answer
46 views

On the existence/applications of infinitely-nested functions

Inside a previous question, one particular nested function shown is the known tetration. This "kind" of arbitrary repeated functions has always intrigued me, because inside their properties lie so ...
1
vote
1answer
39 views

Number of strings of size $k$ that do not have 'ab'

Consider $\Sigma = \{a,b,c\}$ and the language $L$, the set of all strings that do not contain 'ab' Find strings, of size $k$ is in $L$ ($L_k$) Consider $A_k$ (strings of size $k$ that end in $a$) ...
0
votes
0answers
42 views

Does $f(n,z)$ have $2^n$ distinct fixpoints $z$ for all $n$?

Let $f(z)$ be a given degree $2$ polynomial. Let $n$ be a positive integer. Let $f(1,z) = f(z)$ and $f(n,z)= f(1,f(n-1,z))$. How to decide if $f(n,z)$ has $2^n$ distinct fixpoints $z$ for all $n$ ?
2
votes
1answer
344 views

How many subsets does the set $\{1, 2, \dots , n\}$ have that contain no two consecutive integers if $1$ and $n$ also count as consecutive?

How many subsets does the set $\{1, 2, \dots , n\}$ have that contain no two consecutive integers if 1 and n also count as consecutive? It looks that the number of such subsets obeys the ...
4
votes
2answers
31 views

Solve $T(n) = 1 +\sum_{i=0}^{n-1}T(i)$

For the recurrence defined by $$T(n) = 1 +\sum_{i=0}^{n-1}T(i)$$ Apparently $T(n) = 2^n$ .. but I cannot see it. This recurrence pops up during analysis of the Rod Cutting Problem. I keep looking to ...
2
votes
1answer
59 views

How prove there exist postive integer $n$ such $x_{n}>y_{n}$

let two positive sequence $\begin{cases} x_{n+2}=x_{n}+x^2_{n+1}\\ y_{n+2}=y^2_{n}+y_{n+1} \end{cases}$ and $x_{1}>1,y_{1}>1,x_{2}>1,y_{2}>1$ show that: there exists $n$, such ...
6
votes
0answers
107 views

Mathematics of the Ice Bucket Challenge

I've been considering the mathematics of the now global ice bucket challenge. Simple model In the simplest incarnation, there is one original seed, who then nominates 3 others, each of which take ...
1
vote
1answer
51 views

Problematic Initial Condition of a Recurrence Relation

I encountered this equation, and tried to solve it: $T(n) = T(\sqrt{n})+log(n)$ Under the initial condition T(1)=1. Can someone tell me why is this initial condition helpful? I mean, of course ...
2
votes
1answer
31 views

Intersection of two recurrences.

I have two sequences obtained by recurrences: $$f(0) = 1, f(1) = 9, f(n+2) = 10f(n+1) - f(n)$$ $$g(0) = 1, g(1) = 7, g(n+2) = 6g(n+1) - g(n)$$ How can I prove that apart from $f(0) = g(0) = 1$, these ...
0
votes
2answers
104 views

Meaning of 'expected value' in the following problem

Ok, I have found an interesting probabilites problem on TopCoder. I have truncated the statement: "What is the expected number of dice throws needed to attain a value of at least n (candies, in this ...
5
votes
4answers
95 views

Homework | Find the general solution to the recurrence relation

A question I have been stuck on for quite a while is the following Find the general solution to the recurrence relation $$a_n = ba_{n-1} - b^2a_{n-2}$$ Where $b \gt 0$ is a constant. I don't ...
1
vote
1answer
38 views

Algorithm for retrieving all the permutations (randomized) for a vector sequence 1…N with only unique values

Here is the problem: I have a vector of $N$ elements long (containing only unique values from $1...N$). I am searching for an algorithm to obtain all the (randomized) combinations possible, where ...
10
votes
5answers
772 views

How to deduce a closed formula given an equivalent recursive one?

I know how to prove that a closed formula is equivalent to a recursive one with induction, but what about ways of deducing the closed form initially? For example: $$ f(n) = 2 f(n-1) + 1 $$ I know ...
2
votes
2answers
38 views

MNTILE SPOJ Tiling patterns

We have tiles of size 2 * 1. We need to arrange the tiles to get the floor size of m * n. For ...
2
votes
1answer
45 views

Recurrence relation from code

My Friends, Hi, I see an old book in mathematics for computer science. everyone could help me, for example how we calculate the order (Time complexity) of following code: ...
0
votes
0answers
33 views

Extensions by recursive definitions

In the Wikipedia entry on Extension by definitions I learn that an explicit definition in the language of a theory $T$ yields a conservative extension $T'$ of $T$. I wonder if this eventually does ...
2
votes
2answers
133 views

Solving a recurrence relation with square root

I ran into a bad recurrence relation. Anyone would calculate T(n) or add some hint? $$T(n) = \begin{cases} n,\quad &\text{ if n=1 or n=0 }\\ \sqrt{1/2[T^2(n-1)+T^2(n-2)]+}n ,\quad ...
2
votes
1answer
60 views

Height of Recursion Tree for $T(n, k) = T(n/2, k) + T(n, k/4) + kn$

If we use a recursion tree for solving $$\begin{cases} T(*,1)=T(1,*)=a \\ T(n,k)=T(n/2,k)+T(n,k/4)+kn \end{cases}$$ What is the height of the recursion tree? Any idea or solution highly ...
0
votes
1answer
24 views

Solving a recurrence relation with absolute values in it.

The recurrence relation is: Let $\{y_{j}\}_{j\in \mathbb{N}}$ be a sequence of integers and x a real number then define: $P_{1}(x):=y_{1}+(-1)^{1}|x-y_{1}|$ and the general j-step as ...
0
votes
1answer
42 views

What's time complexity of algorithm for “Word Break”?

Word Break(Dynamic Programming) Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible ...
4
votes
1answer
117 views

After how many steps can compositions of $x\mapsto x+1$ and $x\mapsto x^2+1$ produce the same result starting from $1$ and $3$?

This problem is from a Turkish contest: Let $P(x)=x+1$ and $Q(x)=x^2+1$. Consider all sequences $(x_k,y_k)$ such that $(x_1,y_1)=(1,3)$ and $(x_{k+1},y_{k+1})$ is either $(P(x_k),Q(y_k))$ ...