Difference between revisions of "Matrix Operations"

From Department of Mathematics at UTSA
Jump to navigation Jump to search
Line 83: Line 83:
 
===Matrix multiplication===
 
===Matrix multiplication===
 
[[File:MatrixMultiplication.png|thumb|300px|Schematic depiction of the matrix product '''AB''' of two matrices '''A''' and '''B'''.]]
 
[[File:MatrixMultiplication.png|thumb|300px|Schematic depiction of the matrix product '''AB''' of two matrices '''A''' and '''B'''.]]
''Multiplication'' of two matrices is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix. If '''A''' is an ''m''-by-''n'' matrix and '''B''' is an ''n''-by-''p'' matrix, then their ''matrix product'' '''AB''' is the ''m''-by-''p'' matrix whose entries are given by [[dot product]] of the corresponding row of '''A''' and the corresponding column of '''B''':
+
''Multiplication'' of two matrices is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix. If '''A''' is an ''m''-by-''n'' matrix and '''B''' is an ''n''-by-''p'' matrix, then their ''matrix product'' '''AB''' is the ''m''-by-''p'' matrix whose entries are given by dot product of the corresponding row of '''A''' and the corresponding column of '''B''':
 
:<span id="matrix_product"><math>[\mathbf{AB}]_{i,j} = a_{i,1}b_{1,j} + a_{i,2}b_{2,j} + \cdots + a_{i,n}b_{n,j} = \sum_{r=1}^n a_{i,r}b_{r,j},</math></span>
 
:<span id="matrix_product"><math>[\mathbf{AB}]_{i,j} = a_{i,1}b_{1,j} + a_{i,2}b_{2,j} + \cdots + a_{i,n}b_{n,j} = \sum_{r=1}^n a_{i,r}b_{r,j},</math></span>
  
where 1 ≤ ''i'' ≤ ''m'' and 1 ≤ ''j'' ≤ ''p''. For example, the underlined entry 2340 in the product is calculated as {{math|(2 × 1000) + (3 × 100) + (4 × 10) {{=}} 2340:}}
+
where 1 ≤ ''i'' ≤ ''m'' and 1 ≤ ''j'' ≤ ''p''. For example, the underlined entry 2340 in the product is calculated as (2 × 1000) + (3 × 100) + (4 × 10) = 2340:
 
:<math>
 
:<math>
 
\begin{align}
 
\begin{align}

Revision as of 14:50, 10 January 2022

Basic operations

There are a number of basic operations that can be applied to modify matrices, called matrix addition, scalar multiplication, transposition, matrix multiplication, row operations, and submatrix.

Addition, scalar multiplication, and transposition

Operations performed on matrices
Operation Definition Example
Addition The sum A+B of two m-by-n matrices A and B is calculated entrywise:
(A + B)i,j = Ai,j + Bi,j, where 1 ≤ im and 1 ≤ jn.

Scalar multiplication The product cA of a number c (also called a scalar in the parlance of abstract algebra) and a matrix A is computed by multiplying every entry of A by c:
(cA)i,j = c · Ai,j.

This operation is called scalar multiplication, but its result is not named "scalar product" to avoid confusion, since "scalar product" is sometimes used as a synonym for "inner product".

Transposition The transpose of an m-by-n matrix A is the n-by-m matrix AT (also denoted Atr or tA) formed by turning rows into columns and vice versa:
(AT)i,j = Aj,i.

Familiar properties of numbers extend to these operations of matrices: for example, addition is commutative, that is, the matrix sum does not depend on the order of the summands: A + B = B + A. The transpose is compatible with addition and scalar multiplication, as expressed by (cA)T = c(AT) and (A + B)T = AT + BT. Finally, (AT)T = A.

Matrix multiplication

Schematic depiction of the matrix product AB of two matrices A and B.

Multiplication of two matrices is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix. If A is an m-by-n matrix and B is an n-by-p matrix, then their matrix product AB is the m-by-p matrix whose entries are given by dot product of the corresponding row of A and the corresponding column of B:

where 1 ≤ im and 1 ≤ jp. For example, the underlined entry 2340 in the product is calculated as (2 × 1000) + (3 × 100) + (4 × 10) = 2340:

Matrix multiplication satisfies the rules (AB)C = A(BC) (associativity), and (A + B)C = AC + BC as well as C(A + B) = CA + CB (left and right distributivity), whenever the size of the matrices is such that the various products are defined. The product AB may be defined without BA being defined, namely if A and B are m-by-n and n-by-k matrices, respectively, and mk. Even if both products are defined, they generally need not be equal, that is:

ABBA,

In other words, matrix multiplication is not commutative, in marked contrast to (rational, real, or complex) numbers, whose product is independent of the order of the factors. An example of two matrices not commuting with each other is:

whereas

Besides the ordinary matrix multiplication just described, other less frequently used operations on matrices that can be considered forms of multiplication also exist, such as the Hadamard product and the Kronecker product. They arise in solving matrix equations such as the Sylvester equation.

Row operations

There are three types of row operations:

  1. row addition, that is adding a row to another.
  2. row multiplication, that is multiplying all entries of a row by a non-zero constant;
  3. row switching, that is interchanging two rows of a matrix;

These operations are used in several ways, including solving linear equations and finding matrix inverses.

Submatrix

A submatrix of a matrix is obtained by deleting any collection of rows and/or columns. For example, from the following 3-by-4 matrix, we can construct a 2-by-3 submatrix by removing row 3 and column 2:

The minors and cofactors of a matrix are found by computing the determinant of certain submatrices.

A principal submatrix is a square submatrix obtained by removing certain rows and columns. The definition varies from author to author. According to some authors, a principal submatrix is a submatrix in which the set of row indices that remain is the same as the set of column indices that remain. Other authors define a principal submatrix as one in which the first k rows and columns, for some number k, are the ones that remain; this type of submatrix has also been called a leading principal submatrix.

Resources