Group assignments given a linear transformation as below, find the f dimension and one basic of im( )

32 4 0
Group assignments given a linear transformation as below, find the f dimension and one basic of im( )

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY FACULTY OF APPLIED SCIENCE -*** Linear Algebra (MT1008) Group Assignments Topic: Group: Team members: 1.Trần Quốc Thái - 2153795 2.Bùi Văn Nhật Thanh - 2152280 3.Hà Huy Thành - 2152967 4.Lê Thành - 2052706 5.Trịnh Hoài Thanh - 2053427 Semester: HK212 Lecturer: Phan Thi Huong Submission date: Saturday, May 14th, 2022 0 REQUIREMENTS: ● Students work on your assigned groups ● Detailed explanations must be provided to get full scores ● To solve the following questions, please let the constant a be your group ID ● All given exercises must be done by both methods: manual solving and using Matlab or Python TABLE OF CONTENT Project details for each question: I Theories summary II.Solution details III Coding details Question 1: Given a linear transformation f as below, find the dimension and one basic of Im(f): f(x1 ,x2 ,x3) = (x1 + x2;x2 + x3;x1 - ax3), (a = 9) I Theory: The set of all vectors in F that are images under f of at least one vector in E is If : E F is a linear called the range of f: ↦ f II.Solution details: Manual solving: MATLAB code and explanation: a Coding details: clc; syms e1 e2 e3 %y=f(x)=x1(e1)+x2(e2)+x3(e3) %a,b,c are constants �㔼�㔼 0 e1 = input('e1 = [a b c]='); e2 = input('e2 = [a b c]='); e3 = input('e3 = [a b c]='); A = [e1', e2', e3']; %Find the rank of A r = rank(A); %Find basics of Im(f) if (r == 1) Basic = [e1]; disp('Basic of Imf = ');disp([e1]) dimImf = elseif (r == 2) Basic = [e1;e2]; disp('Basic of Imf = ');disp([e1',e2']) dimImf = elseif (r == 3) Basic = [e1;e2;e3]; disp('Basic of Imf = ');disp([e1',e2',e3']) dimImf = end b Results: e1 e2 e3 Basic of Imf = = [a b c]=[ = [a b c]=[ = [a b c]=[0 1 -9 dimImf = 3 Question 2: Given f : �㔼 ³ �㔼 and the matrix representation of f in E = {(1; 1; 1); (1; 0; 1); (1; 1; 0)}, and F = {(1; 1); (2; 1)} is �㔼 = I Theory: - Every linear transformation from �㔼 Ā × represented by an m m n represents a i.e, we can always write a linear transformation in the form - ÿ If we are given vector images of a basis E in �㔼 , that is we know f(E), then where�㔼 ÿ×Ā matrix 0 where f(E), E are two matrices formed by vector of basis, vector of basis in Ā = {ÿ1, ÿ2, ÿ., ÿĀ} - Let f : �㔼 Ā basis for �㔼 Then is called the matrix representation of f with respect to E and F ý,ỵ= II Solution details: Manual solving: E= F= ýỵ= ý = 21 21 * ý,ỵ = () = 21 = ý,ỵ [(ý)] = �㔼 ý 㔼 ⇔ f(1;2;9) = MATLAB code and explanation: 2.1 MATLAB code: 0 2.2 Explanation: Line 1, 2, 3, 4: Create the matrix E, F, x, AEF respectively Line 5: Find the matrix A through the formula A = F Line 6: Find f(1;2;9) by using the formula [f(x)] T = A Question 3: Let F = {(2; -1; 3); (1; 1; 2); (3; 0; 1); (-1; -4; a)} be a subspace of R3 with the inner product < x; y >= 3x1y1 - x1y2 - x2y1 + 4x2y2 + 4x3y3 a) Find a basis and the dimension of F⊥ b) Find the vector projection of w = (3; -2; 1) onto F I Theory: Definition 1: Two vectors x , y V in an inner product space V is called orthogonal =0 We denote it by x ⊥ y (x perp y) Vector x is orthogonal to the set M V if x is orthogonal to every vector in M We denote it by x ⊥ M 0 Theorem 1: Vector x is orthogonal to a subspace F if and only if x is orthogonal with a basic of F Definition 2: A set of two or more vectors in a real inner product space {x , x2, …, xn} is called orthogonal all pairs of distinct vectors in the set are orthogonal An orthogonal set in which each vector has norm is said to be orthogonal xk = 1, ( k =1, 2, , n) Definition 3: If F is a subspace of a real inner product space V, then the set F ⊥ of all vectors in V that are orthogonal to F is called the orthogonal complement of F Theorem 2: Let R be a subspace of a real inner product space V then F⊥ is a subspace of V, and: Scheme of finding F⊥ of a subspace F: Find a basis of F Assume that basic of F contains vectors {e1 , e2, …, en} ü ⊥ F ÿ = ý ( y1 , y , , y n ) ỵ Find the dim and a basic of this null space Scheme of finding y = projFx - Find a basis of F, let it be S = {e1 , e2, …, em} - Since y F => y = 1e1 + 2e2 + + - x = y + z, then: y = 1e1 + 2e + + m em m em + z ü x , e1 ÿ x e ÿ , ý II x,e ỵ Solution details: Manual solving: a) Find a basis and the dimension of F⊥ A= Find the rank of the subspace F: m temp = result(j,:); result(j,:) = result(i,:); result(i,:) = temp; else result(j,:) = result(j,:) (result(j,i)/result(i,i))*result(i,:); end end disp(result); disp('Press Enter to continue'); pause; end disp(' -'); A = result(:,1:k); rresult = 0; rA = 0; for i = 1:n for j = 1:(k+1) if abs(result(i,j)) > 0.0001 rresult = rresult + 1; break; end end end for i = 1:n for j = 1:k if abs(A(i,j)) > 0.0001 rA = rA + 1; break; end 0 end end if rresult ~= rA disp('No solution !'); elseif rresult == rA if rresult == n disp('Unique Solution'); x = zeros(k,1); for s = 1:n i = n+1-s; sum = 0; for j = (i+1):k sum = sum + result(i,j)*x(j); end x(i) = (result(i,k+1) - sum)/result(i,i); end disp('Solution: ');disp(x); else disp('Infinity Solution'); disp([num2str(k - rresult) ' free variable']); end end end b) On the screen: 0 Question 5: Generate a random matrix A which has the size of ×4 and is diagonalizable Then, return its eigenvalues, the corresponding eigenvectors and compute A100 I Theories summary What is a diagonalizable matrix? A square matrix is said to be diagonalizable if it is similar to a diagonal matrix That is, A is diagonalizable if there is an invertible matrix P and a diagonal matrix D such that A=PDP-1 What are eigenvalues and the corresponding eigenvectors of a matrix? Many problems present themselves in terms of=an eigenvalue problem: �㔼 �㔼 �㔼 �㔼 In this equation A is an n-by-n matrix, v is a non-zero n-by-1 vector and λ is a scalar (which may be either real or complex) Any value of λ for which this equation has a solution is known as an eigenvalue of the matrix A It is sometimes also called the characteristic value 0 The vector, v, which corresponds to this value is called an eigenvector The eigenvalue problem can be rewritten as: �㔼 �㔼 �(㔼 �2 㔼 2 =0 =0 �㔼 �㔼 �㔼 )�.㔼 �㔼=0 �㔼 �㔼 �㔼 �㔼 If v is non-zero, this equation will |only 2have a solution|= 0if �㔼 �㔼 �㔼 This equation is called the characteristic equation of A, and is an nth order polynomial in λ with n roots These roots are called the eigenvalues of A We will only deal with the case of n distinct roots, though they may be repeated For each eigenvalue there will be an eigenvector for which the eigenvalue equation is true This is most easily demonstrated by example: If �㔼 = [ Then the characteristic equation is And the two eigenvalues are: All that's left is to find the two associated with the eigenvalue, λ1=-1, first so clearly from the Note that if we took the In either case we which the two elements have equal magnitude and opposite sign where k could have used any two quantities of equal magnitude and opposite sign Going through the same procedure for the second eigenvalue: So 10 0 = 222].[ +1 Again, the choice of +1 and -2 for�the eigenvector� was arbitrary; only their ratio is 㔼 㔼 important This is demonstrated in the MatLab code below Diagonal matrices are relatively easy to compute with, and similar matrices share many properties, so diagonalizable matrices are well-suited for computation In particular, many applications involve computing large powers of a matrix, because the � = ( 21 � which is easy if the matrix is diagonal But if A=PDP-1, then �㔼 Ā 㔼 Solution details Choose the ma trix �㔼 The unit matrix is � 㔼 Then we have So that 11 0 Solve this equation we have: ,which are the eige nva lue s of the matrix �㔼 � 㔼 With With � 㔼 With �㔼 With � 㔼 So we have �㔼 Then �㔼 100 = 20.4234 [ 20.5217 20.4531 20.5858 12 0 Coding details a Full MATLAB code: %Clear all text from the Command Window clear all; clc; %Input the matrix 4x4 that we need to use in this problem A=input('Enter the matrix A: ') %Check the matrix if it is already diagonal? check=isdiag(A); if check==true disp('The matrix is already diagonal'); %Calculate A power 100 fprintf('A power of 100 = A^100:') A100 = A^100; ANSWER = real(A100) else F=size(A,1); %Check the matrix whether it is diagonalizable or not? syms lambda I = eye(F); lambda1 = solve(det(A - I*lambda)==0); numrows=size(lambda1,1); V=[]; for i = 1:numrows v = null(A-lambda1(i,1)*I); V=[V,v]; end 13 0 B=transpose(V); C=rank(B); E=size(B,1); if C==F disp("The matrix is diagonalizable") p =poly(A); eigs = roots(p); M=[]; for i=1:4 m= eigs(i); M=[M,m]; end disp("The eigenvalues are:") disp(M) %Show the output of the problem: V is the matrix concluding all %eigenvectors and D is a diagonal matrix with eigenvalues located on the %main diagonal fprintf('Eigenvectors are:\n') [V,D] = eig(A) %Calculate A power 100 fprintf('A power of 100 = V*D^100*inv(V):') A100 = V*D^100*inv(V); ANSWER = real(A100) else %Ask the user to input another matrix disp("The matrix is not diagonalizable Let's try another matrix") end end b Results and explanation: If we input a diagonal matrix, this code will help us to find �㔼 100 directly: 14 0 c Note: The result is strange because it is too big to display in decimal number Also, the eigenvectors are concluded in4 = 0.0000 �㔼 㔼 is shown in Figure The result of � 100 15 FIGURE Howeve r, if we input a ma tr ix tha t is not dia gona liz able �㔼 The result will be: 16 0 ... transformation f as below, find the dimension and one basic of Im (f) : f( x1 ,x2 ,x 3) = (x1 + x2;x2 + x3;x1 - ax 3), (a = 9) I Theory: The set of all vectors in F that are images under f of at least one vector... F is called the orthogonal complement of F Theorem 2: Let R be a subspace of a real inner product space V then F? ?? is a subspace of V, and: Scheme of finding F? ?? of a subspace F: Find a basis of. .. basis of F Assume that basic of F contains vectors {e1 , e2, …, en} ü ⊥ F ÿ = ý ( y1 , y , , y n ) ỵ Find the dim and a basic of this null space Scheme of finding y = projFx - Find a basis of F,

Ngày đăng: 22/12/2022, 05:07

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan