Mathematics 3 Curs 013-014/Q1 - First exam. 31/10/13 Grup M1 Lecturers: Núria Parés and Yolanda Vidal Name: Calculator: [Generic Competency - 5% of the final grade of the subject a) Expresseu el nombre 10.875 en base. b) Es vol emmagatzemar el nombre 1101.011010101) utilitzant un emmagatzematge en base, coma flotant, utilitzant unamantissade 7bits un d ells pel signe) i un exponentde 5bits un d ells pel signe)imitjançant arrodoniment per eliminació. Retorna la representació d aquest nombre en aquest format i calcula quantes xifres significatives correctes correct significant digits) té l aproximació. a) 1010.111) b) x.s.c. c.s.d.)= 1 representació = 1 1 0 1 0 1 0 0 0 1 0 0 }{{}}{{} mantissa exponent a) Donat el nombre 10.875, convertirem primer la part entera a binari i després la part decimal. Per tant 10 = 1010). En relació a la part decimal 10 = 5+ 0 5 = + 1 = 1+ 0 1 = 0+ 1 0.875 = 0.75+ 1 0.75 = 0.5+ 1 0.5 = 0+ 1 És a dir, 0.875 = 0.111). Ajuntant els dos resultats anteriors, es té que 10.875 = 1010.111). b) Com que 1101.011010101) = 0.1101011010101) 4 = 0.1101011010101) 100), si utilitzem 7 bits per a la mantissa i 5 per l exponent i arrodonim mitjançant eliminació, guardaríem el següent nombre 1 1 0 1 0 1 0 0 0 1 0 0 }{{}}{{} mantissa exponent que representa 0.110101) 100) = 0.110101) 4 = 1101.01). Per saber el nombre de xifres significatives correctes, calculem primer 1101.011010101) = 3 + + 0 + + 3 + 5 + 7 + 9 = 13.41601565 1101.01) = 3 + + 0 + = 13.5 per tant, l error relatiu comès és 13.41601565 13.5 13.41601565 = 0.01 = 0.1 10 1 < 0.5 10 1. Per tant, l aproximació té 1 xifra significativa correcta.
1. [3.5 points Denote by I = 8 0 x 4 dx. Answer the following questions a) [ points Approximate I using the composite Trapezoidal method with n = 4. b) [1 point We want to approximate the integral using a new integration method similar to the Simpson s method, but where in each subinterval, we compute a parabola using the points [x i,x i q,x i+1, where x i q = x i + 3h/4. That is, the additional point is not the mid-point of the interval x i m, but the point which is found at a 3h/4 distance from x i, denoted by x i q. In this case, the approximation of the integral is given by I n 1 h 5fxi )+16fx i q) 3fx i+1 ) ) Compute the approximation we would obtain using this method with n =. c) [0.5 points Which is the order of convergence of the method in item b)? It is necessary to justify the answer and detail the computations you have done. Hint: Compute the exact value of the integral, and the exact error committed for n = and n = 4. Look at how the error decreases. a) I T = 73 b) I 608 c) convergence order = 3 a) In this case, n = 4, h = b a n = 8 4 =, and Using the Trapezoidal composite formula: x 0 = 0, x 1 =, x = 4, x 3 = 6, x 4 = 8 I T = h fx 0)+ fx 1 )+fx )+fx 3 ))+fx 4 )) = f0)+ f)+f4)+f6))+f8)) = 73 b) To compute the approximation with n=, the expression reads: I h 5fx0 )+16fx 0 q ) 3fx 1) ) + h 5fx1 )+16fx 1 q ) 3fx ) ) where h = b a n = 8 = 4, and thus x 0 = 0, x 1 = 4, x = 8. The points that ar at 3h/4 distance from x i are computed as: Substituting all these values in the formula: x 0 q = 0+ 3 4 h = 3 x 1 q = 4+ 3 4 h = 7 I 4 5f0)+16f3) 3f4))+ h 5f4)+16f7) 3f8)) = 608 c) Let s compute the exact value of the integral: I = 8 The absolute error committed for n = is 0 x 4 dx = x5 5 8 0 = 85 5 = 6553.6 E = 6553.6 608 = 345.6 Let s compute the approximate value of the integral when using n = 4. In this case, h = b a n = 8/4 = and x 0 = 0, x 0 q = 0+ 3 4 h = 3, x 1 =, x 1 q = + 3 4 h = 7, x = 4, x q = 4+ 3 4 h = 11, x 3 = 6, x 3 q = 6+ 3 4 h = 15, x 4 = 8.
Substituting in the given formula of the method, we obtain: I 5f0)+16f 3 ) ) 3f) + 5f)+16f 7 ) ) 3f4) + 5f4)+16f 11 ) ) 3f6) + 5f6)+16f 15 ) ) 3f8) = 6510,67. The absolute error committed for n = 4 is E 4 = 6553.6 6510.67 = 4.93 Let s compare the errors committed with n = and n = 4 intervals: E E4 = 345.6 4.93 = 8,05 That is, when the number of intervals is multiplied by or, equivalently, when h is divided by ) the error is divided by 3. Thus, it is a third order method: Eh/) = C Eh) = Ch 3 ) 3 h = Eh) 3.
. [3.5 points We want to determine the intersection of the curves fx) = 10sinx) and gx) = 10 x in the interval [0, 6. a) [1 point Do three iterations of the Newton method taking as initial guess x 0 = 0. b) [1 point Compute the approximated relative error associated to x in absolute value. c) [0.5 points Using the previous results, and using that in this case the Newton method has the standard convergence rate, predict the approximated relative error associated to x 3. d) [1 point Determine the intersection of the curves in [0, 3. Compute this approximation and stop when in two consecutive iterations the first three decimals are not modified. a) x 3 = 1.0803777741138 b) r = 0.0075107049553 c) r 3 7.5684 10 6 d) α 1.080413751058 a) In order to find the intersection of the curves we must find the roots of hx) = fx) gx) = 10sinx) 10+x The derivative of this function is: h x) = 10cosx)+x Let s do three iterations of Newton method taking as initial guess x 0 = 0: x 1 = x 0 hx 0) 10 h = 0 x 0 ) 10 = 1 x = x 1 hx 1) h x 1 ) = 1.07906096567397 x 3 = x hx ) h x ) = 1.0803777741138 b) The approximate relative error associated to x in absolute value is: r = x 3 x x 3 = 0.0075107049553 c) Let s assume that Newton has the standard convergence rate, then: d) Let s continue the iterations with Newton method: r 3 λ r 0.0075107049553 = 7.5684 10 6 x 4 = x 3 hx 3) h x 3 ) = 1.080413751058 The first three decimals have not been modified with respect to x 3.
3. [3 points The following data, giving the evolution of the temperature of a solid during one second, have been obtained from an experiment. t 0 0.3 0.4 0.6 1 Tt) 40 4.56 4.09 39.91 34.7 a) [1 point Aproximate Tt) [0.3, 0.6 using polynomial interpolation using only the three interpolation points 0.3, 0.4, and 0.6). b) [0.5 points Using the interpoland obtained in item a), predict the value of the temperature at t = 0.5. Aproximate Tt) using an interpolant of the form pt) = At+Be t using the least squares criterion. c) [0.5 points Give the generic expression of the system of equations that has to be solved to determine A and B. d) [0.5 points Compute the interpolant pt) for the data given in the exercise all of them). e) [0.5 points Using the interpolant from item d), make a prediction of the time t in which the temperature is maximum inside the interval [0, 1. Compute the results with correct decimal places. a) pt)= pt) = 4.56 t 0.4)t 0.6) b) T0.5) 41.067 n c) t i t ie t i t ie t i n e t i d) pt)= 0.0053t+40.0010e t e) maximum t = 0.6 ) A B +4.09 t 0.3)t 0.6) 0.0 ) = t ift i ) ft i)e t i ) +39.91 t 0.3)t 0.4) 0.06 a) Let s use the points t 0 = 0.3, t 1 = 0.4, t = 0.6. The Lagrange polynomials associated to these points are: L 0 t) = t x 1)t t ) t 0 t 1 )t 0 t ) = t 0.4)t 0.6) 0.3 0.4)0.3 0.6) = t 0.4)t 0.6) L 1 t) = t x 0)t t ) t 1 t 0 )t 1 t ) = t 0.3)t 0.6) 0.4 0.3)0.4 0.6) = t 0.3)t 0.6) 0.0 L t) = t x 0)t t 1 ) t t 0 )t t 1 ) = t 0.3)t 0.4) 0.6 0.3)0.6 0.4) = t 0.3)t 0.4) 0.06 Thus, the pure interpolating polynomial is: pt) = ft 0 )L 0 t)+ft 1 )L 1 t)+ft )L t) = 4.56 t 0.4)t 0.6) +4.09 t 0.3)t 0.6) +39.91 t 0.3)t 0.4) 0.0 0.06 b) Inordertopredictthevalueofthetemperatureattimet = 0.5weevaluatethepureinterpolatingpolynomial obtained in item a) at this point t = 0.5): p0.5) = 4.56 0.5 0.4)0.5 0.6) c) In this case, +4.09 0.5 0.3)0.5 0.6) 0.0 EA,B) = n [ ft i ) At i Be t i +39.91 0.5 0.3)0.5 0.4) 0.06 the values of A and B are determined by the least-squares criteria minimizing the function min EA,B) A,B = 41.067
We impose that, A = 0 B = 0 The linear system obtained reads, n A = [ft i ) At i Be t i ti = 0 n B = [ft i ) At i Be t i e t i = 0 Written in matricial form, [ t i n t ie t i t ie t i e t i [ A B = [ t ift i ) ft i)e t i d) We must solve the linear system: [ 1.61 1.4015 1.4015 3.35 [ A B = [ 88.700 155.3807 to obtain A = 0.0053 and B = 40.0010. Thus, the interpolant is: e) Using the interpolant: pt) = 0.0053t+40.0010e t pt) = 0.0053t+40.0010e t we want to make a prediction of the time t in which the temperature is maximum inside the interval [0,1. Thus, we need to solve the equation p t) = 0.0053 40.0010e t t) = 0 We will use Newton method, so we will need to compute p t) = 40.0010 e t 4t )+e t) = 40.0010e t 4t ) Let s start with the initial guess x 0 = 0, then x 1 = x 0 p x 0 ) p x 0 ) = 0.50059998500038 x = x 1 p x 1 ) p x 1 ) = 0.68500161663 x 3 = x p x ) p x ) = 0.687957481740 The last two iterations have the same two first decimal places. Thus, the solution is 0.6.