Beruflich Dokumente
Kultur Dokumente
IGNOUUSER
1
ignouuser@gmail.com
1. (a) Verify the distributive property of floating point numbers i.e. prove :
a(b-c) ab – ac
a=.5555E1, b=.4545E1, c=.4535E1
Define : Truncation error, Absolute Error and Relative Error.
{
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
(b-c) = .0010E1 = .1000E-1
a(b-c) = .5555E1 * .1000E-1 = .05555E0 = .5555E-1
RHS
ab = .5555E1 * .4545E1 = .2524E2
ac = .5555E1 * .4535E1 = .2519E2
ab – ac = .0005E0 = .5000E-3
1. (b)Find the real root of the equation x = e-x using Newton-Raphson Method. List the cases
where Newton’s Method fail.
Given x=e-x
multiplying both sides by ex and arranging, we get
xex – 1 = 0
f(x) = xex – 1
f’(x) = (1 + x)ex
Let x0 = 1
xn+1 = xn -
x1 = 1 - = 0.6839397
x2 = 0.6839397 - = 0.5774545
x3 = 0.5774545 - = 0.5672297
x4 = 0.5672297 - = 0.567143297
Since x3 and x4 are same upto 3 decimal places, 0.567 is the required root.
In some cases, say x0 is the initial value and 1st approximation gives x1 which inturn gives
2nd approximation as x0 again and the loop continues.
First approximation
x1(1) = (1/2)(-1 + 0 + 0) = - 0.5
x2(1) = (1/2)(6 + 0.5 + 0) = 3.25
x3(1) = (1/2)(-3 + 0.5 + 3.25) = 0.375
Second approximation
x1(2) = (1/2)(-1 + 3.25 – 0.375) = 0.9375
x2(2) = (1/2)(6 – 0.9375 + 0.375) = 2.71875
x3(2) = (1/2)(-2 - 0.9375 + 2.71875) = -0.60938
Similarly, we have
[x1(3), x2(3), x3(3)] = [1.164063, 2.113281, -1.02539]
[x1(4), x2(4), x3(4)] = [1.069336, 1.952637, -1.05835]
[x1(5), x2(5), x3(5)] = [1.005493, 1.968079, -1.01871]
[x1(6), x2(6), x3(6)] = [0.993393, 2.001721, -0.99972]
[x1(7), x2(7), x3(7)] = [0.996836, 2.001721, -0.99756]
[x1(8), x2(8), x3(8)] = [0.999639, 2.001402, -0.99912]
[x1(9), x2(9), x3(9)] = [1.00026, 2.00031, -0.99997]
[x1(10), x2(10), x3(10)] = [1.000143, 1.999941, -1.0001]
[x1(11), x2(11), x3(11)] = [1.000021, 1.999939, -1.00004]
1. (d)Let f(x) = ln(1+x), x0 = 1 and x1 = 1.1. Use linear interpolation to calculate an approximate
value of f(1.04) and obtain a bound on the truncation error.
We have x0 = 1, x1 = 1.1
f(x0) = ln(1+x0) = 0.693147
f(x1) = ln(1+x1) = 0.741937
| | | – – | * (0.892857) = 0.0011160
Find y(0.2) using Runge-Kutta Method of fourth order. Also compare it with exact solution
y = -(1+x) + 2ex to find the error.
Therefore
y = y0 + 1/6(k1 +2 k2 + 2 k3 + k4)
= 1 + 0.2428= 1.2428
2. (a) Find the interval in which the smallest positive root of the following equation
lies using Bisection Method
x3 – x – 4 = 0
Given f(x) = x3 – x – 4
f(0) = 0 – 0 – 4 = -4
f(1) = 1 – 1 – 4 = -4
f(2) = 8 – 2 – 4 = 2
f(1.5) = -2.125
Clearly f(1.5)*f(2)<0, hence root lies between 1.5 and 2.
f(1.75) = -0.39063
Clearly f(1.75)*f(2)<0, hence root lies between 1.75 and 2.
f(1.875) = 0.716797
Hence the interval in which smallest root lie is [1.75,2] and the root is 1.875.
2. (b) Solve the following linear system of equations using Gauss Elimination Method.
x1 + x2 + x3 = 3
4x1 + 3x2 + 4x3 = 8
9x1 + 3x2 + 4x3 = 7
Eliminate x1 from second equation of (1), multiply first equation by 4 and subtract it from
second equation
(3 – 4) x2 + (4 – 4) x3 = 8 – 4*3
- x2 = 8 – 12
x2 = 4
Eliminate x1 from third equation of (1), multiply first equation by 9 and subtract it from third
equation.
(3 – 9) x2 + (4 – 9) x3 = 7 – 9*3
-6 x2 + (-5 x3) = 7 - 27
6 x2 + 5 x3 = 20
x1 = 3 – 4 –(-0.8) = -0.2
x1 = - 0.2
x2 = 4
x3 = -0.8
3. (a) The table below gives the values of tanx for 0.10 x 0.30.
x 0.10 0.15 0.20 0.25 0.30
y=tanx 0.1003 0.1511 0.2027 0.2553 0.3093
x y=tanx Δ Δ2 Δ3 Δ4
0.1 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.2 0.2027 0.001 0.0002
0.0526 0.0004
0.25 0.2553 0.0014
0.054
0.3 0.3093
i) tan0.12
here, h=0.05, a=0.10, x=0.12
u=(0.12-0.10)/0.05 = 0.4
ii) tan0.26
here, h=0.05, a=0.10, x=0.26
u=(0.26-0.10)/0.05 = 3.2
i) Trapezoidal, and
ii) Simpson’s rule with h=0.5 and h=0.25
Here, f(x) =
i) Trapezoidal rule
Taking h=0.25, we have
I = (0.25/2)[ f0 + f4 + 2(f1 + f2 + f3 )]
= 0.125*(1.5 + 2*2.04) = 0.6975
h=0.5
we have to consider only f0, f2, f4
I = (0.5/3)[ f0 + f4 + 4* f2]
= 0.16667*(1.5 + 4*0.67) = 0.6967
3. (c) Determine the value of y when x=0.1 given that y(0) = 1 and y’ = x2 + y.
4. (a) A problem in statistics is given to the three students A,B and C whose chances of
solving it are 1/2, 3/4 and 1/4 respectively. What is the probability that the problem will be
solved.
Hence, probability that A will not solve the problem P( ̅) = 1 – 1/2 = 1/2
probability that B will not solve the problem P( ̅ ) = 1 – 3/4 = 1/4
probability that C will not solve the problem P( ̅ ) = 1 – 1/4 = 3/4
4. (b) Calculate the correlation coefficient for the following heights (in inches) of fathers (x) and
their sons (y) :
x: 65 66 67 67 68 69 70
y: 67 68 65 68 72 72 69
where
x’ = mean value of x = 67.42857
y’ = mean value of y = 68.71429
One of the bag is selected and one ball is drawn. It turns out to be white. What is the
probability of drawing a white ball again. The first one not been returned.
= = = 1/6
x f(x)
1 2.0349
1+(5/11) 2.04209
1+(10/11) 2.04821
1+(15/11) 2.05364
1+(20/11) 2.05857
1+(25/11) 2.06311
1+(30/11) 2.06734
1+(35/11) 2.07132
1+(40/11) 2.07509
1+(45/11) 2.07868
1+(50/11) 2.08211
6 2.0854
5. (b) Estimate the sale of a particular quantity for 1966 using the following table.
Year 1931 1941 1951 1961 1971 1981
Sale in 12 15 20 27 39 52
thousands
Year Sale ∇ ∇2 ∇3 ∇4 ∇5
1931 12
3
1941 15 2
5 0
1951 20 2 3
7 3 -10
1961 27 5 -7
12 -4
1971 39 1
13
1981 52
here, h=1981-1971=10
a=1981
x=1966
= 52 + (-1.5)*13 + 1+ +
(-7) + (-10)
www.googledrive.com/host/0B3kSUnlvgaY4bEFVc25oNnRaVU0
or contact me at
ignouuser@gmail.com