This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: L. Vandenberghe 12/10/08 EE103 Final Exam Solutions Problem 1 (10 points). c a b The length of one side of a triangle ( c ) can be calculated from the lengths of the two other sides ( a and b ) and the opposing angle ( ) by the formula c = radicalbig a 2 + b 2 2 ab cos . (1) Two equivalent expressions are c = radicalBig ( a b ) 2 + 4 ab (sin( / 2)) 2 (2) and c = radicalBig ( a + b ) 2 4 ab (cos( / 2)) 2 . (3) (The equivalence of the three formulas follows from the identities cos = 1 2(sin( / 2)) 2 and cos = 1 + 2(cos( / 2)) 2 .) Which of the three formulas gives the most stable method for computing c if a b and is small? For simplicity you can assume that the calculations are exact, except for a small error in the evaluation of the cosine and sine functions. Explain your answer. Solution. Expressions (1) and (3) suffer from cancellation; expression (2) does not. Cancellation occurs when two numbers are subtracted that are almost equal, and one or both are subject to error. Therefore cancellation occurs in the subtraction in (1) and (3). In (2) we also subtract two almost equal numbers a and b , but they are not subject to error (under the assumptions of the problem). Problem 2 (10 points) How many IEEE double precision floatingpoint numbers are contained in the following intervals? 1. The interval [1 / 2 , 3 / 2). 2. The interval [3 / 2 , 5 / 2). Explain your answer. Solution. 1. 3 2 51 . The floatingpoint representations of the numbers 1 / 2, 1, and 3 / 2 are 1 / 2 = ( . 100 0) 2 2 , 1 = ( . 100 0) 2 2 1 , 3 / 2 = ( . 110 0) 2 2 1 . There are 2 52 floatingpoint numbers in [1 / 2 , 1) and 2 51 in [1 , 3 / 2). 2. 3 2 50 . The floatingpoint representations of the numbers 3 / 2, 2, and 5 / 2 are 3 / 2 = ( . 1100 0) 2 2 1 , 2 = ( . 1000 0) 2 2 2 , 5 / 2 = ( . 1010 0) 2 2 2 . There are 2 51 floatingpoint numbers in [3 / 2 , 2) and 2 50 floatingpoint numbers in [2 , 5 / 2). Problem 3 (10 points). Explain how you would solve the following problem using the Gauss Newton algorithm. Fit a circle ( u u c ) 2 + ( v v c ) 2 = R 2 to m given points ( u i ,v i ) in a plane. In other words, determine u c , v c , R such that ( u i u c ) 2 + ( v i v c ) 2 R 2 , i = 1 ,... ,m. The variables are the coordinates of the center u c , v c , and the radius R . Your description should include: The cost function that you minimize....
View Full
Document
 Spring '09
 JACOBSON

Click to edit the document details