A matrix is a rectangular array of numbers arranged in rows and columns, written inside square brackets. A matrix with m rows and n columns has dimensions m × n, read “m by n”. Each number is an entry, named by its row and then its column: a23 is in row 2, column 3. The plural is matrices.
An entry is named by row, then column. In a product, each entry comes from one row of the first matrix times one column of the second, added up.
Formal definition and notation
An m × n matrix A is a rectangular array of mnnumbersaij, where i = 1, …, m is the row and j = 1, …, n is the column. Two matrices are equal when they have the same dimensions and equal corresponding entries. Matrices of the same dimensions are added entry by entry; the product AB is defined when A is m × n and B is n × p, giving an m × p matrix with entries cik = Σnj=1aijbjk.
Addition needs every entry to have a partner, so the dimensions must match exactly.
Not to be confused with
Matrixvs.Determinant
A matrix is the whole array; its determinant is a single number computed from a square matrix. For rows (3, 1) and (2, 4), the determinant is 3 · 4 − 1 · 2 = 10.
A vector is a quantity with size and direction, often written as a single row or column of numbers. A matrix can have many rows and columns; a vector is a matrix with one row or one column.
A two-way table organizes data with labels. A matrix holds only the numbers, so you can add, scale and multiply them.
Quick check: 3 questions
Question 1 of 3
A matrix has 2 rows and 5 columns. What are its dimensions?
Show answer and explanation
Answer: C. Rows first, then columns: 2 × 5. 5 × 2 reverses the order, and 10 and 7 are the entry count and the sum, not dimensions.
Question 2 of 3
A is 2 × 3 and B is 3 × 4. What are the dimensions of AB?
Show answer and explanation
Answer: A. The inner sizes (3 and 3) match, so the product exists, and the outer sizes give 2 × 4. BA would be undefined, since 4 does not match 2.
Question 3 of 3
A has rows (2, −1) and (0, 3). What is the entry in row 2, column 2 of −3A?
Show answer and explanation
Answer: D. Scalar multiplication multiplies every entry: −3 · 3 = −9. 3 forgets to multiply, −6 is row 1, column 1, and 0 is row 2, column 1.
Matrix: frequently asked questions
How do you read the dimensions of a matrix?
Count the rows (horizontal) first and the columns (vertical) second, and write rows × columns. A matrix with 4 rows and 2 columns is a 4 × 2 matrix, read “4 by 2”, and it holds 8 entries. A matrix with the same number of rows and columns, such as 3 × 3, is called a square matrix.
When can you multiply two matrices?
Only when the number of columns in the first equals the number of rows in the second. Write the dimensions side by side: (2 × 3)(3 × 5). If the inner numbers match, the product exists and its size is the outer numbers, 2 × 5. Because the order matters, AB can exist while BA does not.
What are matrices used for?
Matrices organize numbers so that many calculations happen at once. They solve systems of linear equations, transform images in computer graphics, track connections in networks, store spreadsheet-style data and run the calculations behind statistics and machine learning. In a game, a payoff matrix lists what each player wins for every choice.
ArrayAn array is an arrangement of objects in equal rows and equal columns, forming a rectangle. A 4 by 6 array has 4 rows of 6, so it holds 4 × 6 = 24 objects. Arrays show multiplication as equal groups, and turning one sideways shows that 4 × 6 = 6 × 4.Operations · Grade 2, Grade 3, Grade 4NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2MultiplicationMultiplication is the operation that combines equal groups to find a total. The fact 4 × 6 = 24 means 4 groups of 6, or 6 + 6 + 6 + 6. The numbers you multiply are called factors, and the result is the product. Order does not matter: 6 × 4 is also 24.Operations · Grade 2, Grade 3, Grade 4SquareA square is a quadrilateral with four equal sides and four right angles. It is a special rectangle and a special rhombus at the same time. For a square with side s, the perimeter is 4s, the area is s2, and each diagonal is s√2.Geometry · Kindergarten, Grade 2, Grade 3DataData are facts or values collected to answer a question, such as survey answers, measurements or counts. Numerical data are numbers you measure or count, like heights; categorical data are labels or groups, like favorite colors. Data are organized in tables and shown in graphs so patterns are easy to see.Statistics · Grade 2, Grade 3, Grade 6System of EquationsA system of equations is a set of two or more equations that use the same variables and are solved together. Its solution is the values that make every equation true at the same time. For two linear equations, that is the point where the two lines cross. A system can have one solution, none, or infinitely many.Algebra · Grade 8, Algebra 1UndefinedUndefined describes an expression that has no value, most often because it divides by zero. 70 is undefined, since no number times 0 gives 7. A vertical line has an undefined slope, and 3x − 2 is undefined at x = 2. Undefined does not mean zero: 07 = 0, but 70 has no value.Problem Solving · Grade 6, Grade 8, Algebra 1AdditionAddition is the operation that puts amounts together to find the total. The numbers you add are called addends, the answer is the sum, and the sign is the plus sign, +. For example, 7 + 5 = 12. On a number line, adding a positive number means moving to the right.Operations · Kindergarten, Grade 1, Grade 2VectorA vector is a quantity that has both a size, called its magnitude, and a direction. It is drawn as an arrow from an initial point to a terminal point and written in components, such as v = ⟨ 4, 3 ⟩: 4 units right and 3 units up. Velocity and force are vectors; speed and mass are not.Trigonometry · PrecalculusTwo-Way TableA two-way table shows counts for two categorical variables collected from the same group, with one variable in the rows and the other in the columns. Each inside cell is a joint frequency, and the totals in the margins are marginal frequencies. Dividing a cell by a row or column total gives relative frequencies that reveal associations.Statistics · Grade 8, Algebra 1SideA side is one of the straight line segments that form the outline of a polygon. Two sides meet at each corner, or vertex. A triangle has 3 sides and a square has 4, and adding the lengths of all the sides gives the perimeter.Geometry · Kindergarten, Grade 1, Grade 2Linear EquationA linear equation is an equation whose graph is a straight line. In one variable, it usually has a variable to the first power, like 3x + 2 = 14. In two variables, it can be written in forms like y = mx + b, where m is the slope. No variable is squared, multiplied by another variable or in a denominator.Algebra · Grade 7, Grade 8, Algebra 1CoefficientA coefficient is the number multiplied by a variable in a term. In 4a the coefficient is 4, in −3x it is −3, and in x it is 1, because x = 1x. The sign in front belongs to the coefficient. A number standing alone, with no variable, is a constant instead.Algebra · Grade 6, Grade 7, Grade 8Ordered PairAn ordered pair is two numbers written to locate a point on the coordinate plane. It is written as (x, y): the x-value comes first, and the y-value comes second. From the origin, move x units across, then y units up or down. The order matters: (2, 5) and (5, 2) are different points.Geometry · Grade 5, Grade 6, Grade 7TransformationA transformation moves or changes a figure on the coordinate plane. The four common transformations are translations (slides), reflections (flips), rotations (turns) and dilations (resizing). The original figure is the preimage and the result is the image, labeled with primes such as A′. Only a dilation changes the size.Geometry · Grade 7, Grade 8, Algebra 1Elimination MethodThe elimination method solves a system of equations by adding or subtracting them so one variable cancels. Scaling one equation first is often needed to make the coefficients match. After one variable is eliminated, solve for the other variable, then substitute back to find the first.Algebra · Grade 8, Algebra 1Commutative PropertyThe commutative property says that changing the order of the numbers does not change the result of adding or multiplying them: a + b = b + a and a × b = b × a. For example, 4 + 9 = 9 + 4 and 3 × 5 = 5 × 3. Subtraction and division are not commutative.Operations · Grade 1, Grade 3, Grade 6Associative PropertyThe associative property says that when you add or multiply three or more numbers, the way you group them does not change the result: (a + b) + c = a + (b + c) and (a × b) × c = a × (b × c). It lets you pick the easiest pair first. It does not work for subtraction or division.Operations · Grade 1, Grade 3, Grade 6