You are on page 1of 6

LAB ASSESSMENT MODULE 2

LAB REPORT
Group : G5
Anubhav Srivastava (192123003)
Atul Kumar (192123006)
Prabhat Kumar Mishra (192123030)
Purushottam Prasad (192123032)

1) OBSERVATION :
Given a real number kappa ≥ 1 , there exists a non-singular matrix A
such that
κ(A) = kappa,
where, A=U*D*U' and D(i,i) = kappa {(i-1)/(n-1)} , U is an orthogonal
matrix.

Explanation :
We have , A=U*D*U' , where U is an orthogonal matrix and D is a
diagonal matrix.
For an orthogonal matrix U, we know that

U -1 = U'

∴ A and D are similar matrices hence, their eigen values are


precisely same.
Also, A'=(U*D*U')'= (U')'*D*U' = U*D*U' = A
so, Eigen values of A are kappa {(i-1)/(n-1)} , i=1,2,...,n.
Since, kappa ≥ 1,

∴ (kappa )0 ≤ (kappa) 1/n-1 ≤ (kappa) 2/n-1 ≤ (kappa) 3/n-1 ≤ . . . ≤ kappa

Maximum eigen value of A is kappa and Minimum eigen value is 1.


Now, ||A|| = max(sqrt(eigen values (A' *A))) ⇒ ||A|| = (kappa) .
Next,
A=U*D*U' ⇒ A-1= (U*D*U')-1 = U*D-1*U'

So, eigen values of A-1= (kappa {(i-1)/(n-1)})-1 , i=1,2,...,n.

⇒ ||A-1|| = max((sqrt(eigen values of (A-1)' *A-1 )))


= 1

∴ κ (A) = ||A|| ·||A-1||


= kappa .

3.a)

The Rule-of-thumb of ill-conditioning says that if

1. κ (A) = 10^t ;

2. The computed solution of Ax = b has been obtained from a backward stable


algorithm;

3. The entries of A and b are accurate to about s decimal places where


s > t;

then one should expect an agreement of at least s − t decimal places between


the corresponding entries of the exact solution and the computed solution of the
system.

For n = 100 and κ = 10^5

Method Forward Error Norm of residual Time


/norm of b
Cholesky 1.77146282922303 5.12052745083934 5.6970000000000
7 e-12 e-16 0 e-04
Cramer’s rule 3.83619498197653 1.57712245485852 1.0755200000000
e-12 e-12 0 e-02
For n = 85 and κ = 10^7

Method Forward Error Norm of residual Time


/norm of b
Cholesky 3.17198149868900 3.79972328800999 7.9350000000000
e-10 e-16 0e-04
Cramer’s 4.34644480348433 4.44435267669303 1.0855100000000
rule e-10 e-11 0 e-02

Comparison for Rule Of Thumb

n(Size Of s s-t
t ( κappa =
matrix)
10^t)
100 16 5 11
85 16 7 9

For n = 85, Rule of Thumb is Satisfied.


For n = 100, Rule of Thumb is Satisfied.

3.b)

Method
n = 85 n = 100
Cholesky ( ||δb|| / || 3.79972328800999 e-16 5.12052745083934 e-16
b|| )
Cramer’s ( ||δb|| / || 4.44435267669303 e-11 1.57712245485852 e-12
b|| )

In Cholesky method, The relative error in b which is of the order of


u ≈ 10^(-16). so it is backward Stable.

In Cramer’s Rule, The relative Error in b which is not of the order of u or lesser
than it. Hence it is not Backward stable.

3.c)

Cramer’s method is more expensive than the Cholesky Method.

Cholesky Method uses GEPP Method for solving equation which has flop count
of order 2/3 n3 + O(n2).

Cramer’s Rule Requires calculation of (n+1) determinants to solve a


system of n equation.

Calculation of determinant of a matrix of order n has flop coint of O(n!).


for (n+1) matrix calculation,

∴ total flop count = (n+1)O(n!)


= O((n+1)!)

hence, Cramer’s rule is more expensive.

4.a)
Calculating flop counts,
for 1 iteration,
Calculating r = b - A*xc' takes 2*n2+n flops.
Row forward has O(n2)
column backward has O(n2)
Calculating xnew + xhat takes n flops
updating count takes 1 flop
Calculating relative refinement has O(n) flops.

And hence total no. Of flop counts is


m*(2*n2+n + O(n2) + O(n2) + n + 1 + O(n))
= O(n2) as m ≪n .

4.b)
We observe that that the forward errors associated with geppsolve
method and forward error obtained after refinement are nearly same.

But the norms of residual errors in case of refinement is less as compared to that
in GEPP method. This is basically because GEPP method is a conditionally
stable process, which is when ||Uc||∞ / ||A||∞ is small, where U is an Upper
Trianguable Matrix.

But in the case of of Wilkinson Matrix, ||U||∞ / ||A||∞ is quite large and hence
results in large value of r, suggesting that it is not backward stable for Wilkinson
Matrix.
METHOD FORWARD ERROR RESIDUAL NORM / ||b||
GEPP 6.44558862142264 e +01 3.31896563449409 e-01
CHOLESKY 6.61693521872903 e +01 2.16918100234155 e-15

5.)

we know that,

if 0 < fl(a) << fl(b) or fl(b) << 0 < fl(a),


then fl(a+b) ≈ fl(b).

i)
a = x, b= 1
fl(b) = =1, fl(a) = x, where x = x/2 at each iterate.
Initially fl(a) = fl(b)
after k iterate fl(a) << fl(b)
⇒ fl(a+b) ≈ fl(b), ( by swamping)
so, loop is terminated. After k = 53

ii)
a = x, b= x
here, x = x/2 at each iteration.
So, fl(a) = fl(b) ( always)
so, loop will terminate when x ≈ 0 after k = 1075 step.
Hence k is large in this case.

You might also like