The recurrence relation for the algorithm is an eccentric form that has an additional term: $T(n) = T[\frac{n}{2}] + T[\frac{7n}{10} + 6] + n$. Exactly how can I prove that this recurrence relation leads to O(n) time complexity? The two common methods are iterative substitution and the master method however neither can be obviously applied.
Asked
Active
Viewed 37 times
0
-
It doesn't lead to a linear time complexity, not even $n \log n$ because $1/2 + 7/10 > 1$. See this answer. This time complexity will be bounded by the growth rate of the recursion tree. The levels will do more work as you get deeper into the tree. Try recursion tree analysis. – ryan Apr 30 '19 at 02:56
-
So I use the uneven split theorem? I figured I could use iterative substitution or master method but we didn't go over the theorem in class. I suspect it will be more about how the recurrence relation is derived from the algorithm. I'll modify my question to that thanks. – Code4life Apr 30 '19 at 03:39
-
The uneven split theorem as I had written it only applies to cases where the coefficients on the recursive calls sum to $\leq 1$. In your case, you have $1/2 + 7/10 > 1$, thus it will not apply. If you do recursion tree analysis, you should see the depth of the tree is bounded by $n^{\log_7(10)}$ I believe, but the work done at each level grows. First we do $n$ work, then $12n/10 + 6$, and so on. – ryan Apr 30 '19 at 03:44
-
I rolled back your edit. Your question is fine as is, I'm just giving you suggestions as comments. They may not necessarily apply directly to your question, you will have to test out similar methods. Take a look at sections 1.2 and 3.2 here, these should help you get a better idea of what to do. – ryan Apr 30 '19 at 03:45
-
Alright I'll take a look at the Akra bazzi theorem. Thanks! – Code4life Apr 30 '19 at 04:41
-
I was not referring to the Akra Bazzi theorem, but you can try that as well, it should also solve your recurrence. – ryan Apr 30 '19 at 04:53
-
Thanks again, do you know anything about geometric sums? It's also needed to solve recurrences using iterative substitution. – Code4life Apr 30 '19 at 05:04
-
First, I think it may help to see why trying to prove this is $O(n)$ won't work. If you use substitution, try to show that $T(n) \leq cn$ and see what happens. – ryan Apr 30 '19 at 05:06
-
That's a clever approach I'll definitely look into it :) – Code4life Apr 30 '19 at 05:08
-
I understood your explanation, my new question was more regards to how the recurrence equation was devised, so essentially one step before. – Code4life Apr 30 '19 at 06:44