|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
The
difficulty is that we have
|
|
|
4
multiplies
|
|
|
| • |
Idea:
Rewrite to use just 3
|
|
|
|
multiplies
|
|
|
| • |
Compute
|
|
|
|
AC, BD,
and (A+B)(C+D) =
|
|
|
|
AC +
(AD+BC) + BD
|
|
|
| • |
The
coefficient of the middle
|
|
|
term
of
|
|
|
|
AC2n
+ (AD+BC)2(n/2) + BD
|
|
|
is
(A+B)(C+D)-AC-BD
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
The
resulting recurrence is
|
|
|
|
T(n) =
3T(n/2) + n
|
|
|
|
where
T(1) = 1
|
|
|
| • |
Its
solution is
|
|
|
|
T(n) =
O(nlog 3) » O(n1.585)
|
|
|
| • |
Wow! Why didn’t my 3rd
|
|
|
|
grade
teacher show me this?
|
|
| • |
Can
actually do better than
|
|
|
this
using the Fast Fourier
|
|
|
|
Transform
|
|
|
|