Math glossary

Matrices in Math: Definitions, Types, and Operations

Read matrix dimensions and entries, identify common types, and work through examples of addition, multiplication, transpose, and systems.

TL;DR

A matrix is a rectangular array arranged in rows and columns. Its dimensions are rows by columns. Different operations have different size rules. Matrix multiplication pairs each selected row with a selected column.

Key Points

  • A matrix with mm rows and nn columns has dimensions m×nm\times n.
  • The entry aija_{ij} is in row ii and column jj.
  • Add or subtract matrices only when both dimensions match.
  • Multiply when the left column count matches the right row count.
  • Special matrices such as the identity and zero matrix have distinct roles.

What is a matrix in mathematics?

A matrix stores entries in a rectangular table. An entry can represent a measurement, a system coefficient, or a component of a transformation. The horizontal positions form rows. The vertical positions form columns.

Write aija_{ij} to refer to row ii and column jj of matrix AA. The first subscript always names the row. It helps to read dimensions in the same order: rows, then columns. For instance, a matrix with three rows and two columns is 3×23\times2 and has six entries. OpenStax, Matrices and Matrix Operations

A three-row, two-column matrix highlights the entry in row three and column one
Read the dimensions as three by two. The marked value is in position (3,1)(3,1).

Which types of matrices should you recognise?

Type What to look for
Row matrix Exactly one row
Column matrix Exactly one column
Square matrix The number of rows equals the number of columns
Zero matrix Every entry is zero
Diagonal matrix It is square and all off-diagonal entries are zero
Identity matrix A diagonal matrix with every diagonal entry equal to 1
Upper triangular matrix All entries below the main diagonal are zero
Symmetric matrix It is square and equals its transpose

A transpose switches rows and columns. It sends the entry in position (i,j)(i,j) to (j,i)(j,i) and turns a 3×23\times2 matrix into a 2×32\times3 one. A square matrix may meet several definitions at once. For instance, the identity is diagonal, symmetric, and triangular. OpenStax, Precalculus: Matrices and Matrix Operations

How do matrix addition, scaling, and multiplication differ?

Add or subtract two matrices of the same dimensions by combining entries in matching positions. To multiply a matrix by a scalar, multiply every entry by that scalar.

In matrix multiplication, take a row of the left matrix and a column of the right matrix. Multiply entries from matching positions within that pair, then add. A product of an m×nm\times n matrix and an n×pn\times p matrix has dimensions m×pm\times p. The shared nn counts the terms in each dot product. Reversing the factors can produce a different answer or make the product undefined. The 3 × 3 product guide walks through a full calculation. Georgia Tech, Interactive Linear Algebra: Matrix Multiplication

What rules carry over from ordinary arithmetic?

Matrix addition is commutative and associative when the matrices have equal shapes. The zero matrix with matching dimensions is the additive identity. The additive inverse of AA is −A-A, made by changing every entry’s sign. Multiplication by an ordinary number distributes over matrix addition. The products (A+B)C(A+B)C and AC+BCAC+BC also agree when the sizes allow them, because each output entry adds corresponding scalar terms. Matrix multiplication itself is associative for compatible sizes and usually depends on order. OpenStax, Operations and Their Properties

For example, let AA have rows (1,4),(−2,3)(1,4),(-2,3) and BB have rows (2,−1),(5,0)(2,-1),(5,0). To compute 2A−B2A-B, double each entry of AA and subtract the matching entry of BB. The two rows of the result are (0,9)(0,9) and (−9,6)(-9,6). The sign of the second entry of BB matters because 8−(−1)=98-(-1)=9.

The transpose also has a useful order rule. (AB)T=BTAT(AB)^{\mathsf T}=B^{\mathsf T}A^{\mathsf T} because the row of one product becomes the column of its transpose. If AA is 2×32\times3 and BB is 3×43\times4, both sides have shape 4×24\times2. Checking dimensions can catch a reversed formula before you calculate its entries.

How do matrices represent systems of equations?

Place the coefficients of each equation in a different row. Keep the variables in a fixed column order. For instance, in a system with unknowns xx and yy, column 1 holds the xx coefficients. Column 2 holds the yy coefficients. The numbers on the right of the equations form a separate column.

Writing A𝐱=𝐛A\mathbf{x}=\mathbf{b} condenses those equations. If AA is square and has an inverse, the system has the unique solution 𝐱=A−1𝐛\mathbf{x}=A^{-1}\mathbf{b}. A zero determinant means that method cannot be used. A rectangular matrix can still represent a valid system and can be row-reduced. The inverse matrix guide explains when the inverse exists. OpenStax, Solving Systems With Inverses

