HW1 - Fall 2011 CMPSC/MATH 451 Homework Assignment#1 Due September 9(hand over in class or submit via Angel by 11 am 1 The Euclidean norm of an

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

View Full Document Right Arrow Icon
Fall 2011, CMPSC/MATH 451 Homework Assignment #1 Due September 9 (hand over in class or submit via Angel by 11 am) 1 The Euclidean norm of an n -dimensional vector x is defined by || x || 2 = (Σ n i =1 x 2 i ) 1 / 2 . ( a ) Discuss how there may be overflow and harmful underflow in this computation when using floating-point arithmetic. ( b ) Write two functions for computing the norm, a straightforward one (square each element of vec- tor, accumulate partial sum using a loop), and a robust function (how would you avoid/reduce overflow and underflow errors in this case? Recall what we had seen in class about associativity of floating-point addition). ( c ) Devise an input vector (say, with 5 elements) that produces significantly different results using these two routines. Compare with the output using MATLAB/Octave’s norm function. List the MATLAB/Octave code, the test input vector, as well as the output on executing the functions with these inputs.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/19/2012 for the course CMPSC 451 taught by Professor Staff during the Spring '08 term at Pennsylvania State University, University Park.

Page1 / 2

HW1 - Fall 2011 CMPSC/MATH 451 Homework Assignment#1 Due September 9(hand over in class or submit via Angel by 11 am 1 The Euclidean norm of an

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

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