2

Wikipedia mentions, that from the formula $$ T(n) \leq T(n/5) + T(n\cdot7/10) + c \cdot n $$

one can "easily" show using induction that

$$ T(n) \leq 10 \cdot c \cdot n $$

I am, as it seems, not so smart. So, can anyone tell me how to show this using induction?

user2762996
  • 121
  • 3

2 Answers2

1

Assuming that you got the base covered, here is the inductive step: $$ T(n) \leq T(n/5) + T(7n/10) + cn \leq 10c(n/5) + 10c(7n/10) + cn = 10cn. $$ (Cheating a bit, since $n$ isn't necessarily divisible by 10; but that's a problem in the recurrence.)

You can also just apply the Akra–Bazzi theorem.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
1

I am basically just paraphrasing the steps I've outlined here: https://cs.stackexchange.com/a/83650/68251.

This is assuming the base case is $T(n) \leq c$ when $n < 5$.

Claim

$T(n) \leq 10\cdot c\cdot n$

Proof by Induction (on $n$)

Basis: $n < 5 \implies T(n) \leq c < 10\cdot c < 10\cdot c \cdot n$

Induction: Assume the claim holds for any $n' < n$, we then have

$$\begin{align} T(n) &\leq cn + T(n/5) + T(7n/10)\\ &\leq cn + 10c\cdot n /5 + 10c\cdot 7n /10\\ &= cn + 10c\cdot 9n /10\\ &= 10 \cdot c \cdot n & \square\\ \end{align}$$

ryan
  • 4,533
  • 1
  • 16
  • 41