Worked Matrix Examples

Example 1

Find the dimensions and entry a31a_{31} of

A=(27−1350).A=\begin{pmatrix}2&7\\-1&3\\5&0\end{pmatrix}.
  1. There are three rows and two columns.
  2. The dimensions are 3×23\times2.
  3. Row 3 starts with 5, so a31=5a_{31}=5.

Example 2

Add the matrices with rows (1,4),(−2,3)(1,4),(-2,3) and (2,−1),(5,0)(2,-1),(5,0).

  1. Both have dimensions 2×22\times2.
  2. Adding their first rows gives (3,3)(3,3).
  3. Adding their second rows gives (3,3)(3,3). The entire result contains four entries equal to 3.

Example 3

Multiply the matrices

A=(120−134),B=(21053−2).A=\begin{pmatrix}1&2&0\\-1&3&4\end{pmatrix}, \qquad B=\begin{pmatrix}2&1\\0&5\\3&-2\end{pmatrix}.
  1. The inner sizes are both 3, so the result has shape 2×22\times2.
  2. Row 1 of AA dotted with column 1 of BB gives 1(2)+2(0)+0(3)=21(2)+2(0)+0(3)=2.
  3. The full result has first row (2,11)(2,11) and second row (10,6)(10,6).

Example 4

Transpose a matrix with first row (2,0,4)(2,0,4) and second row (−1,3,5)(-1,3,5).

  1. The first column becomes (2,−1)(2,-1) as a row.
  2. The second becomes (0,3)(0,3), and the third becomes (4,5)(4,5).
  3. The result has three rows and two columns.

Example 5

Apply the diagonal matrix with diagonal entries 2 and 3 to the column vector with entries 4 and −1-1.

  1. The first row multiplies 4 by 2 and contributes zero from the other coordinate.
  2. The second row multiplies −1-1 by 3.
  3. The resulting vector has entries 8 and −3-3. Each diagonal entry scales the matching coordinate.

Example 6

Represent 2x+y=72x+y=7 and 3x−y=83x-y=8 by a matrix equation and find the solution.

  1. The coefficient matrix has rows (2,1)(2,1) and (3,−1)(3,-1).
  2. The right-hand column contains 7 and 8. Adding the equations eliminates yy.
  3. Then 5x=155x=15, so x=3x=3 and y=1y=1. Both original equations check.

Mistakes That Change a Matrix Answer

Mistake 1: Reading the first dimension as columns

A 2×32\times3 matrix has two rows and three columns. Position (2,3)(2,3) means the final entry in its second row.

Mistake 2: Adding matrices with the same number of entries but different shapes

A 2×32\times3 matrix and a 3×23\times2 matrix each have six entries. Their positions do not match for addition.

Mistake 3: Using entrywise multiplication for an ordinary matrix product

The standard product combines rows with columns. Only use entrywise multiplication when the question specifies it.

Try It Yourself

  1. How many entries does a 4×24\times2 matrix have?
  2. What shape is the product of a 3×23\times2 matrix and a 2×42\times4 matrix?
  3. Is the square matrix with rows (2,5)(2,5) and (5,−1)(5,-1) symmetric?

Answers and Reasoning

  1. Eight entries.
  2. The shared size 2 matches, producing a 3×43\times4 matrix.
  3. Yes. The off-diagonal positions both contain 5, so taking the transpose leaves it unchanged.

Frequently Asked Questions

What does the identity matrix do?

Multiplying a compatible matrix by the identity leaves its entries unchanged. The identity’s diagonal ones select matching rows or columns.

Can two non-square matrices multiply?

Yes. Only the inner dimensions need to match. The product can be square or rectangular.

Does every matrix have a determinant?

A determinant is defined for square matrices. The 3 × 3 determinant guide explains the calculation for that size.

Conclusion

  • Read dimensions and subscripts in row-then-column order.
  • Check the shape rule for the requested operation.
  • Use a small row, column, or entry calculation to verify the result.

Read More

Research Behind This Article

  1. OpenStax, Algebra and Trigonometry 2e: Matrices and Matrix Operations. OpenStax
  2. OpenStax, Precalculus 2e: Matrices and Matrix Operations. OpenStax
  3. Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra: Matrix Multiplication. Georgia Tech
  4. OpenStax, Algebra and Trigonometry 2e: Solving Systems With Inverses. OpenStax