Mathematics

Operations with Matrices

Operations with matrices involve addition, subtraction, and multiplication of matrices. When adding or subtracting matrices, corresponding elements are combined. For matrix multiplication, the number of columns in the first matrix must equal the number of rows in the second matrix. The resulting matrix has dimensions equal to the number of rows in the first matrix and the number of columns in the second matrix.

Written by Perlego with AI-assistance

9 Key excerpts on "Operations with Matrices"

  • Book cover image for: Linear Algebra
    eBook - PDF
    CHAPTER 3 MATRIX OPERATIONS The concept of matrices was discussed in the previous chapter. It is not only an important tool for treating a system of linear equations, but also an indispensable tool for studying linear functions. In the following chapters we shall often make use of it. The advantage of matrix operations is that when a matrix is regarded as a quantity, it makes operations on arrays of ordinary numbers extremely simple. In this chapter we shall discuss matrix operations, particularly as regards the following three aspects. 1. Matrix addition, matrix subtraction, scalar multiplication, matrix multipli-cation, etc., as well as the basic properties of these matrix operations. 2. Some specially important matrices. 3. The necessary and sufficient condition for a matrix to be invertible and methods of finding an inverse matrix. This chapter is divided into three parts in which we in turn consider the above three aspects. 3.1. Matrix Addition and Matrix Multiplication In Sec. 2.1 the definition of a matrix was given. The matrix A of order n is called a nonsingular matrix if its determinant A ^ 0. Otherwise, i.e., A = 0, A is called a singular matrix. When all elements are real numbers, A is called a real matrix. As in the case of equality, addition, scalar multiplication of vectors, we have the following definitions. 92
  • Book cover image for: Mathematical Techniques in GIS
    • Peter Dale(Author)
    • 2014(Publication Date)
    • CRC Press
      (Publisher)
    129 7 Matrices and Determinants 7.1 BASIC MATRIX OPERATIONS Matrices are a mathematical form of shorthand. At its simplest level, a matrix is a set of numbers aligned in rows and columns in the form of a rectangle and then enclosed in brackets. Each number within the matrix is an element and the whole set of numbers may be referred to as an array . Rather than talk about each of the elements within the array, we can simply refer to the matrix as a whole and call it M . For example, = 1 2 3 4 5 6 M is a matrix with the first six integers arranged with two rows and three columns and is called a 2 * 3 matrix . Think of M as six boxes or cells, each containing a number, rather like a spreadsheet: 1 2 3 4 5 6 Likewise, we may have a single column of cells with boxes stacked vertically, as in 7 8 9 This is a column matrix with three rows and one column or 3 * 1. If the number of rows equals the number of columns then the matrix is said to be square. Thus, − − 1 0 0 0 2 0 0 0 3 130 Mathematical Techniques in GIS is a 3 * 3 square matrix. It has nine cells and since in this example the only numbers other than zero lie along the diagonal, it is called a diagonal matrix . The diagonal from top left to bottom right is called the leading diagonal . If all the numbers in the leading diagonal are 1 and all the other elements are zero, then the matrix is called an identity matrix . Thus, 1 0 0 1 and 1 0 0 0 1 0 0 0 1 and 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 are all identity matrices and are often written as I . The way that matrices are manipulated follows certain rules that are ideally suited to handling in a computer as the operations are in general repetitive. Two matrices can be added or subtracted if they are the same size. This is done by adding or sub-tracting the corresponding elements (Box 7.1).
  • Book cover image for: Elementary Linear Algebra, International Metric Edition
    1. A + B = B + A Commutative property of addition 2. A + ( B + C ) = ( A + B ) + C Associative property of addition 3. ( cd ) A = c ( dA ) Associative property of multiplication 4. 1 A = A Multiplicative identity 5. c ( A + B ) = cA + cB Distributive property 6. ( c + d ) A = cA + dA Distributive property Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300 2.2 Properties of Matrix Operations 53 One important property of the addition of real numbers is that the number 0 is the additive identity. That is, c + 0 = c for any real number c . For matrices, a similar property holds. Specifically, if A is an m × n matrix and O mn is the m × n matrix consisting entirely of zeros, then A + O mn = A . The matrix O mn is a zero matrix, and it is the additive identity for the set of all m × n matrices. For example, the matrix below is the additive identity for the set of all 2 × 3 matrices. O 23 = bracketleft.alt2 0 0 0 0 0 0 bracketright.alt2 When the size of the matrix is understood, you may denote a zero matrix simply by O or 0 . The properties of zero matrices listed below are relatively easy to prove, and their proofs are left as an exercise. (See Exercise 65.) The algebra of real numbers and the algebra of matrices have many similarities. For example, compare the two solutions below. Real Numbers m × n Matrices (Solve for x .) (Solve for X .) x + a = b X + A = B x + a + ( -a ) = b + ( -a ) X + A + ( -A ) = B + ( -A ) x + 0 = b -a X + O = B -A x = b -a X = B -A Example 2 demonstrates the process of solving a matrix equation. Solving a Matrix Equation Solve for X in the equation 3 X + A = B , where A = bracketleft.alt2 1 0 -2 3 bracketright.alt2 and B = bracketleft.alt2 -3 2 4 1 bracketright.alt2 . SOLUTION Begin by solving the equation for X to obtain 3 X = B -A X = 1 3 ( B -A ) .
  • Book cover image for: Mathematical Tools for Applied Multivariate Analysis
    40 2. VECTOR AND MATRIX OPERATIONS FOR MULTIVARIATE ANALYSIS 2.4 MATRIX REPRESENTATION As in our introduction to vector arithmetic, our purpose here is to describe various operations involving matrices as they relate to subsequent discussion of multivariate procedures. Again, we attempt no definitive treatment of the topic but, rather, select those aspects of particular relevance to subsequent chapters. We first present a discussion of elementary relations and operations on matrices and then turn to a description of special types of matrices. More advanced topics in matrix algebra are relegated to subsequent chapters and the appendixes. 2.5 BASIC DEFINITIONS AND OPERATIONS ON MATRICES A matrix A of order m by n, and with general entry (aij), consists of a rectangular array of real numbers (scalars) arranged in m rows and n columns. v mxn 011 021 012 0 2 2 an a i2 a„ &2n yflij )mxn L 4 X 5 l m u ml · · · a m j . . For example, a 4 x 5 matrix would be explicitly written, in brackets, as 011 012 013 014 015 021 022 023 024 025 031 032 033 034 035 041 042 043 044 fl 45 where i = 1, 2, 3,4 and / = 1, 2, 3,4, 5. As is the case for vectors, matrices will appear in boldfaced type, such as A, B, C, etc. A matrix can exhibit any relation between m, the number of rows, and n, the number of columns. For example, if either m > n or n > m, we have a rectangular matrix. (The former is often called a vertical matrix, while the latter is often called a horizontal matrix.) If m = «, the matrix is called square. To illustrate, bn b ì2 b ì3 ~ b 2 b 2 2 ^23 B 3 x 3 '31 '32 '33 2.5. BASIC DEFINITIONS AND OPERATIONS ON MATRICES 41 The set of elements on the diagonal, from upper left to lower right, is called the main or principal diagonal of the square matrix B. Square matrices occur quite frequently as derived matrices in multivariate analysis. For example, a correlation matrix, to be described later in the chapter, is a square matrix.
  • Book cover image for: Matrix Algebra Using MINimal MATlab
    2 MATRIX OPERATIONS In this chapter we define the basic operations of matrix algebra. We will see that these operations obey most — but not all— of the laws of ordi­ nary algebra. That’s the whole idea. Matrix notation enables us to write complicated systems of linear equations, including differential equations, in a compact form. Matrix notations, suitably modified to handle the exi­ gencies of the computer keyboard, provide the ideal way of instructing the computer to solve complicated problems. At the end of this chapter we learn how to use MINIMAT to instruct the computer to perform matrix operations. The main respects in which the laws of matrix algebra differ from those of ordinary algebra are as follows: • The operations are only defined when the sizes of the inputs are related in a certain way (which depends on the particular operation). • The commutative law AB = BA generally fails. • It is not true (as it is for numbers) that a matrix A has an inverse A~l if it is nonzero. Because of the failure of the commutative law, we do not define matrix division B/A. We use A~lB and BA~l instead. 27 28 2. MATRIX OPERATIONS Throughout the book, the symbol F denotes either the set R of real numbers or the set C of complex numbers. 2.1 M atrices Defined Fix positive integers m and n. An m x n matrix with entries from F is an array where the entry is a number from F. There are m rows and n columns in an m x n matrix. We say that an m x n matrix is a matrix of size m x n when we want to call attention to the number of rows and columns.1 A square matrix is one having the same number of rows as columns. We call a matrix rectangular when we wish to emphasize that we are not assuming that it is square. A real matrix is one whose entries are real (i.e. from R). We call a matrix com plex when we wish to emphasize that its entries might not be real. The set of all m x n matrices with entries from F is denoted by F mXn.
  • Book cover image for: Invitation to Linear Programming and Game Theory
    2 Matrix Algebra In Chapter 1, we encountered matrices as a device to streamline the process of elimination to solve systems of linear equations. However, matrices have a life of their own beyond being a bookkeeping aid for elimination. In this chapter, the algebra of matrices and some simple applications are introduced. A large part of the rest of the book illustrates more applications of matrices. They are quite useful, and their theory is rich and deep. This book is a mere introduction, and it is not very theoretical; if the reader is interested in learning more about matrices, the next step would be to take a course in linear algebra, where the theory is developed more carefully and completely than it is here. 2.1 Matrices A matrix (plural, matrices) is a rectangular array of numbers, called entries or elements. As we’ll see later in this text, it is sometimes useful to allow the entries of a matrix to be ordered pairs instead of individual numbers. But for now, we’ll stick to the given definition. The size or dimensions of a matrix are the number of (horizontal) rows and (vertical) columns (in that order), so that a 2 × 3 matrix is one with two rows and three columns. Capital letters will be used to stand for a matrix, and the entries inside are referred to by the corresponding lowercase letters. Different entries are distinguished by their address, which is a double subscript indicating in which row and column it appears. Thus, a ij refers to the element of the matrix A in the i th row and j th column. For example, in the matrix A =  2 1 3 0 −1 3  , we have a 11 = 2, a 13 = 3 = a 23 , etc. The general pattern (for a 3 × 4 matrix, for example) is A = A 3×4 = ⎡ ⎣ a 11 a 12 a 13 a 14 a 21 a 22 a 23 a 24 a 31 a 32 a 33 a 34 ⎤ ⎦ . (Notice that we sometimes write the dimensions of the entire matrix A as a subscript on A.) If there are more than nine rows or columns in A, we use commas to separate the row and column subscripts.
  • Book cover image for: Linear Algebra and Matrix Analysis for Statistics
    CHAPTER 1 Matrices, Vectors and Their Operations Linear algebra usually starts with the analysis and solutions for systems of linear equations such as a 11 x 1 + a 12 x 2 + . . . + a 1 n x n = b 1 , a 21 x 1 + a 22 x 2 + . . . + a 2 n x n = b 2 , . . . a m 1 x 1 + a m 2 x 2 + . . . + a mn x n = b m . Such systems are of fundamental importance because they arise in diverse mathemat-ical and scientific disciplines. The a ij ’s and b i ’s are usually known from the manner in which these equations arise. The x 0 i s are unknowns that satisfy the above set of equations and need to be found. The solution to such a system, depends on the a ij ’s and b i ’s. They contain all the information we need about the system. It is, therefore, natural to store these numbers in an array and develop mathematical operations for these arrays that will lead us to the x i ’s. Example 1.1 Consider the following system of three equations in four unknowns: 4 x 1 + 7 x 2 + 2 x 3 = 2 , -6 x 1 -10 x 2 + x 4 = 1 , 4 x 1 + 6 x 2 + 4 x 3 + 5 x 4 = 0 . (1.1) All the information contained in the above system can be stored in a rectangular array with three rows and four columns containing the coefficients of the unknowns and another single column comprising the entries in the right-hand side of the equation. Thus,   4 7 2 0 -6 -10 0 1 4 6 4 5   and   2 1 0   are the two arrays that represent the linear system. We use two different arrays to distinguish between the coefficients on the left-hand side and the right-hand side. Alternatively, one could create one augmented array   4 7 2 0 2 -6 -10 0 1 1 4 6 4 5 0   1 2 MATRICES, VECTORS AND THEIR OPERATIONS with a “ | ” to distinguish the right-hand side of the linear system. We will return to solving linear equations using matrices in Chapter 2 . More gener-ally, rectangular arrays are often used as data structures to store information in com-puters.
  • Book cover image for: Mathematical Methods for Physicists
    eBook - PDF
    3 Matrix algebra As vector methods have become standard tools for physicists, so too matrix methods are becoming very useful tools in sciences and engineering. Matrices occur in physics in at least two ways: in handling the eigenvalue problems in classical and quantum mechanics, and in the solutions of systems of linear equa-tions. In this chapter, we introduce matrices and related concepts, and define some basic matrix algebra. In Chapter 5 we will discuss various Operations with Matrices in dealing with transformations of vectors in vector spaces and the operation of linear operators on vector spaces. Definition of a matrix A matrix consists of a rectangular block or ordered array of numbers that obeys prescribed rules of addition and multiplication. The numbers may be real or complex. The array is usually enclosed within curved brackets. Thus 1 2 4 2 1 7 is a matrix consisting of 2 rows and 3 columns, and it is called a 2 3 (2 by 3) matrix. An m n matrix consists of m rows and n columns, which is usually expressed in a double sux notation: ~ A ˆ a 11 a 12 a 13 a 1 n a 21 a 22 a 23 . . . a 2 n . . . . . . . . . . . . a m 1 a m 2 a m 3 . . . a mn 0 B B B B @ 1 C C C C A : 3 : 1 † Each number a i j is called an element of the matrix, where the first subscript i denotes the row, while the second subscript j indicates the column. Thus, a 23 100 refers to the element in the second row and third column. The element a i j should be distinguished from the element a ji . It should be pointed out that a matrix has no single numerical value; therefore it must be carefully distinguished from a determinant. We will denote a matrix by a letter with a tilde over it, such as ~ A in (3.1).
  • Book cover image for: An Engineer's Introduction to Programming with MATLAB 2019
    • Shawna Lockhart, Eric Tilleson(Authors)
    • 2019(Publication Date)
    • SDC Publications
      (Publisher)
    INTRODUCTION 83 5 Objectives When you have com- pleted this tutorial, you will be able to 1. Explain the difference between an array, a matrix, a vector, and a scalar. 2. Specify an array in MATLAB using brackets and semi- colons. 3. Understand the concepts of a diagonal, identity, and magic matrix. 4. Add, subtract, multiply, and divide a matrix by a scalar or vector. 5. Raise the values in a matrix to a scalar power or a vector of powers. 6. Use MATLAB functions to create test matrices. 7. Seed a sequence of random numbers so that the sequence can be replicated. 8. Recognize when two matrices meet the requirements for matrix multiplication. 9. Perform a matrix multiplication manually. 10. Have a rudimentary understanding of an inverse matrix and a matrix determinant. MATRICES Introduction You can use MATLAB to write a program that is as complex and useful as any in another programming language, as well as easily visualize the data and create 3D graphs, but MATLAB’s ability to deal with matrices sets it apart. The branch of mathematics called linear algebra is built on the interac- tion and manipulation of matrices to solve complex problems. Linear algebra is generally taught following the calculus series. Linear algebra and matrix mathematics are used in engineering (modeling circuits, robotic motion), physics (quantum mechanics), computer graphics (reflections, 3D projections to 2D), and digital photography (device- based color correction), just to scratch the surface. We can’t teach linear algebra here, but you’ll get a glimpse of some of its potential uses and gain an understanding of matrices. When you have a need for solutions using matrices, you’ll find MATLAB invaluable. What Is a Matrix? As you learned previously, a matrix (plural: matrices) is a two-dimen- sional, rectangular array consisting of rows and columns. A vector is a matrix with only one row (1 x N) or one column (N x 1).
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.