Solving recurrences and proving bounds
Exercise 7.4-1 Show that the recurrence T(n)=max{T(q)+T(n−q−1):0≤q≤n−1}+Θ(n) has a lower bound of T(n)=Ω(n2). [1] Inductive hypothesis: T(n)≥n2 T(n)=max{q2+(n−q−1)2:0≤q≤n−1}+Θ(n) f(q)=q2+(n−q−1)2:0≤q≤n−1 By expanding the expression we obtain f(q)=q2+(n−q)2−2⋅(n−q)+1 f(q)=2⋅q2+n2−2nq−2n+2q+1 Now let’s find the local maxima of the function using its first derivative. Taking the first derivative with respect to q we obtain: f′(q)=ddq2q2+ddqn2+ddq−2nq+ddq−2n+ddq2q+ddq1 Since we are looking for a critical point in the graph, f′(q)=4q−2n+2=0 q=n−12 This can be either a local minima or a maxima of our function. Let’s determine it next. Let q=1 for sufficiently large n, plugging in the values in the above equation we get: $4 ...