# Recent questions tagged recurrence 1
Show that in the recurrence $T(n)=\max_{0<q\leq n-1} (T(q)+T(n-q-1))+\Theta(n)$ $T(n)=\Omega(n^2)$
2
Use the substitution method to prove that the recurrence $T(n)=T(n-1) + \Theta(n)$ has the solution $T(n) =\Theta(n^2)$.
3
Use mathematical induction to show that when $n$ is an exact power of $2$, the solution of the recurrence $T(n) = \begin{cases} 2 \text{, if n=2, } \\2T(n/2)+n \text{, if n=$2^k$,for k >1} \end{cases}$ is $T(n) = n\ lg\ n$.
1 vote
4
The solution of $\sqrt{a_n} – 2\sqrt{a_{n-1}} + \sqrt{a_{n-2}} = 0$ where $a_0 = 1$ and $a_1 = 2$ is ${\Big[\frac{2^{n+1} + (-1)^n}{3}\Big]}^2$ $(n+1)^2$ $(n-1)^3$ $(n-1)^2$
5
Consider the following algorithms. Assume, procedure $A$ and procedure $B$ take $O(1)$ and $O(1/n)$ unit of time respectively. Derive the time complexity of the algorithm in $O$ -notation. algorithm what (n) begin if n = 1 then call A else begin what (n-1); call B(n) end ... $c$ So complexity should be $O(1)$. But answer is $O(n)$.What I am doing wrong?
1 vote
6
What will be solution of recurrence relation if roots are like this: r1=-2, r2=2, r3=-2, r4=2 is this the case of repetitive roots?
7
What is the general form of the particular solution guaranteed to exist of the linear nonhomogeneous recurrence relation $a_n$=$6a_{n-1}$-$12a_{n-2}$+$8a_{n-3}$+F(n) if F(n)=$n^2$ F(n)=$2^n$ F(n)=$n2^n$ F(n)=$(-2)^n$ F(n)=$n^22^n$ F(n)=$n^3(-2)^n$ F(n)=3
8
Consider the nonhomogeneous linear recurrence relation $a_n$=$3a_{n-1}$+$2^n$ in the book solution is given $a_n$=$-2^{n+1}$ but I’m getting $a_n$=$3^{n+1}-2^{n+1}$
9
You can climb up a staircase of $n$ stairs by taking steps of one or two stairs at a time. Formulate a recurrence relation for counting $a_n$, the number of distinct ways in which you can climb up the staircase. Mention the boundary conditions for your recurrence relation. Find a closed form expression for $a_n$ by solving your recurrence.
10
How many bit sequences of length seven contain an even number of 0s? I'm trying to solve this using recurrence relation Is my approach correct? Let T(n) be the string having even number of 0s T(1)=1 {1} T(2)=2 {00, 11} T(3)=4 {001, 010, 100, 111} Case 1-we add 1 to strings of length ... =T(n-1) Case 2-we add 0 to strings of length n-1 having odd number of 0s T(n)=T(n-1) Hence, we have T(n)=2T(n-1)
11
Find a recurrence relation for the number of bit strings of length n that contain the string 01.
12
Is this the correct way to solve ? Q) int algorithm(int n) { int sum =0;k,j; for (k=0;k<n/2;k++) for(j=0;j<10;j++) sum++; return 4*algorithm(n/2)*algorithm(n/2)+algorithm(n/2)*algorithm(n/2) }
13
What is the time complexity of the following recurrence relation and step to derive the same $T(n) = T(\sqrt{n}) + log(logn)$
14
A two dimensional array is stored in column major form in memory if the elements are stored in the following sequence ... can be calculated as the column number of the element we are looking for summing with the $row \times column$ number of elements. How does the above recurrence relation work?
15
T(n) = T(n/4) + T(3n/4) + n How to solve these type of problems? Can I solve this using master theorm by considering X = T(3N/4) +N THEN T(N) = T(N/4) +X CAN WE SOLVE LIKE THIS? PLEASE HELP
1 vote
16
Grammar. S → Aa | B A → Ac | Aad | bd | epsilon . .
17
What’s the trick to do it under 2 min here?
18
Consider the following piece of pseudo-code: A(n){ if(n==0) return 1; return A(√n) + B(n) + C(n) + D(n); } B(n){ if (n==0) return n; return B(n-1); } C(n){ return A (√n); } D(n){ return n; } What is the time complexity in terms of Big $\Theta$ notation for the function call to procedure A? $\Theta(n)$ $\Theta(n \log n)$ $\Theta(n \log \log n)$ $\Theta(n^2 \log n)$
19
…………………………..
1 vote
20
https://gateoverflow.in/33989/how-to-solve-below-recurrence-relation
1 vote
21
recurrence relation 2a$_{n}=a_{n-1}+2^{n}$ intial condtion a$_{0}$=1 value of a$_{100}$