0% found this document useful (0 votes)
23 views8 pages

Verify Cramer'S Rule For 3 Equations and 3 Variables: Experiment 8

This document verifies Cramer's rule for systems of linear equations with 3 variables and 3 equations, and then with 4 variables and 4 equations. It sets up the coefficient matrix A and solution vector B for each system. It then calculates the determinants of the matrices formed by replacing each column of A with B, and uses these determinants and the determinant of A in Cramer's rule calculations to solve for the variables. It shows that in both cases, multiplying the solution vector V by the original coefficient matrix A reproduces the original solution vector B, verifying Cramer's rule.

Uploaded by

Sakshi Bachhety
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Verify Cramer'S Rule For 3 Equations and 3 Variables: Experiment 8

This document verifies Cramer's rule for systems of linear equations with 3 variables and 3 equations, and then with 4 variables and 4 equations. It sets up the coefficient matrix A and solution vector B for each system. It then calculates the determinants of the matrices formed by replacing each column of A with B, and uses these determinants and the determinant of A in Cramer's rule calculations to solve for the variables. It shows that in both cases, multiplying the solution vector V by the original coefficient matrix A reproduces the original solution vector B, verifying Cramer's rule.

Uploaded by

Sakshi Bachhety
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

EXPERIMENT 8

VERIFY CRAMERS RULE FOR 3 EQUATIONS AND 3 VARIABLES


A=[2 2 -1;1 -5 1;3 4 -3]

A =

2 2 -1
1 -5 1
3 4 -3

B=[1;2;9]

B =

1
2
9

Determinant of A:
D=det(A)

D =

15

A1=A;A1(:,1)=B

A1 =

1 2 -1
2 -5 1
9 4 -3

A2=A;A2(:,2)=B

A2 =

2 1 -1
1 2 1
3 9 -3

A3=A;A3(:,3)=B

A3 =

2 2 1
1 -5 2
3 4 9

Determinant of A1:
D1=det(A1)

D1 =

-12
Determinant of A2:
D2=det(A2)

D2 =

-27
Determinant of A3:
D3=det(A3)

D3 =

-93

x=D1/D

x =

-0.8000

y=D2/D

y =

-1.8000

z=D3/D

z =

-6.2000

V=[x;y;z]

V =

-0.8000
-1.8000
-6.2000

E=A*V

E =

1.0000
2.0000
9.0000

Here E=B
Hence, Cramers rule verified for 3 equations and 3 variables

VERIFY CRAMERS RULE FOR 4 EQUATIONS AND 4 VARIABLES

A=[1 3 1 -1;2 2 -3 2;3 1 4 5;1 6 3 -2]

A =

1 3 1 -1
2 2 -3 2
3 1 4 5
1 6 3 -2

B=[5;1;2;4]

B =

5
1
2
4

A1=A;A1(:,1)=B

A1 =

5 3 1 -1
1 2 -3 2
2 1 4 5
4 6 3 -2

A2=A;A2(:,2)=B

A2 =

1 5 1 -1
2 1 -3 2
3 2 4 5
1 4 3 -2

A3=A;A3(:,3)=B

A3 =

1 3 5 -1
2 2 1 2
3 1 2 5
1 6 4 -2

A4=A;A4(:,4)=B

A4 =

1 3 1 5
2 2 -3 1
3 1 4 2
1 6 3 4
Determinant of A:
D=det(A)

D =

-88

D1=det(A1)

Determinant of A2:
D1 =

-568

Determinant of A3:
D2=det(A2)

D2 =

158

Determinant of A4:
D3=det(A3)

D3 =

-40

D4=det(A4)

D4 =

306

x=D1/D

x =

6.4545

y=D2/D

y =

-1.7955

z=D3/D

z =

0.4545

w=D4/D

w =

-3.4773

V=[x;y;z;w]

V =

6.4545
-1.7955
0.4545
-3.4773

E=A*V

E =

5.0000
1.0000
2.0000
4.0000

Here, E=B
Hence, Cramers rule is verified for 4 equations and 4 variables

You might also like