Exercise Lover

May 24, 2009

Exercises 28.2-6

Filed under: 28.2 — yuhanlyu @ 11:55 am

(a + bi)(c + di) = (ac – bd) + (ad + bc)i. Let A = (a+b)(c+d), B = ac, C = bd. (a+bi)(c+di) = (B-C) + (A – B – C)i.

Exercises 28.2-5

Filed under: 28.2 — yuhanlyu @ 11:49 am

We can divide kn * n matrix into k n * n matrix, also divide n * kn matrix into k n * n matrix. Then we use the Strassen’s algorithm to multiply these 2k matrix to get the final result. The time complexity is O(k^2 n^{\lg 7}).

Exercises 28.2-4

Filed under: 28.2 — yuhanlyu @ 11:46 am

\log_68 132464 =2.79512849, \log_70 143640 =2.79512269, \log_72 155424 =2.79514739, \lg 7 = 2.80735492. The second method is best and all three methods are better than Strassen’s algorithm.

Exercises 28.2-3

Filed under: 28.2 — yuhanlyu @ 11:42 am

Divide the matrix into 9 parts and use new multiply method to get the result recursively. The resulting algorithm can run in O(n^{\log_3 k}), if \log_3 k < \lg 7, then the algorithm can run in time o(n^{\lg 7}).

Exercises 28.2-2

Filed under: 28.2 — yuhanlyu @ 11:38 am

Enlarge the matrix such that n is power of 2 and the adding entriesa are zero.

Exercises 28.2-1

Filed under: 28.2 — yuhanlyu @ 11:36 am

Blog at WordPress.com.