* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Lab # 7 - public.asu.edu
Factorization of polynomials over finite fields wikipedia , lookup
System of polynomial equations wikipedia , lookup
Fundamental theorem of algebra wikipedia , lookup
Factorization wikipedia , lookup
Tensor operator wikipedia , lookup
Quadratic form wikipedia , lookup
System of linear equations wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Determinant wikipedia , lookup
Cartesian tensor wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Bra–ket notation wikipedia , lookup
Linear algebra wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Basis (linear algebra) wikipedia , lookup
Four-vector wikipedia , lookup
Matrix calculus wikipedia , lookup
Jordan normal form wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Matrix multiplication wikipedia , lookup
MAT 242 Linear Algebra COMPUTER LAB #7 INSTRUCTOR: S.K. SUSLOV The Gram-Schmidt Process, Eigenvalues and Eigenvectors Orthonormal bases and the Gram-Schmidt process An orthonormal basis for an inner product space behaves very much like the standard basis for the Euclidean space. The Gram-Schmidt process is a method by which we may construct such a basis for a finite dimensional inner product space. Example: Use the Gram-Schmidt process to generate an orthogonal basis from the set of vectors (1, -1, 2, 3), (2, 1, 5, -4), (-3, 1, 7, -5), and (3, 7, 4, -1). Solution: Call the above vectors as A, B, C, and E and use the command GramSchmidt({A,B,C,E}) from the linear algebra package. Maple will generate an orthogonal basis. Check that vectors are orthogonal using the command dotprod(X, Y). Use the command norm(X,2) in order to find the norm of vector X and create the orthonormal basis. Eigenvalues and Eigenvectors Maple’s syntax for the characteristic polynomial of a matrix A is charpoly(A,x). Maple can find the exact eigenvalues and eigenvectors of many matrices. In many texts the Greek letter lambda is used for eigenvalues, we shall also use lambda because Maple supports Greek characters. It will be also convenient for us to have a short name for the identity matrix; enter alias(Id=&*()) to make Id an alias, or synonimym for the identity matrix. Example: Let 45 L M 28 M 31 AM M 28 M M 51 N O 14 P P 15P P 14 P 27P Q 21 63 12 21 12 42 7 15 43 9 14 42 5 25 75 14 1. Find the characteristic polynomial of A. 2. Find the eigenvalues of A. 3. Find a basis for each eigenspace of A. Solution: Enter the matrix and name it A. To find the characteristic polynomial, we may use either det(lambda*Id – A) or charpoly(A, lambda). To find eigenvalues we solve the characteristic polynomial. The eigenvalues 2 and 3 appear. Since 2 appears as a root 3 times, it is an eigenvalue of multiplicity 3; similarly, 3 is an eigenvalue of multiplicity 2. The eigenspace corresponding to 2 is the nullspace of 2I-A (or A-2I). You can find a basis of this space using the command nullspace(A-2*Id). In a similar matter one can find eigenspace corresponding to the eigenvalue 3. Finally, use the commands eigenvalues(A) and eigenvectors(A) for a direct method of finding eigenvalues and eigenvectors of A. Problem For each of the following matrices, find the characteristic polynomial, the exact eigenvalues, and a basis for each eigenspace, exactly. 3 4 L M 4 3 A: M M 0 4 M 4 0 N 0 O L 4P M 6 P , B: M 4P M 2 P M 1Q N 6 4 4 4 4 10 6 1 4 O 6P P 2 P P 2 Q 4 4 2 6 6 6 Reminder: Important Maple Notes Maple has a collection of matrix functions in a package called linalg. Bring these into your session by entering with(linalg); Now you can enter the matrix 1 2 3 4 by typing C:=matrix([[1,2],[3,4]]); or C:=matrix(2,2,[1,2,3,4]); You can enter the vector (1,2,3) by typing b := vector( [1,2,3]); etc. (To solve system of linear equations Ax=b, type linsolve(A,b);) Also, matrix multiplication is different than ordinary multiplication, so Maple uses &* for matrix products. The &* is essential; neither A*B, nor AB is acceptable. We must specifically request matrix evaluation with evalm, which is short for evaluate as a matrix. In order to find the inverse of matrix A, one can type inverse(A); or evalm(A^(-1)); Command det(A); will give you the value of the determinant of matrix A. Maple’s syntax for the transpose of A is transpose(A); you can get the reduced echelon form of A using rref(A); Elementary row operations from the linalg package are: mulrow(A, r, s); multiplies row r of matrix A by the number s. addrow(A, i, j, s); adds s times row i of matrix A to row j. swaprow(A, i, j); swaps rows i and j of matrix A. L O M N P Q