Docsity

Linear Algebra and Probability - Assignment Solutions | MATH 202, Assignments of Linear Algebra

Toggle sidebar
bg1
Department of Mathematics Linear Algebra and Probability
Homework Key
Recommended Problems
Wednesday, February 25
Assignment:
•Suppose Aand Bare n×nmatrices and vis a column vector with nelements. How
many FLOPs are required to compute (AB)v? How many FLOPs are required to
compute A(Bv)?
•p.75 (section 2.4): 2abc, 5, 14
•Suppose Aand Bare n×nmatrices and vis a column vector with nelements. How
many FLOPs are required to compute (AB)v? How many FLOPs are required to
compute A(Bv)?
According to the results we obtained in class, computing the matrix-matrix product,
AB, requires 2n3FLOPs. If C=AB, then (AB)v=Cvis a matrix-vector product,
and according to the results obtained in class, it requires 2n2FLOPs. So computing
(AB)vrequires 2n3+ 2n2FLOPs.
On the other hand, Bvrequires 2n2FLOPs, and if Bv=w,then A(Bv) = Aw,which
requires an additional 2n2FLOPs. So computing A(Bv) requires 4n2FLOPs.
Page 75 (Section 2.4)
2. What rows or columns or matrices do you multiply to find
(a) the third column of AB?
If B= [b1,b2,b3, . . .],then the third column of AB is Ab3.So to get the third
column of AB, you multiply Aby the third column of B.
1
pf3

Partial preview of the text

Download Linear Algebra and Probability - Assignment Solutions | MATH 202 and more Assignments Linear Algebra in PDF only on Docsity!

Department of Mathematics Linear Algebra and Probability

Homework Key

Recommended Problems

Wednesday, February 25

Assignment:

  • Suppose A and B are n × n matrices and v is a column vector with n elements. How many FLOPs are required to compute (AB)v? How many FLOPs are required to compute A(Bv)?
  • p.75 (section 2.4): 2abc, 5, 14
  • Suppose A and B are n × n matrices and v is a column vector with n elements. How many FLOPs are required to compute (AB)v? How many FLOPs are required to compute A(Bv)? According to the results we obtained in class, computing the matrix-matrix product, AB, requires 2n^3 FLOPs. If C = AB, then (AB)v = Cv is a matrix-vector product, and according to the results obtained in class, it requires 2n^2 FLOPs. So computing (AB)v requires 2n^3 + 2n^2 FLOPs. On the other hand, Bv requires 2n^2 FLOPs, and if Bv = w, then A(Bv) = Aw, which requires an additional 2n^2 FLOPs. So computing A(Bv) requires 4n^2 FLOPs.

Page 75 (Section 2.4)

  1. What rows or columns or matrices do you multiply to find

(a) the third column of AB? If B = [b 1 , b 2 , b 3 ,.. .], then the third column of AB is Ab 3. So to get the third column of AB, you multiply A by the third column of B.

(b) the first row of AB? The first row of AB is obtained by taking the dot product of the first row of A with each column of B. If

A =

A 1

A 2

where each Ai is a matrix with 1 row. Then the first row of AB can be viewed as the matrix-matrix product A 1 B. (c) the entry in row 3, column 4 of AB? To get the entry in row 3, column 4, we take the dot product of row 3 of A with column 4 of B. So if

A =

a 1 a 2 .. .

 and^ B^ = [b 1 b 2.. .],

then the entry in row 3 column 4 is the dot product a 3 · b 4.

  1. Compute A^2 and A^3. Make a prediction for A^5 and An^ :

A =

[

1 b 0 1

]

and A =

[

]

For the first matrix A^2 =

[

1 b 0 1

] [

1 b 0 1

]

[

1 2 b 0 1

]

So A^3 =

[

1 2 b 0 1

] [

1 b 0 1

]

[

1 3 b 0 1

]

and it’s pretty clear that An^ =

[

1 nb 0 1

]

For the second matrix

A^2 =

[

] [

]

[

]

So A^3 =

[

] [

]

[

]