19.07.2014 Views

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

B.4. STRASSEN’S METHOD 229<br />

If the matrices have 2 k rows/columns, then this method requires 7 k =<br />

(<br />

2<br />

k ) log 2 7<br />

multiplications rather than the classic<br />

(<br />

2<br />

k ) 3<br />

. For arbitrary sizes n,<br />

not necessarily a power <strong>of</strong> two, the cost <strong>of</strong> “rounding up” to a power <strong>of</strong> two is<br />

subsumed in the O notation, and we see a cost <strong>of</strong> O(n log 2 7 ) rather than the<br />

classic O(n 3 ) coefficient multiplications.<br />

We note that log 2 7 ≈ 2.8074, and the number <strong>of</strong> extra coefficient additions<br />

required is also O(n log 2 7 ), being eighteen additions at each step.<br />

Theorem 39 (Strassen) We can multiply two (dense) n×n matrices in O(n log 2 7 ≈<br />

n 2.8074 multiplications, and the same order <strong>of</strong> additions, <strong>of</strong> matrix entries.<br />

B.4.1<br />

Strassen’s method in practice<br />

Strassen’s method, with floating-point numbers, has break-even points between<br />

400 and 2000 rows (160,000 to 4 million elements) [DN07].<br />

B.4.2<br />

Further developments<br />

Seven is in fact minimal <strong>for</strong> 2 × 2 matrices [Lan06]. 3 × 3 matrices can be multiplied<br />

in 23 multiplications rather than the obvious 27 (but log 3 23 ≈ 2.854 ><br />

log 2 7), and there is an approximation algorithm with 21 multiplications [Sch71],<br />

giving a O(n log 3 21≈2.77 ) general method, but <strong>for</strong> 3 × 3 matrices the best known<br />

lower bound is 15 [Lic84, LO11]. In general the best known lower bound is<br />

2n 2 + O(n 3/2 ) [Lan12].<br />

In theory one can do better than Theorem 39, O(n 2.376 ), [CW90], but these<br />

methods require unfeasably large n to be cost-effective. The complexity <strong>of</strong><br />

matrix multilication has to be at least O(n 2 ) since there are that many entries.<br />

Notation 32 It is custonary to assume that the cost <strong>of</strong> n × n matrix multiplication<br />

is O(n ω ), where 2 ≤ ω ≤ 3.<br />

B.4.3 Matrix Inversion<br />

( P Q<br />

Lemma 15 (Frobenius) Let A be a square matrix divided into blocks<br />

R S<br />

with P square and nonsingular. Assume that U = S − R(P −1 Q) is also nonsingular.<br />

Then<br />

( )<br />

A −1 P<br />

=<br />

−1 + (P −1 Q)(U −1 RP −1 ) −(P −1 Q)U −1<br />

−(U −1 RP −1 ) U −1 . (B.14)<br />

The pro<strong>of</strong> is by direct verification. Note that the computation <strong>of</strong> the righthand<br />

side <strong>of</strong> (B.14) requires two matrix inverses (P and U) and six matrix<br />

multiplications (viz. P −1 Q, R(P −1 Q), RP −1 , U(RP −1 ), (P −1 Q)(U −1 RP −1 )<br />

and (P −1 Q)U −1 ). If the conditions <strong>of</strong> Lemma 15 were always satisfied, and we<br />

took P to be precisely one quarter the size <strong>of</strong> A (half as many rows and half as<br />

)<br />

,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!