{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW1 - Fall 2011 CMPSC/MATH 451 Homework Assignment#1 Due...

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

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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• staff
• Euclidean space, input vector, Matlab/Octave code, significantly different results, test input vector, algebraically equivalent terms

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern