Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
How can I prove the following?
T(n) = T(n0.5) + n2 = Θ(n2)
I tried to open the function declaration step by step but it got complicated and I got stuck!
We can expand the expression to:
T(n) = n2 + n1 + n1/2 + n1/4 + ...
Sum the geometric sequence:
T(n) = 2 * n2
So:
T(n) = Θ(n2)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I really couldn't solve this because it was kinda tricky to me (as a new one to Master theorem).Any help would be greatly appreciated!
I've never heard of the master theorem before. But I read this when I googled it:
T(n) = aT(n/b) + f(n)
where, T(n) has the following asymptotic bounds:
1. If f(n) = O(n^(log_b a-ϵ)), then T(n) = Θ(nlog_b a).
Here, a=4; b=4; So log_b(a)=1.
Here, f is O(1), so epsilon=3 for log_b(1)=0 and n^0=1.
So it looks like T(n) is O(n).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Can someone please clarify this solution a little more?
T(n) = 2T(n^1/2) + log n
Solution:
Let k = log n,
T(n) = T(2^k)=2T(2^(k/2)) + k
Substituting into this the equation S(k) = T(2^k)
we get that
S(k)=2S(k/2) + k
Now, this recurrence equation allows us to use master theorem, which specifies that
S(k) is O(k log k). Substituting back for T(n) implies T(n) is O(log n log log n)
How many times can you keep dividing n by 2? Log_2(n) times. Because Log_2(n) is to what power you need to raise 2, to get n.
Also loglog(n) is how many times you can take the square root of n, so maybe that substitution isn't that necessary, if you know this.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I've searched online for this but I only seem to find answers for a similar equation:
T(n) = T(n/3) + T(2n/3) + cn
But the one I'm trying to solve is:
T(n) = T(n/3) + T(2n/3)
Base case: We can assume T(a) = Theta(1) for any constant a.
I've succeeded in proving (by induction) that T(n) = O(n*log(n)). I thought the answer should be Theta(n*log(n)), but I cannot prove that T(n) = Omega(n*log(n)).
So my question is - am I correct that the answer is O(n*log(n)), and NOT Theta(n*log(n))? IF that's true that would really be great...
If I'm wrong I will of course explain where I'm stuck in the induction process...
Thanks!
P.S. If you need to, please try to explain using induction, because I haven't learned all methods for solving these problems yet.
You can't prove that it's Omega(n log n) because T(n) = n satisfies the base case and the recurrence.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Need help finding a method for solving the following:
Given f(n) to be 9f(n/3)+(n2)*(log3n) for all n > 1.
And given f(1)=1.
Solve for f(n)
I tried the master theorem, but all the 3 cases did not fit here, my guess would be using the substitution method, but I am not sure how to apply it
Use the substitution f(n) = n2g(n).
This gives us g(n) = g(n/3) + log n.
And so g(n) = Θ(log2n) and f(n) = Θ(n2log2n)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
How to prove this :
3n^2 + 6n is O(n2)
Do i have to choose 6n as a constant ?
To prove that you need to show that there exist M and x0 for which |3x^2 + 6x| <= M|x^2| for all x > x0