hw2solution

hw2solution - EE263 HW2 Robert Wilson rwilson4@stanford.edu...

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

View Full Document Right Arrow Icon
EE263 HW2 Robert Wilson rwilson4@stanford.edu SCPD Student October 8, 2009 Problem 1 Algorithm 1 BackSubstitution( { r ij } , { y i } ) for i = n to 1 do Set s = y i for j = n to i + 1 do Subtract r ij · x j from s end for Set x i = s/r ii end for return { x i } The algorithm BackSubstitution takes as input the elements of R and y and returns the elements of x . It starts by finding x n and works backwards (hence the name). Since y i = n j = i r ij x j and all the x j ’s are known by step i for j > i , the only unknown in the sum is the first (diagonal) term r ii x i . We thus subtract from y i all the known terms r ij x j and divide by r ii . Since there are two loops each involving O ( n ) iterations, a single floating point operation (flop) in the inner loop and a single flop in the outer loop, the runtime is (1 · O ( n ) + 1) · O ( n ) = O ( n 2 ) Problem 2 Part 2a) The statement is FALSE . Part 2b) The statement is TRUE . Part 2c) The statement is FALSE . Part 2d) The statement is TRUE . 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Robert Wilson (SCPD student) Part 2e) The statement is TRUE . Part 2f) The statement is TRUE . Part 2g) The statement is TRUE . Part 2h) The statement is TRUE . Part 2i) The statement is TRUE . Part 2j) The statement is FALSE . Problem 3 Before beginning, let’s see how far we can get without assuming anything about B . A = - 1 0 0 - 1 1 0 1 1 0 0 1 0 0 1 0 B = b 11 b 12 b 13 b 21 b 22 b 23 b 31 b 32 b 33 b 41 b 42 b 43 b 51 b 52 b 53 AB = - ( b 11 + b 41 ) + b 51 - ( b 12 + b 42 ) + b 52 - ( b 13 + b 43 ) + b 53 b 21 + b 31 b 22 + b 32 b 23 + b 33 b 11 + b 41 b 12 + b 42 b 13 + b 43 = 1 0 0 0 1 0 0 0 1 Comparing the first and third rows, we see that, for example, b 11 + b 41 = 0 which tells us that
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.

Page1 / 7

hw2solution - EE263 HW2 Robert Wilson rwilson4@stanford.edu...

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