AMSC CMSC 460 Quiz 4 Fall 2007 Show all work You may leave arithmetic expressions in any form that a calculator could evaluate By putting your name on this paper you agree to abide by the university s code of academic integrity in completing the quiz Use no books calculators cellphones communication with others scratchpaper etc Name 1 Let x 3 4 2 T 1a 3 kxk1 3 4 2 9 1b 3 kxk max 3 4 2 4 1c 4 What vector has the same direction as x but 2 norm equal to 1 In other words we want the vector x c that has 2 norm equal to 1 where c is a constant that you should compute p Answer kxk2 3 2 4 2 22 29 so the vector is 3 1 4 29 2 1 2 10 Recall that if A is an n n matrix then kAk max i 1 n n X aij j 1 Suppose that all elements of A are nonnegative Write Matlab code to compute kAk using a column oriented algorithm Your code should have only one for loop A correct row oriented algorithm with one for loop is worth 5 points A correct column oriented algorithm with two for loops is worth 8 points Answer sums zeros n 1 for j 1 n sums sums abs A j end Anorm max sums The abs in this algorithm can be omitted for a nonnegative matrix but is necessary in general 2
View Full Document
Unlocking...