660 likes | 993 Views
Matrices And Linear Systems. Matrices – definitions 1. A matrix is a rectangular array of numbers. Examples:. Note that we surround the matrix with “brackets” (or “braces”). Matrices – definitions 2. Matrices are comprised of rows and columns :. This is a row ; the 1 st row.
E N D
Matrices – definitions 1 A matrix is a rectangular array of numbers. Examples: Note that we surround the matrix with “brackets” (or “braces”)
Matrices – definitions 2 Matrices are comprised of rows and columns: This is a row; the 1st row. This is an element of the matrix (or an “entry” of the matrix). This is a column; the 6th column.
Matrices – definitions 3 The order of a matrix is written as (m x n) where m is the number of rows and n is the number of columns. For example: This matrix has order… 4 x 6 This matrix has order… 2 x 3 (Try a few more)
Matrices – arithmetic 1 The rules for combining matrices are similar but different from those for numbers or vectors. Be careful about that! Addition and subtraction
Matrices – arithmetic 2 We deduce our first rule about matrices: Let These matrices had order 2x2, but the same rule will always work as long as A and B have the same order.
Matrices – arithmetic 3 Notice that adding matrices is just like adding vectors. That’s because vectors are matrices with only one column. Hopefully you remember that we can multiply a vector by a “scalar” (real number) like this: We can do exactly the same with any matrix of any order (this follows from the rule of addition).
Matrices – arithmetic 4 Just as for vectors, we cannot divide a matrix by another matrix, but we can multiply in certain cases. To see a detailed example of how this works, please now turn to page 301 of the red book. A good simple way to remember how to multiply matrices: “Rows x Columns”
Matrices – arithmetic 5 Matrix multiplication is limited. We can multiply matrix A of order m x n by matrix B of order p x q if and only if Schematically: For each pair of matrices on the next slide, decide if you can multiply them, and then try it!
Matrices – arithmetic 7 Any more?
Matrices – arithmetic 8 From our calculations, you should have noticed something important: In general we say that given any two matrices A, B, then usually: Matrix multiplication is NOT commutative
Matrices – arithmetic 9 The fact that multiplication is not commutative means that we must be very careful when saying “AB”; it is not the same as “BA”. However, matrix multiplication is “associative”, which means: whenever these multiplications make sense. Remember: “left multiply” is different from “right multiply” but the sequence in which several multiplications occur doesn’t matter
Matrices – arithmetic 10 This concludes the section on Matrix Arithmetic. If this material was new to you, you have to practice it!
Matrices – transformation 1 Consider what happens if we left multiply a 2D vector by a 2x2 matrix: • Is this multiplication possible? • Why? • What is the order of A? Yes; (2x2)x(2x1) gives a resulting matrix whose order is (2x1). So A is another 2D vector:
Matrices – transformation 2 The matrix M: can be thought of as a transformation which sends any vector to a new vector What are the unit vectors i and j changed to, under the transformation M? We can say that the image of iand j under the transformation M are the vectors given by the columns of M.
Matrices – transformation 3 It’s very important to understand it visually: These are just two vectors; what about others?
Matrices – transformation 4 Think about how regions are transformed, e.g. the unit square: Now we can see what the transformation is doing! Can you describe it in English? • Answer: • rotation (counterclockwise) • stretch (or “enlarge”) • shear (no reflection)
Matrices – transformation 5 Basic ideas to remember: • A matrix M of order (n x n) can be thought of as a transformation of n-dimensional space • Applying the transformation to an n-dimensional vector means left multiplying that vector by M • To find the geometrical effect of M we can apply it to each unit vector (i, j, (k), ..) Exercise: Describe the effect of the transformation on a cube of unit volume.
Matrices – transformation 5 Answer: • In words: • i is transformed to 0.5i + 0.5j + 0.5k • j is transformed to itself (unchanged) • k is stretched by a factor of 4 changes to a parallelepiped Visually, a cube through a combination of stretch, shear and rotate.
Matrices – transformation 6 (To think about: why isn’t matrix multiplication commutative?) Consider again our original 2-D transformation matrix M: We have seen that M maps the unit square, with (i,j) as sides, to a parallelogram. What is the area of that parallelogram? After some investigation, you should see that for any matrix the area will be
Matrices – Scalar and vector product Please refer to the handout for a summary of scalar (dot) and vector (cross) product Practice your understanding. What is: The vector product is distributive and associative, but not commutative:
Matrices – Scalar and vector product 2 Let’s recall the transformation of areas: The area of the bluesquare is The area of the red parallelogram is
Matrices – Scalar and vector product 3 A summary so far: • For a 2D transformation given by a matrix : • In general, M can stretch, shear, rotate and reflect any given line or shape • You can understand what M does by recognizing that it maps i to and j to • M always maps parallelograms to parallelograms, and the area is changed by a factor • (The sign of ad-bc indicates reflection or not)
Matrices – Determinants 1 What does it mean visually if ? • It means: • The 2 vectors which i and j are mapped to are in the same line • The area of the parallelogram in the “image” is zero Definition: The DETERMINANT of a 2x2 matrix is and it represents a scale factor for area. Its sign indicates whether there is a reflection.
Matrices – Determinants 2 Determinants in 3 dimensions. A transformation in 3D such as maps the unit cube to a parallelepiped: as already discussed. How can we find the volume of the parallelepiped? The area of the base is |b x c|
Matrices – Determinants 3 You should have found that the correct formula for the volume is: This is not ambiguous (we don’t need brackets). Why? By symmetry (a, b, c are not special), we can also write: or The term is called the “scalar triple product” of the three vectors a, b, c. It is also the DETERMINANT of the matrix A.
Matrices – Determinants 4 Let’s examine how we can calculate the determinant of A. Consider the 3 rows as vectors: Then What do you notice about these three terms?
Matrices – Determinants 5 Answer: they are all determinants of 2x2 matrices: Hopefully you can now see that the determinant of A, which is the scalar triple product a.bxc, is the sum of the products of each component of a with the determinant of the 2x2 matrix it doesn’t intersect:
Matrices – Special matrices Before we delve further into the wonderful world of determinants, it will be useful to know a few special kinds of matrix: Any matrix with the same number of rows as columns Square matrix - Transpose - , the transpose of A, is the matrix formed by swapping the rows and columns of A Example:
Matrices – Special matrices 2 A square matrix all of whose entries are zero except those on the main diagonal. Diagonal matrix - Using subscript notation, we would say that: Examples (all of these matrices are diagonal): (usually we would not consider a non-square matrix as diagonal).
Matrices – Special matrices 3 A diagonal matrix all of whose entries are 1. Identity matrix - The identity matrix is always written as As you can see, for each number n there is a corresponding identity matrix:
Matrices – Special matrices 4 consists of all zeros. Null matrix - Discuss: • If , what does that tell you about A? • Let’s right-multiply a matrix M of order (2x3) by an identity matrix. (a) What is the order of the identity matrix? (b) What is the product MI? • What is the result if we multiply I by I? • Is diagonal matrix multiplication commutative? • Prove that • Do the operations “matrix multiplication” and “matrix transpose” commute?
Matrices – Determinants 6 Find the determinants of these 2x2 and 3x3 matrices: Answers: det(A) = 1 det(B) = -12 det(C) = 160 det(D) = 0 What patterns/rules do you notice? What makes it easy/difficult?
Matrices – Determinants 7 Remembering the principle that a 3x3 determinant represents a scale factor for volume, answer these conceptual questions without calculating: • What is det(I)? (I=identity) Explain geometrically • What is det(AB), if det(A)=2 and det(B)=7? Explain visually. Don’t forget the pattern of the signs when calculating determinants:
Matrices – Determinants 8 A few more example questions: • What does it mean if det(A)=0? • Let A be the following matrix: Suppose det(A) = k What are the det(B) and det(C), where B and C are the following: 5. Write down the determinant of D without calculations:
Matrices – Determinants 9 Remember: the determinant of a 3x3 matrix is zero the three rows or three columns of the matrix are coplanar (this statement assumes that the zero vector is “in” all planes) • You should now be able to: • Calculate the determinant of a 2x2 matrix • Calculate the determinant of a 3x3 matrix • Recognize the geometrical meaning of the determinant • and make deductions based on that knowledge.
Matrices – Inverse 1 Given a matrix A, how can we find a matrix B such that AB=I? Why is this question important? Suppose we want to find x,y such that: Or: we want to find a vector that is mapped to under the transformation
Matrices – Inverse 2 This can be solved by simple matrix multiplication
Matrices – Inverse 3 Simple algebra will show you that Calculating the inverse of a 3x3 matrix is a lot more work, usually. There are 4 steps: • Calculate the determinant of M • Find the transpose of M - • Replace each term in with its cofactor • Divide the resulting matrix (called the “adjoint”) by the result of (1), i.e.:
Matrices – Inverse 4 Please read the yellow book p. 90 for a summary of this method. Note: There is another method of finding the inverse, which we will discuss later. • How are the determinants of a matrix M and its inverse • related? • Under what circumstances does a matrix M not have • an inverse?
Matrices – Inverse 5 • Find the determinants and inverses, where they exist, • of the following square matrices:
Matrices – Linear systems 1 Solve the following “system” of equations: Ans: (1,1,3) Could you solve the following system using the same method? Would you make mistakes? Are there alternative methods we could use?
Matrices – Linear systems 2 We call sets of equations like this: “systems of linear equations” because each unknown variable occurs only to power 1, individually. So, there are no terms like:
Matrices – Linear systems 3 Notice that we can solve linear systems using the inverse of a matrix: To solve: write so that
Matrices – Linear systems 4 Now we can use our knowledge of matrix inverses to find the solution: Given: find: and thus verify that the solution to the system is x=1, y=1, z=3. Answer:
Matrices – Gaussian elimination As we can see, matrix inversion is a difficult and error prone method, but it is important to know about it. Gaussian elimination is a systematic way to solve this type of system. We reduce the augmented matrix to row-echelon form. Review p. 104-105 of the yellow book for the method. See also p.8-10 of my document “A Visual Introduction to Linear Algebra.
Matrices – Linear systems 5 To keep things simple, let’s stick to systems with 3 equations and 3 unknowns. How many solutions can there be? • One • Zero • Infinitely many ( a line) • Infinitely many ( a plane) Consider carefully the images on the next slides, which are copied from my document “A Visual Guide to Linear Algebra”.