Tip:
Highlight text to annotate it
X
Matrix (mathematics)Jump to: navigation, search"Matrix theory" redirects here. For the physics topic, see Matrix string theory.Specific elements of a matrix are often denoted by a variable with two subscripts. For instance, a2,1 represents the element at the second row and first column of a matrix A.In mathematics, a matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. The individual items in a matrix are called its elements or entries. An example of a matrix with 2 rows and 3 columns is\begin{bmatrix}1 & 9 & -13 \\20 & 5 & -6 \end{bmatrix}. Matrices of the same size can be added or subtracted element by element. The rule for matrix multiplication is more complicated, and two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second. A major application of matrices is to represent linear transformations, that is, generalizations of linear functions such as f(x) = 4x. Forexample, the rotation of vectors in three dimensional space is a linear transformation. If R is a rotation matrix and v is a column vector (a matrix with only one column) describing the position of a point in space, the product Rv is a column vector describing the position of that point after a rotation. The product of two matrices is a matrix that represents the composition of two linear transformations. Another application of matrices is in the solution of a system of linear equations. If the matrix is square, it is possible to deduce some of its properties by computing its determinant. For example, a square matrix has an inverse if and only if its determinant is not zero. Eigenvalues and eigenvectors provide insight into the geometry of linear transformations.Applications of matrices are found in most scientific fields. In every branch of physics, including classical mechanics, optics, electromagnetism, quantum mechanics, and quantum electrodynamics, they are used to study physical phenomena, such as the mion of rigid bodies. In computer graphics, they are used to project a 3-dimensional image onto a 2-dimensional screen. In probability theory and statistics, stochastic matrices are used to describe sets of probabilities; for instance, they are used within the PageRank algorithm that ranks the pages in a Google search.[1] Matrix calculus generalizes classical analytical notions such as derivatives and exponentials to higher dimensions.A major branch of numerical analysis is devoted to the development of efficient algorithms for matrix computations, a subject that is centuries old and is today an expanding area of research. Matrix decomposition methods simplify computations, both theoretically and practically. Algorithms that are tailored to the structure of particular matrix structures, e.g. sparse matrices and near-diagonal matrices, expedite computations in finite element method and other computations. Infinite matrices occur in planetary theory and in atomic theory. A simple example is the matrix representin g the derivative operator, which acts on the Taylor series of a function.DefinitionA matrix is a rectangular arrangement of mathematical expressions that can be simply numbers.[2]Commonly a matrix is written as values in box brackets:For example,\mathbf{A} = \begin{bmatrix} 9 & 13 & 5 \\ 1 & 11 & 7 \\ 3 & 7 & 2 \\ 6 & 0 & 7 \end{bmatrix}.An alternative notation uses large parentheses instead of box brackets.The horizontal and vertical lines in a matrix are called rows and columns, respectively. The numbers in the matrix are called its entries or its elements. To specify the size of a matrix, a matrix with m rows and n columns is called an m-by-n matrix or m × n matrix, while m and n are called its dimensions. The above is a 4-by-3 matrix.A matrix with one row (a 1 × n matrix) is called a row vector, and a matrix with one column (an m × 1 matrix) is called a column vector. Any row or column of a matrix determines a row or column vector, obtained by removing all other rows or columns respectively from the matrix. For example, the row vector for the third row of the above matrix A is\begin{bmatrix} 3 & 7 & 2 \\ \end{bmatrix}.When a row or column of a matrix is interpreted as a value, this refers to the corresponding row or column vector. For instance one may say that two different rows of a matrix are equal, meaning they determine the same row vector. In some cases the value of a row or column should be interpreted just as a sequence of values (an element of Rn if entries are real numbers) rather than as a matrix, for instance when saying that the rows of a matrix are equal to the corresponding columns of its transpose matrix.Most of this article focuses on real and complex matrices, i.e., matrices whose elements are real or complex numbers, respectively. More general types of entries are discussed below.Notation The specifics of matrices notation varies widely, with some prevailing trends. Matrices are usually denoted using upper-case letters, while the corresponding lower-case letters, with two subscript indices,represent the entries. In addition to using upper-case letters to symbolize matrices, many authors use a special typographical style, commonly boldface upright (non-italic), to further distinguish matrices from other mathematical objects. An alternative notation involves the use of a double-underline with the variable name, with or without boldface style, (e.g., \underline{\underline{A}}).The entry in the i-th row and the j-th column of a matrix is typically referred to as the i,j, (i,j), or (i,j)th entry of the matrix. For example, the (1,3) entry of the above matrix A is 5. The (i, j)th entry of a matrix A is most commonly written as ai,j. Alternative notations for that entry are A[i,j] or Ai,j.Sometimes a matrix is referred to by giving a formula for its (i,j)th entry, often with double parenthesis around the formula for the entry, for example, if the (i,j)th entry of A were given by aij, A would be denoted ((aij)).An asterisk is occasionally used to refer to whole rows or columns in a matrix[citation needed]. For example, ai,∗ refers to the ith row of A, and a∗,j refers to the jth column of A. The set of all m-by-n matrices is denoted \mathbb{M}(m, n).A common shorthand isA = [ai,j]i = 1,...,m; j = 1,...,n or more briefly A = [ai,j]m×nto define an m × n matrix A. Usually the entries ai,j are defined separately for all integers 1 ≤ i ≤ m and 1 ≤ j ≤ n. They can however sometimes be given by one formula; for example the 3-by-4 matrix\mathbf A = \begin{bmatrix} 0 & -1 & -2 & -3\\ 1 & 0 & -1 & -2\\ 2 & 1 & 0 & -1 \end{bmatrix}can alternatively be specified by A = [i − j]i = 1,2,3; j = 1,...,4, or simply A = ((i-j)), where the size of the matrix is understood.Some programming languages start the numbering of rows and columns at zero, in which case the entries of an m-by-n matrix are indexed by 0 ≤ i ≤ m − 1 and 0 ≤ j ≤ n − 1.[3] This article follows the more common convention in mathematical writing where enumeration starts from 1.Basic operationsMain articles: Matrix addition, Scalar multiplication, Transpose, and Row operations There are a number of operations that can be applied to modify matrices called matrix addition, scalar multiplication and transposition.[4] These form the basic techniques to deal with 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 ≤ i ≤ m and 1 ≤ j ≤ n.\begin{bmatrix} 1 & 3 & 1 \\ 1 & 0 & 0 \end{bmatrix} + \begin{bmatrix} 0 & 0 & 5 \\ 7 & 5 & 0 \end{bmatrix} = \begin{bmatrix} 1+0 & 3+0 & 1+5 \\ 1+7 & 0+5 & 0+0 \end{bmatrix} = \begin{bmatrix} 1 & 3 & 6 \\ 8 & 5 & 0 \end{bmatrix}Scalar multiplication The scalar multiplication cA of a matrix A and a number c (also called a scalar in the parlance of abstract algebra) is given by multiplying every entry of A by c:(cA)i,j = c · Ai,j.2 \cdot \begin{bmatrix} 1 & 8 & -3 \\ 4 & -2 & 5 \end{bmatrix} = \begin{bmatrix} 2 \cdot 1 & 2\cdot 8 & 2\cdot -3 \\ 2\cdot 4 & 2\cdot -2 & 2\cdot 5 \end{bmatrix} = \begin{bmatrix} 2 & 16 & -6 \\ 8 & -4 & 10 \end{bmarix}Transpose 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.\begin{bmatrix} 1 & 2 & 3 \\ 0 & -6 & 7 \end{bmatrix}^\mathrm{T} = \begin{bmatrix} 1 & 0 \\ 2 & -6 \\ 3 & 7 \end{bmatrix} Familiar properties of numbers extend to these operations of matrices: for example, addition is commutative, i.e., the matrix sum does not depend on the order of the summands: A + B = B + A.[5] 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.Row operations are ways to change matrices. There are three types of row operations: row switching, that is interchanging two rows of a matrix; row multiplication, multiplying all entries of a row by a non-zero constant; and finally row addition, which means adding a multiple of a row to another row. These row operations are used in a number of ways including solving linear equations and finding inverses.Matrix multiplication, linear equations and linear transformationsMain article: Matrix multiplication.Schematic depiction of the matrix product AB of two matrices A and B.Multiplication of two matrices is defined 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 ≤ i ≤ m and 1 ≤ j ≤ p.[6] 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.[7] 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 m ≠ k. Even if both products are defined, they need not be equal, i.e., generally one has AB ≠ BA,i.e., 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:\begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix} \begin{bmatrix} 0 & 1\\ 0 & 0\\ \end{bmatrix}= \begin{bmatrix} 0 & 1\\ 0 & 3\\ \end{bmatrix}, whereas\begin{bmatrix} 0 & 1\\ 0 & 0\\ \end{bmatrix} \begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix}= \begin{bmatrix} 3 & 4\\ 0 & 0\\ \end{bmatrix} .The identity matrix In of size n is the n-by-n matrix in which all the elements on the main diagonal are equal to 1 and all other elements are equal to 0, e.g.\mathbf{I}_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}. It is called identity matrix because multiplication with it leaves a matrix unchanged: MIn = ImM = M for any m-by-n matrix M.Besides the ordinary matrix multiplication just described, there exist other less frequently used operations on matrices that can be considered forms of multiplication, such as the Hadamard product and the Kronecker product.[8] They arise in solving matrix equations such as the Sylvester equation.Linear equations.Main articles: Linear equation and System of linear equations.Matrices can be used to compactly write and work with multiple linear equations, i.e., systems of linear equations. For example, if A is an m-by-n matrix, x designates a column vector (i.e., n×1-matrix) of n variables x1, x2, ..., xn, and b is an m×1-column vector, then the matrix equation Ax = bis equivalent to the system of linear equations.A1,1x1 + A1,2x2 + ... + A1,nxn = b ...Am,1x1 + Am,2x2 + ... + Am,nxn = bm .[9]Linear transformationsMain articles: Linear transformation and Transformation matrixThe vectors represented by a 2-by-2 matrix correspond to the sides of a unit square transformed into a parallelogram.Matrices and matrix multiplication reveal their essential features when related to linear transformations, also known as linear maps. A real m-by-n matrix A gives rise to a linear transformation Rn → Rm mapping each vector x in Rn to the (matrix) product Ax, which is a vector in Rm. Conversely, each linear transformation f: Rn → Rm arises from a unique m-by-n matrix A: explicitly, the (i, j)-entry of A is the ith coordinate of f(ej), where ej = (0,...,0,1,0,...,0) is the unit vector with 1 in the jth position and 0 elsewhere. The matrix A is said to represent the linear map f, and A is called the transformation matrix of f.For example, the 2×2 matrix\mathbf A = \begin{bmatrix} a & c\\b & d \end{bmatrix}\, can be viewed as the transform of the unit square into a parallelogram with vertices at (0, 0), (a, b), (a + c, b + d), and (c, d). The parallelogram pictured at the right is obtained by multiplying A with each of the column vectors \begin{bmatrix} 0 \\ 0 \end{bmatrix}, \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 1 \\ 1 \end{bmatrix} and \begin{bmatrix}0\\ 1\end{bmatrix} in turn. These vectors define the vertices of the unit square.The following table shows a number of 2-by-2 matrices with the associated linear maps of R2. The blue original is mapped to the green grid and shapes. The origin (0,0) is marked with a black point.Horizontal shear with m=1.25. Horizontal flip Squeeze mapping with r=3/2 Scaling by a factor of 3/2 Rotation by π/6R = 30°\begin{bmatrix} 1 & 1.25 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 3/2 & 0 \\ 0 & 2/3 \end{bmatrix} \begin{bmatrix} 3/2 & 0 \\ 0 & 3/2 \end{bmatrix} \begin{bmatrix}\cos(\pi / 6^{R}) & -\sin(\pi / 6^{R})\\ \sin(\pi / 6^{R}) & \cos(\pi / 6^{R})\end{bmatrix}VerticalShear m=1.25.svg Flip map.svg Squeeze r=1.5.svg Scaling by 1.5.svg Rotation by pi over 6.svgUnder the 1-to-1 correspondence between matrices and linear maps, matrix multiplication corresponds to composition of maps:[10] if a k-by-m matrix B represents another linear map g : Rm → Rk, then the composition g ∘ f is represented by BA since(g ∘ f)(x) = g(f(x)) = g(Ax) = B(Ax) = (BA)x.The last equality follows from the above-mentioned associativity of matrix multiplication.The rank of a matrix A is the maximum number of linearly independent row vectors of the matrix, which is the same as the maximum number of linearly independent column vectors.[11] Equivalently it is the dimension of the image of the linear map represented by A.[12] The rank-nullity theorem states that the dimension of the kernel of a matrix plus the rank equals the number of columns of the matrix.[13]Square matricesA square matrix is a matrix with the same number of rows and columns. An n-by-n matrix is known as a square matrix of order n. Any two square matrices of the same order can be added and multiplied. A square matrix A is called invertible or non-singular if there exists a matrix B such thatAB = In.[14]This is equivalent to BA = In.[15] Moreover, if B exists, it is unique and is called the inverse matrix of A, denoted A−1.The entries Ai,i form the main diagonal of a matrix. The trace, tr(A) of a square matrix A is the sum of its diagonal entries. While matrix multiplication is not commutative as mentioned above, the trace of the product of two matrices is independent of the order of the factors: tr(AB) = tr(BA).[16]Also, the trace of a matrix is equal to that of its transpose, i.e., tr(A) = tr(AT).If all entries outside the main diagonal are zero, A is called a diagonal matrix. If only all entries above (below) the main diagonal are zero, A is called a lower triangular matrix (upper triangular matrix, respectively). For example, if n = 3, they look like\begin{bmatrix} d_{11} & 0 & 0 \\ 0 & d_{22} & 0 \\ 0 & 0 & d_{33} \\ \end{bmatrix} (diagonal), \begin{bmatrix} l_{11} & 0 & 0 \\ l_{21} & l_{22} & 0 \\ l_{31} & l_{32} & l_{33} \\ \end{bmatrix} (lower) and \begin{bmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \\ \end{bmatrix} (upper triangular matrix).l