Using Matrices to
Represent & Manipulate Data
Learn how matrices organize real-world information: payoff tables, network connections, and more — then discover how matrix operations transform that data.
What Is a Matrix?
A matrix is a rectangular array of numbers arranged in rows and columns. We describe its size as \( m \times n \), where \( m \) is the number of rows and \( n \) is the number of columns.
Why Use Matrices for Data?
Matrices let you compress entire tables of information into a single mathematical object you can add, subtract, and multiply — making it easy to analyze and transform complex data.
Key Vocabulary
Core Matrix Operations
Three operations let you manipulate matrix data. Each has a clear rule about when it can be applied and what it produces.
Addition: Entry by Entry
Two matrices can be added or subtracted only if they share the same dimensions. The operation pairs each entry with its counterpart in the other matrix.
Scalar Multiplication
Multiplying a matrix by a scalar \( k \) means scaling every single entry by that number. The matrix dimensions stay the same.
Matrix vs. Scalar vs. Vector
| Object | Dimensions | Example | Use Case |
|---|---|---|---|
| Scalar | \( 1 \times 1 \) | \( 7 \) | A single measurement |
| Row Vector | \( 1 \times n \) | \( \begin{bmatrix} 3 & 5 \end{bmatrix} \) | One observation, many features |
| Column Vector | \( m \times 1 \) | \( \begin{bmatrix} 3 \\ 5 \end{bmatrix} \) | Several observations of one feature |
| Matrix | \( m \times n \) | \( \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \) | Full data table |
Adjacency Matrices for Networks
An adjacency matrix encodes which nodes in a graph are connected. If node \( i \) connects to node \( j \), then \( a_{ij} = 1 \); otherwise \( a_{ij} = 0 \).
How to Build a Data Matrix
Example 1: Store Inventory
Two stores sell three products. Matrix \( A \) holds January sales and matrix \( B \) holds February sales. Find total sales \( A + B \).
Example 2: Payoff Matrix
In a two-player game, each cell holds the payoff for Player 1 given each combination of strategies. Positive means a gain; negative means a loss.
Example 3: Matrix Multiplication
A bakery has a \( 2 \times 3 \) quantity matrix \( Q \) (stores × items) and a \( 3 \times 1 \) price vector \( P \). The product \( QP \) gives total revenue per store.
Dimension Compatibility Rule
Matrix multiplication \( A \cdot B \) is only defined when the number of columns in \( A \) equals the number of rows in \( B \).
Common Mistakes
Operations Summary
| Operation | Requirement | Result Size | Rule |
|---|---|---|---|
| \( A + B \) | Same dimensions | Same as \( A \) | Add entry by entry |
| \( A - B \) | Same dimensions | Same as \( A \) | Subtract entry by entry |
| \( kA \) | Any matrix | Same as \( A \) | Multiply every entry by \( k \) |
| \( A \cdot B \) | Cols of \( A \) = Rows of \( B \) | \( m \times n \) | Row-by-column dot product |
Question 1 of 5
If \( A \) is a \( 3 \times 4 \) matrix and \( B \) is a \( 4 \times 2 \) matrix, what are the dimensions of \( AB \)?
Question 2 of 5
Given \( A = \begin{bmatrix} 2 & 5 \\ 1 & 3 \end{bmatrix} \) and \( B = \begin{bmatrix} 4 & 1 \\ 6 & 0 \end{bmatrix} \), what is entry \( (1,2) \) of \( A + B \)?
Question 3 of 5
A graph has 4 nodes. Its adjacency matrix is \( 4 \times 4 \) and symmetric. If the sum of all entries in row 1 is 3, how many edges connect to node 1?
Question 4 of 5
If \( C = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \), what is \( 3C \)?
Question 5 of 5
A store sells two items. The quantity matrix is \( Q = \begin{bmatrix} 4 & 6 \end{bmatrix} \) and the price vector is \( P = \begin{bmatrix} 3 \\ 5 \end{bmatrix} \). What is the total revenue \( QP \)?