280wk2_x4 - Matrix Multiplication Given two vectors a =...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Matrix Multiplication Given two vectors ~a = [ a 1 , . . . , a k ] and ~ b = [ b 1 , . . . , b k ], their inner product (or dot product ) is ~a · ~ b = k X i =1 a i b i [1 , 2 , 3] · [ - 2 , 4 , 6] = (1 ×- 2) + (2 × 4) + (3 × 6) = 24. We can multiply an n × m matrix A = [ a ij ] by an m × k matrix B = [ b ij ], to get an n × k matrix C = [ c ij ]: c ij = m r =1 a ir b rj this is the inner product of the i th row of A with the j th column of B 1 2 3 1 5 7 4 × 3 7 4 2 - 1 - 2 = 17 18 39 41 17 = (2 × 3) + (3 × 4) + (1 × - 1) = (2 , 3 , 1) · (3 , 4 , - 1) 18 = (2 × 7) + (3 × 2) + (1 × - 2) = (2 , 3 , 1) · (7 , 2 , - 2) 39 = (5 × 3) + (7 × 4) + (4 × - 1) = (5 , 7 , 4) · (3 , 4 , - 1) 41 = (5 × 7) + (7 × 2) + (4 × - 2) = (5 , 7 , 4) · (7 , 2 , - 2) 2 Why is multiplication deFned in this strange way? Because it’s useful! Suppose z 1 = 2 y 1 + 3 y 2 + y 3 y 1 = 3 x 1 + 7 x 2 z 2 = 5 y 1 + 7 y 2 + 4 y 3 y 2 = 4 x 1 + 2 x 2 y 3 = - x 1 - 2 x 2 Thus, z 1 z 2 = 2 3 1 5 7 4 · y 1 y 2 y 3 and y 1 y 2 y 3 = 3 7 4 2 - 1 - 2 · x 1 x 2 . Suppose we want to express the z ’s in terms of the x ’s: z 1 = 2 y 1 + 3 y 2 + y 3 = 2(3 x 1 + 7 x 2 ) + 3(4 x 1 + 2 x 2 ) + ( - x 1 - 2 x 2 ) = (2 × 3 + 3 × 4 + ( - 1)) x 1 + (2 × 7 + 3 × 2 + ( - 2)) x 2 = 17 x 1 + 18 x 2 Similarly, z 2 = 39 x 1 + 41 x 2 . z 1 z 2 = 2 3 1 5 7 4 · 3 7 4 2 - 1 - 2 · x 1 x 2 . 3 Algorithms An algorithm is a recipe for solving a problem. In the book, a particular language is used for describing algorithms. You need to learn the language well enough to read the examples You need to learn to express your solution to a prob- lem algorithmically and unambiguously YOU DO NOT NEED TO LEARN IN DETAIL ALL THE IDIOSYNCRACIES O± THE PARTICULAR LANGUAGE USED IN THE BOOK. You will not be tested on it, nor will most of the questions in homework use it I suggest you skim Chapter 1; I won’t cover it 4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Methods of Proof One way of proving things is by induction. That’s coming next. What if you can’t use induction? Typically you’re trying to prove a statement like “Given X , prove (or show that) Y ”. This means you have to prove X Y In the proof, you’re allowed to assume X , and then show that Y is true, using X . A special case: if there is no
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/21/2009 for the course CS 2800 taught by Professor Selman during the Spring '07 term at Cornell University (Engineering School).

Page1 / 6

280wk2_x4 - Matrix Multiplication Given two vectors a =...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online