diff options
Diffstat (limited to '3293/CH1')
-rwxr-xr-x | 3293/CH1/EX1.1/Ex1_5.sce | 41 | ||||
-rwxr-xr-x | 3293/CH1/EX1.10/Ex1_10.sce | 54 | ||||
-rw-r--r-- | 3293/CH1/EX1.14/Ex1_14.sce | 9 | ||||
-rwxr-xr-x | 3293/CH1/EX1.15/Ex1_15.sce | 27 | ||||
-rwxr-xr-x | 3293/CH1/EX1.16/Ex1_16.sce | 44 | ||||
-rwxr-xr-x | 3293/CH1/EX1.5/Ex1_5.sce | 41 | ||||
-rwxr-xr-x | 3293/CH1/EX1.6/Ex1_6.sce | 23 | ||||
-rwxr-xr-x | 3293/CH1/EX1.7/Ex1_7.sce | 11 | ||||
-rwxr-xr-x | 3293/CH1/EX1.8/Ex1_8.sce | 21 | ||||
-rwxr-xr-x | 3293/CH1/EX1.9/Ex1_9.sce | 27 |
10 files changed, 298 insertions, 0 deletions
diff --git a/3293/CH1/EX1.1/Ex1_5.sce b/3293/CH1/EX1.1/Ex1_5.sce new file mode 100755 index 000000000..97ca66fbc --- /dev/null +++ b/3293/CH1/EX1.1/Ex1_5.sce @@ -0,0 +1,41 @@ +//page 8
+//Example 1.5
+clear;
+close;
+clc;
+a = [2 -1 3 2; 1 4 0 -1; 2 6 -1 5];
+disp(a,'a=');
+disp('Applying row transformations:');
+disp('R1 = R1-2*R2');
+a(1,:) = a(1,:) - 2*a(2,:);
+disp(a,'a = ');
+disp('R3 = R3-2*R2');
+a(3,:) = a(3,:) - 2*a(2,:);
+disp(a,'a = ');
+disp('R3 = R3/-2');
+a(3,:) = -1/2*a(3,:);
+disp(a,'a = ');
+disp('R2 = R2-4*R3');
+a(2,:) = a(2,:) - 4*a(3,:);
+disp(a,'a = ');
+disp('R1 = R1+9*R3');
+a(1,:) = a(1,:) + 9*a(3,:);
+disp(a,'a = ');
+disp('R1 = R1*2/15');
+a(1,:) = a(1,:) * 2/15;
+disp(a,'a = ');
+disp('R2 = R2+2*R1');
+a(2,:) = a(2,:) + 2*a(1,:);
+disp(a,'a = ');
+disp('R3 = R3-R1/2');
+a(3,:) = a(3,:) - 1/2*a(1,:);
+disp(a,'a = ');
+disp('We get the system of equations as:');
+disp('2*x1 - x2 + 3*x3 + 2*x4 = 0');
+disp('x1 + 4*x2 - x4 = 0');
+disp('2*x1 + 6* x2 - x3 + 5*x4 = 0');
+disp('and');
+disp('x2 - 5/3*x4 = 0','x1 + 17/3*x4 = 0','x3 - 11/3*x4 = 0');
+disp('now by assigning any rational value c to x4 in system second, the solution is evaluated as:');
+disp('(-17/3*c,5/3,11/3*c,c)');
+//end
diff --git a/3293/CH1/EX1.10/Ex1_10.sce b/3293/CH1/EX1.10/Ex1_10.sce new file mode 100755 index 000000000..9185c089b --- /dev/null +++ b/3293/CH1/EX1.10/Ex1_10.sce @@ -0,0 +1,54 @@ +//page 17
+//Example 1.10
+clear;
+close;
+clc;
+//Part a
+a = [1 0;-3 1];
+b = [5 -1 2;15 4 8];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part b
+a = [1 0;-2 3;5 4;0 1];
+b = [0 6 1;3 8 -2];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part c
+a = [2 1;5 4];
+b = [1;6];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part d
+a = [-1;3];
+b = [2 4];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part e
+a = [2 4];
+b = [-1;3];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part f
+a = [0 1 0;0 0 0;0 0 0];
+b = [1 -5 2;2 3 4;9 -1 3];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+disp('-----------------------------------------------------------------');
+//Part g
+a = [1 -5 2;2 3 4;9 -1 3];
+b = [0 1 0;0 0 0;0 0 0];
+disp(a,'a=');
+disp(b,'b=');
+disp(a*b,'ab = ');
+//end
diff --git a/3293/CH1/EX1.14/Ex1_14.sce b/3293/CH1/EX1.14/Ex1_14.sce new file mode 100644 index 000000000..630854458 --- /dev/null +++ b/3293/CH1/EX1.14/Ex1_14.sce @@ -0,0 +1,9 @@ +//page 22
+//Example 1.14
+clear;
+close;
+clc;
+a = [0 1;1 0];
+disp(a,'a = ');
+disp(inv(a),'inverse a = ');
+//end
diff --git a/3293/CH1/EX1.15/Ex1_15.sce b/3293/CH1/EX1.15/Ex1_15.sce new file mode 100755 index 000000000..2b9ed8738 --- /dev/null +++ b/3293/CH1/EX1.15/Ex1_15.sce @@ -0,0 +1,27 @@ +//page 25
+//Example 1.15
+clear;
+close;
+clc;
+a = [2 -1;1 3];
+disp(a,'a = ');
+b = a; //Temporary variable to store a
+disp('Applying row tranformations');
+disp('Interchange R1 and R2');
+x = a(1,:);
+a(1,:) = a(2,:);
+a(2,:) = x;
+disp(a,'a = ');
+disp('R2 = R2 - 2 * R1');
+a(2,:) = a(2,:) - 2 * a(1,:);
+disp(a,'a = ');
+disp('R2 = R2 *1/(-7)');
+a(2,:) = (-1/7) * a(2,:);
+disp(a,'a = ');
+disp('R1 = R1 - 3 * R2');
+a(1,:) = a(1,:) - 3 * a(2,:);
+disp(a,'a = ');
+disp('Since a has become an identity matrix. So, a is invertible');
+disp('inverse of a = ');
+disp(inv(b)); //a was stored in b
+//end
diff --git a/3293/CH1/EX1.16/Ex1_16.sce b/3293/CH1/EX1.16/Ex1_16.sce new file mode 100755 index 000000000..dc9438418 --- /dev/null +++ b/3293/CH1/EX1.16/Ex1_16.sce @@ -0,0 +1,44 @@ +//page 25
+//Example 1.16
+clear;
+close;
+clc;
+a = [1 1/2 1/3;1/2 1/3 1/4;1/3 1/4 1/5];
+disp(a,'a = ');
+b = eye(3,3);
+disp(b,'b = ');
+disp('Applying row transformations on a and b simultaneously,');
+disp('R2 = R2 - 1/2 * R1 and R3 = R3 - 1/3*R1');
+a(2,:) = a(2,:) - 1/2 * a(1,:);
+a(3,:) = a(3,:) - 1/3 * a(1,:);
+b(2,:) = b(2,:) - 1/2 * b(1,:);
+b(3,:) = b(3,:) - 1/3 * b(1,:);
+disp(a,'a = ');
+disp(b,'b = ');
+disp('R3 = R3 - R2');
+a(3,:) = a(3,:) - a(2,:);
+b(3,:) = b(3,:) - b(2,:);
+disp(a,'a = ');
+disp(b,'b = ');
+disp('R2 = R2 * 12 and R3 = R3 * 180');
+a(2,:) = a(2,:) *12;
+a(3,:) = a(3,:) * 180;
+b(2,:) = b(2,:) * 12;
+b(3,:) = b(3,:) * 180;
+disp(a,'a = ');
+disp(b,'b = ');
+disp('R2 = R2 - R3 and R1 = R1 - 1/3*R3');
+a(2,:) = a(2,:) - a(3,:);
+a(1,:) = a(1,:) - 1/3 * a(3,:);
+b(2,:) = b(2,:) - b(3,:);
+b(1,:) = b(1,:) - 1/3 * b(3,:);
+disp(a,'a = ');
+disp(b,'b = ');
+disp('R1 = R1 - 1/2 * R2');
+a(1,:) = a(1,:) - 1/2 * a(2,:);
+b(1,:) = b(1,:) - 1/2 * b(2,:);
+disp(round(a),'a = ');
+disp(b,'b = ');
+disp('Since, a = identity matrix of order 3*3. So, b is inverse of a');
+disp(b,'inverse(a) = ');
+//end
diff --git a/3293/CH1/EX1.5/Ex1_5.sce b/3293/CH1/EX1.5/Ex1_5.sce new file mode 100755 index 000000000..97ca66fbc --- /dev/null +++ b/3293/CH1/EX1.5/Ex1_5.sce @@ -0,0 +1,41 @@ +//page 8
+//Example 1.5
+clear;
+close;
+clc;
+a = [2 -1 3 2; 1 4 0 -1; 2 6 -1 5];
+disp(a,'a=');
+disp('Applying row transformations:');
+disp('R1 = R1-2*R2');
+a(1,:) = a(1,:) - 2*a(2,:);
+disp(a,'a = ');
+disp('R3 = R3-2*R2');
+a(3,:) = a(3,:) - 2*a(2,:);
+disp(a,'a = ');
+disp('R3 = R3/-2');
+a(3,:) = -1/2*a(3,:);
+disp(a,'a = ');
+disp('R2 = R2-4*R3');
+a(2,:) = a(2,:) - 4*a(3,:);
+disp(a,'a = ');
+disp('R1 = R1+9*R3');
+a(1,:) = a(1,:) + 9*a(3,:);
+disp(a,'a = ');
+disp('R1 = R1*2/15');
+a(1,:) = a(1,:) * 2/15;
+disp(a,'a = ');
+disp('R2 = R2+2*R1');
+a(2,:) = a(2,:) + 2*a(1,:);
+disp(a,'a = ');
+disp('R3 = R3-R1/2');
+a(3,:) = a(3,:) - 1/2*a(1,:);
+disp(a,'a = ');
+disp('We get the system of equations as:');
+disp('2*x1 - x2 + 3*x3 + 2*x4 = 0');
+disp('x1 + 4*x2 - x4 = 0');
+disp('2*x1 + 6* x2 - x3 + 5*x4 = 0');
+disp('and');
+disp('x2 - 5/3*x4 = 0','x1 + 17/3*x4 = 0','x3 - 11/3*x4 = 0');
+disp('now by assigning any rational value c to x4 in system second, the solution is evaluated as:');
+disp('(-17/3*c,5/3,11/3*c,c)');
+//end
diff --git a/3293/CH1/EX1.6/Ex1_6.sce b/3293/CH1/EX1.6/Ex1_6.sce new file mode 100755 index 000000000..e38438360 --- /dev/null +++ b/3293/CH1/EX1.6/Ex1_6.sce @@ -0,0 +1,23 @@ +//page 9
+//Example 1.6
+clear;
+close;
+clc;
+a=[-1 %i;-%i 3;1 2];
+disp(a,'a = ');
+disp('Applying row transformations:');
+disp('R1 = R1+R3 and R2 = R2 + i *R3');
+a(1,:) = a(1,:) +a(3,:);
+a(2,:) = a(2,:) + %i * a(3,:);
+disp(a,'a = ');
+disp('R1 = R1 * (1/2+i)');
+a(1,:) = 1/(2 + %i) * a(1,:);
+disp(a,'a = ');
+disp('R2 = R2-R1*(3+2i) and R3 = R3 - 2 *R1');
+a(2,:) = round(a(2,:) - (3 + 2 * %i) * a(1,:));
+a(3,:) = round(a(3,:) - 2 * a(1,:));
+disp(a,'a = ');
+disp('Thus the system of equations is:');
+disp('x1 + 2*x2 = 0','-i*x1 + 3*x2 = 0','-x1+i*x2 = 0');
+disp('It has only trivial solution x1 = x2 = 0');
+//end
diff --git a/3293/CH1/EX1.7/Ex1_7.sce b/3293/CH1/EX1.7/Ex1_7.sce new file mode 100755 index 000000000..47865fb65 --- /dev/null +++ b/3293/CH1/EX1.7/Ex1_7.sce @@ -0,0 +1,11 @@ +//page 9
+//Example 1.7
+clear;
+close;
+clc;
+n = rand();
+n = round(n*10);
+disp(eye(n,n));
+printf('This is an Identity matrix of order %d * %d',n,n);
+disp('And It is a row reduced matrix.');
+//end
diff --git a/3293/CH1/EX1.8/Ex1_8.sce b/3293/CH1/EX1.8/Ex1_8.sce new file mode 100755 index 000000000..52f6e2780 --- /dev/null +++ b/3293/CH1/EX1.8/Ex1_8.sce @@ -0,0 +1,21 @@ +//page 12
+//Example 1.8
+clear;
+close;
+clc;
+n = rand();
+n = round(n*10);
+disp(eye(n,n));
+printf('This is an Identity matrix of order %d * %d',n,n);
+disp('And It is a row reduced matrix.');
+m = rand();
+n = rand();
+m = round(m*10);
+n = round(n*10);
+disp(zeros(m,n));
+printf('This is an Zero matrix of order %d * %d',m,n);
+disp('And It is also a row reduced matrix.');
+a = [0 1 -3 0 1/2;0 0 0 1 2;0 0 0 0 0];
+disp(a,'a = ');
+disp('This is a non-trivial row reduced matrix.');
+//end
diff --git a/3293/CH1/EX1.9/Ex1_9.sce b/3293/CH1/EX1.9/Ex1_9.sce new file mode 100755 index 000000000..6e1fd0984 --- /dev/null +++ b/3293/CH1/EX1.9/Ex1_9.sce @@ -0,0 +1,27 @@ +//page 14
+//Example 1.9
+clear;
+close;
+clc;
+A = [1 -2 1;2 1 1;0 5 -1];
+disp(A,'A = ');
+disp('Applying row transformations:');
+disp('R2 = R2 - 2*R1');
+A(2,:) = A(2,:) - 2*A(1,:);
+disp(A,'A = ');
+disp('R3 = R3 - R2');
+A(3,:) = A(3,:) - A(2,:);
+disp(A,'A = ');
+disp('R2 = 1/5*R2');
+A(2,:) = 1/5*A(2,:);
+disp(A,'A = ');
+disp('R1 = R1 - 2*R2');
+A(1,:) = A(1,:) + 2*A(2,:);
+disp(A,'A = ');
+disp('The condition that the system have a solution is:');
+disp('2*y1 - y2 + y3 = 0');
+disp('where, y1,y2,y3 are some scalars');
+disp('If the condition is satisfied then solutions are obtained by assigning a value c to x3');
+disp('Solutions are:');
+disp('x2 = 1/5*c + 1/5*(y2 - 2*y1)','x1 = -3/5*c + 1/5*(y1 + 2*y2)');
+//end
|