diff options
Diffstat (limited to '3293/CH3')
-rwxr-xr-x | 3293/CH3/EX3.12/Ex3_12.sce | 29 | ||||
-rwxr-xr-x | 3293/CH3/EX3.14/Ex3_14.sce | 20 | ||||
-rwxr-xr-x | 3293/CH3/EX3.15/Ex3_15.sce | 20 | ||||
-rwxr-xr-x | 3293/CH3/EX3.16/Ex3_16.sce | 21 | ||||
-rwxr-xr-x | 3293/CH3/EX3.17/Ex3_17.sce | 19 | ||||
-rwxr-xr-x | 3293/CH3/EX3.19/Ex3_19.sce | 28 | ||||
-rwxr-xr-x | 3293/CH3/EX3.23/Ex3_23.sce | 38 | ||||
-rwxr-xr-x | 3293/CH3/EX3.24/Ex3_24.sce | 47 | ||||
-rwxr-xr-x | 3293/CH3/EX3.6/Ex3_6.sce | 26 |
9 files changed, 248 insertions, 0 deletions
diff --git a/3293/CH3/EX3.12/Ex3_12.sce b/3293/CH3/EX3.12/Ex3_12.sce new file mode 100755 index 000000000..c769173c2 --- /dev/null +++ b/3293/CH3/EX3.12/Ex3_12.sce @@ -0,0 +1,29 @@ +//page 81
+//Example 3.12
+clc;
+clear;
+close;
+x = round(rand(1,2) * 10);
+x1 = x(1);
+x2 = x(2);
+T = [x1+x2 x1];
+disp(x1,'x1 = ');
+disp(x2,'x2 = ');
+printf('T(%d,%d) = ',x1,x2);
+disp(T);
+disp('If, T(x1,x2) = 0, then');
+disp('x1 = x2 = 0');
+disp('So, T is non-singular');
+disp('z1,z2 are two scalars in F');
+z1 = round(rand() * 10);
+z2 = round(rand() * 10);
+disp(z1,'z1 = ');
+disp(z2,'z2 = ');
+x1 = z2;
+x2 = z1 - z2;
+disp(x1,'So, x1 = ');
+disp(x2,'x2 = ');
+disp('Hence, T is onto.');
+Tinv = [z2 z1-z2];
+disp(Tinv,'inverse(T) = ');
+//end
diff --git a/3293/CH3/EX3.14/Ex3_14.sce b/3293/CH3/EX3.14/Ex3_14.sce new file mode 100755 index 000000000..2378afd70 --- /dev/null +++ b/3293/CH3/EX3.14/Ex3_14.sce @@ -0,0 +1,20 @@ +//page 89
+//Example 3.14
+clc;
+clear;
+close;
+disp('T is a linear operator on F^2 defined as:');
+disp('T(x1,x2) = (x1,0)');
+disp('B = {e1,e2} is a standard ordered basis for F^2,then');
+x1 = 1;
+x2 = 0;
+Te1 = [x1 0];
+x1 = 0;
+x2 = 1;
+Te2 = [x1 0];
+disp(Te1,'So, Te1 = T(1,0) = ');
+disp(Te2,'So, Te2 = T(0,1) = ');
+disp('so,matrix T in ordered basis B is: ');
+T = [Te1; Te2];
+disp(T,'T = ');
+//end
diff --git a/3293/CH3/EX3.15/Ex3_15.sce b/3293/CH3/EX3.15/Ex3_15.sce new file mode 100755 index 000000000..0237cc05a --- /dev/null +++ b/3293/CH3/EX3.15/Ex3_15.sce @@ -0,0 +1,20 @@ +//page 89
+//Example 3.15
+clc;
+clear;
+close;
+disp('Differentiation operator D is defined as:');
+D = zeros(4,4);
+x = poly(0,"x");
+for i= 1:4
+ t= i-1;
+ f = derivat(x^t);
+ printf('(Df%d)(x) = ',i);
+ disp(f);
+ if ~(i == 1) then
+ D(i-1,i) = i-1;
+ end
+end
+disp('Matrix of D in ordered basis is:');
+disp(D,'[D] = ');
+//end
diff --git a/3293/CH3/EX3.16/Ex3_16.sce b/3293/CH3/EX3.16/Ex3_16.sce new file mode 100755 index 000000000..9f7137d4b --- /dev/null +++ b/3293/CH3/EX3.16/Ex3_16.sce @@ -0,0 +1,21 @@ +//page 92
+//Example 3.16
+clc;
+clear;
+close;
+disp('T is a linear operator on R^2 defined as T(x1,x2) = (x1,0)');
+disp('So, the matrix T in standard ordered basis B = {e1,e2} is ');
+T = [1 0 ;0 0];
+disp(T,'[T]B = ');
+disp('Let B'' is the ordered basis for R^2 consisting of vectors:');
+E1 = [1 1];
+E2 = [2 1];
+disp(E1,'E1 = ');
+disp(E2,'E2 = ');
+P = [E1;E2]'
+disp(P,'So, matrix P = ');
+Pinv = inv(P);
+disp(Pinv,'P inverse = ');
+T1 = Pinv*T*P;
+disp(T1,'So, matrix T in ordered basis B'' is [T]B'' = ');
+//end
diff --git a/3293/CH3/EX3.17/Ex3_17.sce b/3293/CH3/EX3.17/Ex3_17.sce new file mode 100755 index 000000000..cd7fcc5b3 --- /dev/null +++ b/3293/CH3/EX3.17/Ex3_17.sce @@ -0,0 +1,19 @@ +//page 93
+//Example 3.17
+clc;
+clear;
+close;
+t = poly(0,"t");
+disp('g1 = f1');
+disp('g2 = t*f1 + f2');
+disp('g3 = t^2*f1 + 2*t*f2 + f3');
+disp('g4 = t^3*f1 + 3*t^2*f2 + 3*t*f3 + f4');
+P = [1 t t^2 t^3;0 1 2*t 3*t^2;0 0 1 3*t;0 0 0 1];
+disp(P,'P = ');
+disp(inv(P),'inverse P = ');
+disp('Matrix of differentiation operator D in ordered basis B is:'); //As found in example 15
+D = [0 1 0 0;0 0 2 0;0 0 0 3;0 0 0 0];
+disp(D,'D = ');
+disp('Matrix of D in ordered basis B'' is:');
+disp(inv(P)*D*P,'inverse(P) * D * P = ');
+//end
diff --git a/3293/CH3/EX3.19/Ex3_19.sce b/3293/CH3/EX3.19/Ex3_19.sce new file mode 100755 index 000000000..1139b14c8 --- /dev/null +++ b/3293/CH3/EX3.19/Ex3_19.sce @@ -0,0 +1,28 @@ +//page 98
+//Example 3.19
+clc;
+clear;
+close;
+function [tr] = trace_matrix(M,n)
+ for i = 1 : n
+ tr = tr + M(i,i);
+ end
+endfunction
+n = round(rand() * 10 + 2);
+disp(n,'n = ');
+A = round(rand(n,n) * 10);
+disp(A,'A = ');
+tr = 0;
+disp('Trace of A:');
+tr1 = trace_matrix(A,n);
+disp(tr1,'tr(A) = ');
+disp('--------------------------------');
+c = round(rand() * 10 + 2);
+disp(c,'c = ');
+B = round(rand(n,n) * 10);
+disp(B,'B = ');
+disp('Trace of B:');
+tr2 = trace_matrix(B,n);
+disp(tr2,'tr(B) = ');
+disp(c*tr1+tr2,'tr(cA + B) = ');
+//end
diff --git a/3293/CH3/EX3.23/Ex3_23.sce b/3293/CH3/EX3.23/Ex3_23.sce new file mode 100755 index 000000000..7328315d5 --- /dev/null +++ b/3293/CH3/EX3.23/Ex3_23.sce @@ -0,0 +1,38 @@ +//page 103
+//Example 3.23
+clc;
+clear;
+close;
+disp('Matrix represented by given linear functionals on R^4:');
+A = [1 2 2 1;0 2 0 1;-2 0 -4 3];
+disp(A,'A = ');
+T = A; //Temporary matrix to store A
+disp('To find Row reduced echelon matrix of A given by R:')
+disp('Applying row transformations on A,we get');
+disp('R1 = R1-R2');
+A(1,:) = A(1,:) - A(2,:);
+disp(A,'A = ');
+disp('R3 = R3 + 2*R1');
+A(3,:) = A(3,:) + 2*A(1,:);
+disp(A,'A = ');
+disp('R3 = R3/3');
+A(3,:) = 1/3*A(3,:);
+disp(A,'A = ');
+disp('R2 = R2/2');
+A(2,:) = 1/2*A(2,:);
+disp(A,'A = ');
+disp('R2 = R2 - 1/2*R3');
+A(2,:) = A(2,:) - 1/2*A(3,:);
+disp(A,'A = ');
+R = A;
+A = T;
+disp('Row reduced echelon matrix of A is:');
+disp(R,'R = ');
+disp('Therefore,linear functionals g1,g2,g3 span the same subspace of (R^4)* as f1,f2,f3 are given by:');
+disp('g1(x1,x2,x3,x4) = x1 + 2*x3');
+disp('g1(x1,x2,x3,x4) = x2');
+disp('g1(x1,x2,x3,x4) = x4');
+disp('The subspace consists of the vectors with');
+disp('x1 = -2*x3');
+disp('x2 = x4 = 0');
+//end
diff --git a/3293/CH3/EX3.24/Ex3_24.sce b/3293/CH3/EX3.24/Ex3_24.sce new file mode 100755 index 000000000..4e486903f --- /dev/null +++ b/3293/CH3/EX3.24/Ex3_24.sce @@ -0,0 +1,47 @@ +//page 104
+//Example 3.24
+clc;
+clear;
+close;
+disp('W be the subspace of R^5 spanned by vectors:');
+a1 = [2 -2 3 4 -1];
+a2 = [-1 1 2 5 2];
+a3 = [0 0 -1 -2 3];
+a4 = [1 -1 2 3 0];
+disp(a1,'a1 = ');
+disp(a2,'a2 = ');
+disp(a3,'a3 = ');
+disp(a4,'a4 = ');
+disp('Matrix A by the row vectors a1,a2,a3,a4 will be:');
+A = [a1;a2;a3;a4];
+disp(A,'A = ');
+disp('After Applying row transformations, we get the row reduced echelon matrix R of A;');
+T = A; //Temporary matrix to store A
+//R1 = R1 - R4 and R2 = R2 + R4
+A(1,:) = A(1,:) - A(4,:);
+A(2,:) = A(2,:) + A(4,:);
+//R2 = R2/2
+A(2,:) = 1/2 * A(2,:);
+//R3 = R3 + R2 and R4 = R4 - R1
+A(3,:) = A(3,:) + A(2,:);
+A(4,:) = A(4,:) - A(1,:);
+//R3 = R3 - R4
+A(3,:) = A(3,:) - A(4,:);
+//R3 = R3/3
+A(3,:) = 1/3 * A(3,:);
+//R2 = R2 - R3
+A(2,:) = A(2,:) - A(3,:);
+//R2 = R2/2 and R4 = R4 - R2 - R3
+A(2,:) = 1/2 * A(2,:);
+A(4,:) = A(4,:) - A(2,:) - A(3,:);
+//R1 = R1 - R2 + R3
+A(1,:) = A(1,:) - A(2,:) + A(3,:);
+R = A;
+A = T;
+disp(R,'R = ');
+disp('Then we obtain all the linear functionals f by assigning arbitrary values to c2 and c4');
+disp('Let c2 = a, c4 = b then c1 = a+b, c3 = -2b, c5 = 0.');
+disp('So, W0 consists all linear functionals f of the form');
+disp('f(x1,x2,x3,x4,x5) = (a+b)x1 + ax2 -2bx3 + bx4');
+disp('Dimension of W0 = 2 and basis {f1,f2} can be found by first taking a = 1, b = 0. Then a = 0,b = 1');
+//end
diff --git a/3293/CH3/EX3.6/Ex3_6.sce b/3293/CH3/EX3.6/Ex3_6.sce new file mode 100755 index 000000000..183c106a2 --- /dev/null +++ b/3293/CH3/EX3.6/Ex3_6.sce @@ -0,0 +1,26 @@ +//page 70
+//Example 3.6
+clc;
+clear;
+close;
+a1 = [1 2];
+a2 = [3 4];
+disp(a1,'a1 = ');
+disp(a2,'a2 = ');
+disp('a1 and a2 are linearly independent and hence form a basis for R^2');
+disp('According to theorem 1, there is a linear transformation from R^2 to R^3 with the transformation functions as:');
+Ta1 = [3 2 1];
+Ta2 = [6 5 4];
+disp(Ta1,'Ta1 = ');
+disp(Ta2,'Ta2 = ');
+disp('Now, we find scalars c1 and c2 for that we know T(c1a1 + c2a2) = c1(Ta1) + c2(Ta2))');
+disp('if(1,0) = c1(1,2) + c2(3,4), then ');
+c = inv([a1;a2]') * [1;0];
+c1 = c(1,1);
+c2 = c(2,1);
+disp(c1,'c1 = ');
+disp(c2,'c2 = ');
+disp('The transformation function T(1,0) will be:');
+T = c1*Ta1 + c2*Ta2;
+disp(T,'T(1,0) = ');
+//end
|