MCSE-004 June 2013 Solutions Manual IGNOUUSER
1 1. (a) Explain briefly what are the sources of error? Verify the associative property for the floating point numbers i.e prove: (a+b) c (a c) + b, where a =.5665E1, b=.5556e-1 and c=.5644e1 The sources of errors are: i) Input Errors : Errors which come from the experiments and any experiment can give results of only limited accuracy. ii) Algorithmic Errors : Such errors occurs where infinite algorithms are used. Exact results are expected only after an infinite number of steps. As this cannot be done in practice, the algorithm has to be stopped after a finite number of steps and the results are not exact. iii) Computational Errors : Such errors occurs when elementary operations such as multiplication and division are used the case when number of digits increases greatly so that the results cannot be held fully in computer registers. { } Addition/Subtraction of floating point numbers To add/subtract 2 floating point numbers, the exponents of the two numbers must be equal. If not the mantissa is shifted appropriately. Then the Mantissas are added or subtracted. After that the result is normalized and the exponent is appropriately adjusted. LHS (a+b) =.5665E1 +.5556E-1 =.5665E1 +.0055E1 = 0.5720E1 (a+b) c = 0.5720E1 -.5644E1 = 0.0076E1 = 0.7600E-1 RHS (a-c) =.5665E1 -.5644E1 = 0.0021E1 = 0.2100E-1 (a-c)+b = 0.2100E-1 +.5556E-1 = 0.7656E-1 Clearly LHS RHS 1. (b) Find the root correct to three decimal places using Regula-Falsi method x 4 x 10 = 0. Given f(x) = x 4 x 10 f(1) = 1 1 10 = -10 f(2) = 16 2 10 = 4 Clearly f(1)*f(2)<0, root lies between 1 and 2
2 First approximation x 0 =1,x 1 =2 f(x 0 ) = -10, f(x 1 ) = 4 x 2 = x 0 ( ) ( ) f(x 0 ) = 1 - (-10) = 1.714286 ( ) f(x 2 )= -3.07788 Clearly f(1.714286)*f(2)<0, root lies between 1.714286 and 2 Second approximation x 3 = x 2 ( ) ( ) f(x 2 ) = 1.714286 - f(x 3 ) = -0.4128 (-3.07788) = 1.838531 ( ) Similarly we get, Third approximation, x 4 = 1.853636 Fourth approximation, x 5 = 1.855363 Fifth approximation, x 6 = 1.855559 As x 5 and x 6 are same upto 3 decimal places, hence required root is 1.855 1. (c) Solve the following system of equations. 4x 1 + x 2 + x 3 = 4 x 1 + 4x 2 2x 3 = 4 3x 1 + 2x 2 4x 3 = 6 by the gauss elimination method with partial pivoting. Rewriting the given equations in matrix form, [ ] As the largest absolute value in left column i.e 4 is at top only so no need to interchange rows. Dividing 1 st row by 4, we get, R1-> R1/4 [ ]
3 Multiplying R1 with -1 and adding to R2, i.e, R2-> R2+(-1)*R1, we get [ ] Multiplying R1 with -3 and adding to R3,i.e, R3->R3+(-3)*R1, we get [ ] This completes the first pass. For the second pass we consider the sub matrix obtained by removing the first row and first column. As the largest value in the 2 nd column, i.e., 3.75 is at top of the sub matrix, no need to interchange rows. Dividing 2 nd row by 3.75, i.e., R2->R2/3.75 [ ] Multiplying R2 with -1.25 and adding to R3,i.e, R3->R3+(-1.25)*R2, we get [ ] Dividing R3 with -4, i.e., R3->R3/(-4), we get [ ] Now, using back substitution, we have x 3 = -0.5 x 2 + (-0.6 x 3 ) = 0.8 x 2 = 0.5 and, x 1 + 0.25 x 2 + 0.25 x 3 = 1 x 1 = 0.75 Hence required solutions is x 1 = 0.75 x 2 = 0.5 x 3 = 0.5
4 1. (d)find the unique polynomial p(x) of degree 2 or less such that P(1) = 1, P(3) = 27, P(4) = 64 using Lagrange Interpolation formula. Given x 0 = 1, x 1 = 3, x 2 = 4 P(x 0 ) = 1, P(x 1 ) = 27, p(x 2 ) = 64 By Lagrange s Interpolation formula, we have P(x) = ( )( ) ( )( ) P(x 0) + ( )( ) ( )( ) P(x 1) + ( )( ) ( )( ) P(x 2) = ( )( ) 1 + ( )( ) ( )( ) 27 + ( )( ) ( )( ) ( )( ) 64 = ( )( ) 1 + ( )( ) 27 + ( )( ) 64 ( ) = [ ( ) ( )] = [ ] = [ ] = 1. (e) Calculate the value of the integral by i) Trapezoidal rule ii) Simpson s 1/3 rule. { Trapezoidal rule ( ) [(y 0 + y n ) + 2(y 1 + y 2 + y 3 +...)] } Simpsons 1/3 rd rule ( ) [(y 0 + y n ) + 4(y 1 + y 3 + y 5 +...) + 2(y 2 + y 4 + y 6 +...)] Divide the interval [4,5.2] into 6 equal sub-intervals, each of width = = 0.2 Values of y = logx are tabulated below. X 4.0 4.2 4.4 4.6 4.8 5.0 5.2 y=logx 1.3862 1.4350 1.4816 1.5261 1.5686 1.6094 1.6486
5 i) Trapezoidal rule I = (0.2/2)[(1.3862 + 1.6486) + 2(1.4350 + 1.4816 + 1.5261 + 1.5686 + 1.6094)] = 0.1*(3.0348 + 2*7.6207) = 1.8276 ii) Simpsons 1/3 rd rule I = (0.2/3)[(1.3862 + 1.6486) + 4(1.4350 + 1.5261 + 1.6094) + 2(1.4816 + 1.5686)] = 0.0667*(3.0348 + 4*4.5705 + 2*3.0502) = 1.8287 2. (a) Find all the roots of cosx x 2 x = 0 to five decimal places. We will use Secant method to solve this problem, as the bisection method exits after 2 approximations in the interval [0,1] { Secant method If x n-1 and x n are the two approximation of the equation, then the next approximation x n+1 is given by } x n+1 = x n - ( ) ( ) ( ) ( ), n=1,2,3,... Given, f(x) = cosx x 2 x f(0) = 1 f(1) = -1.00015 Clearly f(0)*f(1) <0, hence the root lies between 0 and 1 By Secant Method, First approximation x 2 = 1 - (-1.00015) = 0.499962 f(x 2 ) = 0.250038 Second approximation x 3 = 0.499962 - f(x 3 ) = 0.040011 (0.250038) = 0.59997 ( ) Similarly, Third approximation x 4 = 0.619022
6 Fourth approximation x 5 = 0.618 Fifth approximation x 6 = 0.618008 Sixth approximation x 7 = 0.6180079 As x 6 and x 7 are same upto 5 decimal places, the required root of the equation is 0.61800 2. (b) Solve the following system of equations x + y z = 0 -x + 3y = 2 x 2z = -3 by gauss-seidel method. Write its matrix form. The given system of equations can we written as x = -y + z y = (1/3)(2 + x) z = (1/2)(3 + x) Let initial approximation x 0, y 0, z 0 is 0,0,0 First approximation x (1) =0 y (1) =(1/3)*2 = 2/3 = 0.6667 z (1) =(1/2)*3 = 3/2 = 1.5 Second approximation x (2) =-0.6667 + 1.5 = 0.8333 y (2) =(1/3)*(2+0.8333) = 0.9444 z (2) =(1/2)*(3+0.8333) = 1.9167 Third approximation x (3) =-0.9444 + 1.9167 = 0.9723 y (3) =(1/3)*(2+0.9723) = 0.9908 z (3) =(1/2)*(3+0.9908) = 1.9954
7 Similarly we have, [x (4), x (4), x (4) ] = [0.9723,0.99078,1.98615] [x (5), x (5), x (5) ] = [0.995383,0.998461,1.997692] [x (6), x (6), x (6) ] = [0.999231,0.999744,1.999615] [x (7), x (7), x (7) ] = [0.999872,0.999957,1.999936] As 6 th and 7 th approximations are same upto 3 decimal places, hence the required solution is x=0.999 y=0.999 z=1.999 Matrix Form of the given equation by Gauss Seidel Rewriting the given equations as x = -y + z -x + 3y = 2 x 2z = -3 The equation is in the form (D + L) x (k+1) = -Ux (k) + b, where D = [ ] L = [ ] U = [ ] b = [ ] x (k+1) = -(D + L) -1 Ux (k) + (D + L) -1 b
8 2. (c) Write the pitfalls in the Gauss Elimination method. i) Division by zero occurs. Consider the equations y x = 0 x 3y + 4z = 5 -x + 2y + 2z = -4 ii) As a 11 =0 hence divide by zero occur. Round off errors occur. 3. (a) In the table below the values of y are consecutive terms of a series of which the number 21.6 is the 6 th term. Find the First and tenth terms of the series. x 3 4 5 6 7 8 9 y 2.7 6.4 12.5 21.6 34.3 51.2 72.9 The forward difference table of above data is X Y ΔY Δ 2 Y Δ 3 Y Δ 4 Y 3 2.7 3.7 4 6.4 2.4 6.1 0.6 5 12.5 3 0 9.1 0.6 6 21.6 3.6 0 12.7 0.6 7 34.3 4.2 0 16.9 0.6 8 51.2 4.8 21.7 9 72.9 By Newtons forward interpolation formula, f(x) = f(0) + (x-3) f(0) + ( )( ) ( ) + ( )( )( ) ( ) We have f(x) = 2.7 + (x-3) * 3.7 + ( )( ) * 2.4 + ( )( )( ) = 2.7 + 3.7x 11.1 + 1.2x 2 8.4x + 14.4 + 0.1x 3 1.2x 2 + 4.7x 6.0 = 0.1x 3 f(1) = 0.1 * 1 3 = 0.1 f(10) = 0.1 * 10 3 = 100
9 3. (b) Evaluate the integral using Weddle s rule with h=0.5 { } Weddle rule ( ) [y 0 + 5y 1 + y 2 + 6y 3 + y 4 + 5y 5 + 2y 6 +...)] Given h=0.5, f(x) = x 2 Values of y=f(x) is tabulated below x 1 1.5 2 2.5 3 3.5 4 y 1 2.25 4 6.25 9 12.25 16 I = (3*0.5/10)[1 + 5*2.25 + 4 + 6*6.25 + 9 + 5*12.25 + 2*16] = 0.15 * 156 = 23.4 3. (c) Given dy/dx = y x where y(0) = 2 Find y(0.1) and y(0.2) correct to four decimal places using Runge-Kutta Second Order Method. For y(0.1) x 0 =0,y 0 =2,h=0.1 k 1 = hf(x 0,y 0 ) =0.1*(2-0) = 0.2 k2=hf(x 0 +h,y 0 +k 1 ) = 0.21 =(1/2)(k1+k2) = 0.205 Hence, x 1 = x 0 + h = 0.1 y 1 =y 0 + = 2.205 For y(0.2) x 1 =0.1,y 1 =2.205,h=0.1 k 1 = hf(x 1,y 1 ) =0.1*(2.205-0.1) = 0.2105 k2=hf(x 1 +h,y 1 +k 1 ) = 0.22155 =(1/2)(k1+k2) = 0.216025 Hence, x 2 = x 1 + h = 0.2 y 2 =y 1 + = 2.4210
10 4. (a) An experiment consist of three independent tosses of a fair coin. Let x=the no of heads. y=the no of head runs. z=the length of head runs. a head run being defined as consecutive occurance of at least two heads, its length then being the number of heads occurring together in three tosses of the coin. Find the probability function of i) x ii) y iii) z iv) x+y The possible outcomes in tossing coin 3 times ={HHH,HHT,HTH,HTT,THH,THT,TTH,TTT} i) No of heads p 0 = probability of getting 0 head = 1/8 p 1 =probability of getting 1 head = 3/8 p 2 =probability of getting 2 head = 3/8 p 3 = probability of getting 3 head = 1/8 Hence the probability generating function P x (s) = p 0 + p 1 s+ p 2 s 2 +... = 1/8 + (3/8)s +(3/8)s 2 + (1/8)s 3 ***rest 2 parts still needs to be solved. I will try to update this. 4. (b) In partially destroyed lab record of an analysis of correlation data, the following results only are legible. Variance of x = 9 Regression Equations 8x 10y + 66 = 0 40x 18y = 214 What are: 1. The mean values of x and y 2. The correlation coefficient between x and y 3. The standard deviation of y Since both the lines of regression pass through the point, Solving (1) and (2) we get, Let 8X 10Y + 66 = 0 and 40X 18Y 214 = 0 be the lines of regression of y on x and x on y resp. rewriting the equations as,
11 Y = 0.8X + 6.6 X = 0.45Y + 5.35 regression coefficient of y on x is = 0.8 regression coefficient of x on y is = 0.45 Hence, r2 = 0.8 * 0.45 = 0.36 r = 0.6 (+ sign with square root is taken as regression coefficients are +ve) Given, Variance of X = Also, regression coefficient of y on x = = 0.8 * 3 / 0.6 = 4 4. (c) A bag contains 6 white and 9 black balls. Four balls are drawn at a time. Find the probability for the first draw to give 4 white and the second to give 4 black balls in each of the following cases: i) The balls are replaced before the second draw. ii) The balls are not replaced before the second draw. i) As the balls are replace before the second draw, the events are independent. Let P(W) denotes probability to draw 4 white balls in first draw P(B) denotes probability to draw 4 black balls in second draw Then, P(W) = 6/15 = 2/5 P(B) = 9/15 = 3/5 P(W B) = P(W)*P(B) = 6/5 ii) As the balls are not replace before the second draw, the events are dependent. P(W B) = P(W)*P(B W) = 2/5 * 9/11 = 18/55 5. (a) Solve the initial value problem to compute approximation for y(0.1), y(0.2) using Euler s method with h=0.1 dy/dt + 2y = 3e -4t, y(0) = 1 Compare with exact solution y(t) = Given, h=0.1, t 0 = 0, y 0 = 1, dy/dt = -2y + 3e -4t By Euler s method we have
12 y 1 = y 0 + hf(t 0,y 0 ) = 1 + 0.1*(-2+3) = 1.1 i.e, y(0.1) = 1.1 y 2 = y 1 + hf(x 1,y 1 ) = 1.1 + 0.1*(-2.2 + 2.01096) = 1.081096 i.e, y(0.2) = 1.081096 Now, using y(t) = we have, y(0.1) = 1.041347 and, y(0.2) = 1.001807 Error for y(0.1) = 1.041347 1.1 = -0.058 Error for y(0.2) = 1.001807 1.081096= -0.079 5. (b) Evaluate the integral I = using i) Composite trapezoidal rule ii) Composite simpson s rule with 2,4 and 8 equal subintervals. { Composite Trapezoidal Rule I T [f] = [first + last + 2*(sum of remaining)] Composite Simpson s rule I S [f] = [first + last + 2*(sum of even ordinates) + 4*(sum of remaining ordinates)] } Let h = 1/8 =0.125. Values of y=f(x) is tabulated below X 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1 Y 1 0.8889 0.8 0.7273 0.667 0.615 0.571 0.533 0.5 f0 f1 f2 f3 f4 f5 f6 f7 f8 i) Composite Trapezoidal rule. I T [f] = [1+0.5+2*(0.8889+0.8+0.7273+0.667+0.615+0.571+0.533)] = 0.0625[1.5 + 2*4.8022] = 0.6940 ii) Composite Simpsons rule
13 with n=2 here h=0.5 and f0,f4 and f8 is to be used. I S [f] = [1+0.5+4*0.667] =0.1667[1.5+2.668] = 0.6948 with n=4 here h=0.25 and f0,f2,f4,f6,f8 is to be used. I S [f] = [1+0.5+2*0.667 + 4*(0.8+0.571)] = 0.0833[1.5+1.334+5.484] = 0.6929 with n=8 here h=0.125 I S [f] = [1+0.5+2*(0.8+0.667+0.571) + 4*(0.8889+0.7273+0.615+0.533)] =0.04167[1.5+4.076+11.0568] = 0.6931
14 For more solutions keep visiting www.googledrive.com/host/0b3ksunlvgay4befvc25onnravu0 or contact me at ignouuser@gmail.com