summaryrefslogtreecommitdiff
path: root/3293/CH5
diff options
context:
space:
mode:
Diffstat (limited to '3293/CH5')
-rwxr-xr-x3293/CH5/EX5.3/Ex5_3.sce14
-rwxr-xr-x3293/CH5/EX5.4/Ex5_4.sce23
-rwxr-xr-x3293/CH5/EX5.5/Ex5_5.sce28
-rwxr-xr-x3293/CH5/EX5.6/Ex5_6.sce29
-rwxr-xr-x3293/CH5/EX5.7/Ex5_7.sce19
-rwxr-xr-x3293/CH5/EX5.8/Ex5_8.sce17
6 files changed, 130 insertions, 0 deletions
diff --git a/3293/CH5/EX5.3/Ex5_3.sce b/3293/CH5/EX5.3/Ex5_3.sce
new file mode 100755
index 000000000..085f5f501
--- /dev/null
+++ b/3293/CH5/EX5.3/Ex5_3.sce
@@ -0,0 +1,14 @@
+//page 143
+//Example 5.3
+clc;
+clear;
+close;
+A = round(rand(2,2) *10 );
+disp(A,'A = ');
+D1 = A(1,1)*A(2,2);
+D2 = - A(1,2)*A(2,1);
+disp(D1,'D1(A) = ');
+disp(D2,'D2(A) = ');
+disp(D1 + D2,'D(A) = D1(A) + D2(A) = ');
+disp('That is, D is a 2-linear function.');
+//end
diff --git a/3293/CH5/EX5.4/Ex5_4.sce b/3293/CH5/EX5.4/Ex5_4.sce
new file mode 100755
index 000000000..f2a2e8539
--- /dev/null
+++ b/3293/CH5/EX5.4/Ex5_4.sce
@@ -0,0 +1,23 @@
+//page 145
+//Example 5.4
+clc;
+clear;
+close;
+x = poly(0,"x");
+A = [x 0 -x^2;0 1 0;1 0 x^3];
+disp(A,'A = ');
+disp('e1,e2,e3 are the rows of 3*3 identity matrix, then');
+T = eye(3,3);
+e1 = T(1,:);
+e2 = T(2,:);
+e3 = T(3,:);
+disp(e1,'e1 = ');
+disp(e2,'e2 = ');
+disp(e3,'e3 = ');
+disp('D(A) = D(x*e1 - x^2*e3, e2, e1 + x^3*e3)');
+disp('Since, D is linear as a function of each row,');
+disp('D(A) = x*D(e1,e2,e1 + x^3*e3) - x^2*D(e3,e2,e1 + x^3*e3)');
+disp('D(A) = x*D(e1,e2,e1) + x^4*D(e1,e2,e3) - x^2*D(e3,e2,e1) - x^5*D(e3,e2,e3)');
+disp('As D is alternating, So');
+disp('D(A) = (x^4 + x^2)*D(e1,e2,e3)');
+//end
diff --git a/3293/CH5/EX5.5/Ex5_5.sce b/3293/CH5/EX5.5/Ex5_5.sce
new file mode 100755
index 000000000..f2238a7fa
--- /dev/null
+++ b/3293/CH5/EX5.5/Ex5_5.sce
@@ -0,0 +1,28 @@
+//page 147
+//Example 5.5
+clc;
+clear;
+close;
+function [E1 , E2 , E3] = determinant(A)
+ E1 = A(1,1)*det([A(2,2) A(2,3);A(3,2) A(3,3)]) - A(2,1)*det([A(1,2) A(1,3);A(3,2) A(3,3)]) + A(3,1)*det([A(1,2) A(1,3);A(2,2) A(2,3)]);
+ E2 = -A(1,2)*det([A(2,1) A(2,3);A(3,1) A(3,3)]) + A(2,2)*det([A(1,1) A(1,3);A(3,1) A(3,3)]) + A(3,2)*det([A(1,1) A(1,3);A(2,1) A(2,3)]);
+ E3 = A(1,3)*det([A(2,1) A(2,2);A(3,1) A(3,2)]) - A(2,3)*det([A(1,1) A(1,2);A(3,1) A(3,2)]) + A(3,3)*det([A(1,1) A(1,2);A(2,1) A(2,2)]);
+endfunction
+
+//part a
+x = poly(0,"x");
+A = [x-1 x^2 x^3;0 x-2 1;0 0 x-3];
+disp(A,'A = ');
+[E1, E2, E3] = determinant(A);
+disp(E1,'E1(A) = ');
+disp(E2,'E2(A) = ');
+disp(E3,'E3(A) = ');
+disp('--------------------------------------');
+//part b
+A = [0 1 0;0 0 1;1 0 0];
+disp(A,'A = ');
+[E1, E2, E3] = determinant(A);
+disp(E1,'E1(A) = ');
+disp(E2,'E2(A) = ');
+disp(E3,'E3(A) = ');
+//end
diff --git a/3293/CH5/EX5.6/Ex5_6.sce b/3293/CH5/EX5.6/Ex5_6.sce
new file mode 100755
index 000000000..59dcb9a74
--- /dev/null
+++ b/3293/CH5/EX5.6/Ex5_6.sce
@@ -0,0 +1,29 @@
+//page 158
+//Example 5.6
+clc;
+clear;
+close;
+disp('Given Matrix:');
+A = [1 -1 2 3; 2 2 0 2; 4 1 -1 -1;1 2 3 0];
+disp(A,'A = ');
+disp('After, Subtracting muliples of row 1 from rows 2 3 4');
+disp('R2 = R2 - 2*R1');
+A(2,:) = A(2,:) - 2 * A(1,:);
+disp('R3 = R3 - 4*R1');
+A(3,:) = A(3,:) - 4 * A(1,:);
+disp('R4 = R4 - R1');
+A(4,:) = A(4,:) - A(1,:);
+disp(A,'A = ');
+T = A; //Temporary matrix to store A
+disp('We obtain the same determinant as before.');
+disp('Now, applying some more row transformations as:');
+disp('R3 = R3 - 5/4 * R2');
+T(3,:) = T(3,:) - 5/4 * T(2,:);
+disp('R4 = R4 - 3/4 * R2');
+T(4,:) = T(4,:) - 3/4 * T(2,:);
+B = T;
+disp('We get B as:');
+disp(B,'B = ');
+disp('Now,determinant of A and B will be same');
+disp(det(B),'det A = det B = ');
+//end
diff --git a/3293/CH5/EX5.7/Ex5_7.sce b/3293/CH5/EX5.7/Ex5_7.sce
new file mode 100755
index 000000000..bd180d6e1
--- /dev/null
+++ b/3293/CH5/EX5.7/Ex5_7.sce
@@ -0,0 +1,19 @@
+//page 160
+//Example 5.7
+clc;
+clear;
+close;
+x = poly(0,"x");
+A = [x^2+x x+1;x-1 1];
+B = [x^2-1 x+2;x^2-2*x+3 x];
+disp(A,'A = ');
+disp(B,'B = ');
+disp(det(A),'det A = ');
+disp(det(B),'det B = ');
+disp('Thus, A is not invertible over K whereas B is invertible');
+disp(inv(A)*det(A),'adj A = ');
+disp(inv(B)*det(B),'adj B = ');
+disp('(adj A)A = (x+1)I');
+disp('(adj B)B = -6I');
+disp(inv(B),'B inverse = ');
+//end
diff --git a/3293/CH5/EX5.8/Ex5_8.sce b/3293/CH5/EX5.8/Ex5_8.sce
new file mode 100755
index 000000000..09f3ae417
--- /dev/null
+++ b/3293/CH5/EX5.8/Ex5_8.sce
@@ -0,0 +1,17 @@
+//page 161
+//Example 5.8
+clc;
+clear;
+close;
+A = [1 2;3 4];
+disp(A,'A = ');
+d = det(A);
+disp(d,'det A = ','Determinant of A is:');
+ad = (det(A) * eye(2,2)) / A;
+disp(ad,'adj A = ','Adjoint of A is:');
+disp('Thus, A is not invertible as a matrix over the ring of integers.');
+disp('But, A can be regarded as a matrix over field of rational numbers.');
+in = inv(A);
+//The A inverse matrix given in book has a wrong entry of 1/2. It should be -1/2.
+disp(in,'inv(A) = ','Then, A is invertible and Inverse of A is:');
+//end