Precalculus (Common Core) • Matrix Operations & Applications

Using Matrices to Represent & Manipulate Data

Discover how rectangular arrays of numbers can model payoff tables, network connections, and real-world decisions with elegant efficiency.

Precalculus subject emblem with a curved function graph, function notation, and pi.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context — Where Matrices Came From

Long before anyone called them "matrices," mathematicians were writing systems of equations and hunting for efficient ways to solve them. The idea of organizing coefficients into a grid—a rectangular table of numbers—emerged naturally from that quest. Today matrices are indispensable tools in fields as diverse as economics, computer science, physics, and network engineering, but their origins are rooted in surprisingly simple problems about simultaneous equations.

~200 BCE

Chinese mathematicians write the Nine Chapters on the Mathematical Art, which uses rectangular arrays of numbers to solve systems of linear equations—essentially performing Gaussian elimination two millennia before Gauss.

1850

James Joseph Sylvester coins the term "matrix" (Latin for "womb" or "source") while studying determinants. He sees the array as a generator of determinants rather than a single number itself.

1858

Arthur Cayley publishes A Memoir on the Theory of Matrices, formalizing matrix algebra—addition, multiplication, and the concept of an inverse matrix. This work lays the foundation for linear algebra as we know it.

1928

John von Neumann uses matrices to represent payoff structures in the newly born field of game theory, showing that strategic decisions among competitors can be analyzed through matrix operations.

1960s–Today

Matrices become central to computer science and data science. Adjacency matrices model networks (social media, roads, the internet), and payoff matrices drive AI decision-making in economics and machine learning.

The central question this lesson addresses is straightforward yet powerful: How can we organize complex, multi-dimensional data into a single mathematical object and then use standard operations to extract meaning from it? Whether you're modeling which roads connect which cities or calculating the best strategy in a competitive game, matrices provide the answer.

SECTION 2

Core Principles & Definitions

Before diving into applications, you need a firm grasp of what a matrix actually is and the vocabulary that surrounds it. A matrix is a rectangular array of numbers arranged in rows (horizontal) and columns (vertical). If a matrix has m rows and n columns, we call it an m × n (read "m by n") matrix. Each individual number inside the matrix is called an entry (or element), and we identify it by its row and column position—for instance, a2,3 means the entry in row 2, column 3.

1

Payoff Matrix

A matrix that records the outcomes (gains or losses) for each player in a strategic game, organized so that rows represent one player's choices and columns represent the other's.
2

Adjacency (Incidence) Matrix

A square matrix that encodes which nodes in a network are connected. A "1" (or a weight) means a connection exists; a "0" means it does not.
3

Matrix Dimensions

The size of a matrix is given as rows × columns. A 3 × 4 matrix has 3 rows and 4 columns—12 entries total. Dimensions determine which operations are allowed.
4

Matrix Operations on Data

Adding matrices combines data from two sources; scalar multiplication scales all entries; matrix multiplication synthesizes relationships—such as finding indirect connections in a network.
✦

KEY TAKEAWAY

Think of a matrix like a spreadsheet with strictly defined positions. Just as a spreadsheet organizes sales data so you can sort, filter, and calculate totals, a matrix organizes mathematical data—payoffs, distances, connections—so you can perform algebraic operations on the entire dataset at once instead of handling each number individually.

SECTION 3

Visual Explanation — Networks as Matrices

One of the most intuitive uses of matrices is representing networks (also called graphs). Consider a small network of four cities connected by highways. We can draw the network as a diagram with dots (nodes) and lines (edges), or we can capture exactly the same information in a square matrix called an adjacency matrix. Each row and each column correspond to a city. If city i is directly connected to city j, we place a 1 in row i, column j; otherwise we write 0.

NETWORK GRAPHADJACENCY MATRIXABCDA–BA–CA–DB–DC–D→ABCDABCD01111001100111101 = connected | 0 = not connected | diagonal = 0 (no self-loops)
A four-city network and its corresponding 4 × 4 adjacency matrix. Notice the matrix is symmetric because every road runs both ways.

Several properties jump out immediately. First, the main diagonal (top-left to bottom-right) is all zeros because no city connects to itself. Second, the matrix is symmetric—entry a1,2 equals entry a2,1—because the roads here are two-way. In a directed network (like one-way streets), the matrix would not necessarily be symmetric. Third, you can read the degree of each node (how many connections it has) by summing the entries in its row: city A has degree 3, city B has degree 2, city C has degree 2, and city D has degree 3.

SECTION 4

Mathematical Framework — Operations on Data Matrices

Once data lives inside a matrix, you can perform algebraic operations on it to extract deeper insights. The three operations you'll use most often are matrix addition, scalar multiplication, and matrix multiplication.

Matrix Addition (same dimensions required)

A+B→ci,j=ai,j+bi,jA + B → c_{i,j} = a_{i,j} + b_{i,j}

Add corresponding entries. Both matrices must be the same size.

Matrix addition is useful when you want to combine data from two similar sources. For example, if matrix A records the number of text messages sent between friends in Week 1 and matrix B records the same data for Week 2, then A + B gives the total messages over both weeks.

Scalar Multiplication

k×A→(kA)i,j=k⋅ai,jk × A → (kA)_{i,j} = k · a_{i,j}

Multiply every entry by the scalar k. Useful for scaling, unit conversion, or weighting.

If a payoff matrix records winnings in dollars and you need them in cents, multiply the entire matrix by 100. If you want to find the average of two adjacency matrices representing traffic at two time periods, you'd compute ½(A + B).

Matrix Multiplication (columns of A = rows of B)

(AB)i,j=Σk=1nai,k⋅bk,j(AB)_{i,j} = Σ_{k=1}^{n} a_{i,k} · b_{k,j}

Row i of A is dotted with column j of B. If A is m×n and B is n×p, the product AB is m×p.

Matrix multiplication is the most powerful operation here, and it has a remarkable interpretation for adjacency matrices. If M is the adjacency matrix of a network, then the entry (M²)i,j counts the number of two-step paths from node i to node j. This is because multiplying a row of M by a column of M effectively asks: "For each intermediate node k, is there an edge from i to k and from k to j?" Summing over all possible k gives the total number of two-hop routes.

Powers of Adjacency Matrices

(Mn)i,j=numberofpathsoflengthnfromnodeitonodej(M^n)_{i,j} = number of paths of length n from node i to node j

M¹ = direct connections, M² = two-step paths, M³ = three-step paths, etc.

SECTION 5

Detailed Breakdown — Payoff Matrices in Game Theory

While adjacency matrices model connections, payoff matrices model strategic decisions. In a two-player game, one player's options label the rows, and the other player's options label the columns. Each cell holds the payoff (reward or loss) for a specific combination of choices. This setup lets you analyze strategies systematically.

PRICING GAME — PAYOFF MATRIX← Firm B's Strategy →← Firm A's Strategy →High PriceLow PriceHighLowFirm A: +$8MFirm B: +$8MFirm A: +$2MFirm B: +$10MFirm A: +$10MFirm B: +$2MFirm A: +$4MFirm B: +$4MNash EquilibriumBoth firms choosing Low Price is the Nash equilibrium — neither can improve by switching alone.
A 2 × 2 payoff matrix for two competing firms. Each cell shows both players' outcomes for that strategy pair.

This diagram represents a classic Prisoner's Dilemma–style game. Even though both firms would earn $8M each if they cooperated on high prices, each firm is individually tempted to undercut the other by choosing the low price (earning $10M while the rival earns only $2M). When both give in to that temptation, both end up at $4M—worse than mutual cooperation. The matrix lays this tension bare in a way that a paragraph of text alone could never do.

We can represent the payoffs for Firm A alone as a numerical matrix:

Firm A's Payoff Matrix (millions $)

B:HighB:LowA:High[82]A:Low[104] B: High B: Low A: High [ 8 2 ] A: Low [ 10 4 ]

Rows = Firm A's strategies, Columns = Firm B's strategies. Each entry is Firm A's profit.

By separating the payoffs into individual matrices for each player, you can use matrix operations to analyze strategic scenarios. For instance, if both firms' payoffs change by a flat tax of $1M, you'd subtract the scalar 1 from every entry. If one firm's payoffs are doubled during a boom, you'd apply scalar multiplication to that firm's payoff matrix.

SECTION 6

Worked Example — Two-Step Paths in a Network

Let's walk through a complete problem that shows the power of matrix multiplication applied to a network's adjacency matrix.

Two-Step Paths in a Network

  1. 1

    Problem

    Three websites—X, Y, and Z—link to each other as follows: X links to Y and Z; Y links to Z; Z links to X. Find the adjacency matrix M, then compute M² and interpret the entry (M²)1,1.
  2. 2

    Step 1 — Build the Adjacency Matrix M

    Because these are directed links (a link from X to Y doesn't mean Y links to X), the matrix may not be symmetric. We place a 1 in row i, column j if site i links to site j, and 0 otherwise.
    M = [ [0, 1, 1], [0, 0, 1], [1, 0, 0] ]
  3. 3

    Step 2 — Compute M²

    Multiply M by itself. Each entry (M²)i,j is the dot product of row i with column j. Row 1 · Column 1: (0)(0) + (1)(0) + (1)(1) = 1 Row 1 · Column 2: (0)(1) + (1)(0) + (1)(0) = 0 Row 1 · Column 3: (0)(1) + (1)(1) + (1)(0) = 1 Row 2 · Column 1: (0)(0) + (0)(0) + (1)(1) = 1 Row 2 · Column 2: (0)(1) + (0)(0) + (1)(0) = 0 Row 2 · Column 3: (0)(1) + (0)(1) + (1)(0) = 0 Row 3 · Column 1: (1)(0) + (0)(0) + (0)(1) = 0 Row 3 · Column 2: (1)(1) + (0)(0) + (0)(0) = 1 Row 3 · Column 3: (1)(1) + (0)(1) + (0)(0) = 1
    M² = [ [1, 0, 1], [1, 0, 0], [0, 1, 1] ]
  4. 4

    Step 3 — Interpret (M²)₁,₁

    The entry in row 1, column 1 of M² is 1. This means there is exactly one two-step path from X back to X. Let's verify: X → Z → X. That's the only way to leave X and return in exactly two clicks. The path X → Y → Z doesn't return to X, confirming that just one cycle of length 2 starts and ends at X.
  5. 5

    Step 4 — Broader Interpretation

    Looking at the full M² matrix, you can read off all two-step paths at a glance. For example, (M²)3,2 = 1 tells us there's one two-step path from Z to Y (namely Z → X → Y). Entry (M²)2,2 = 0 confirms there is no way to leave Y and return in exactly two steps. This kind of analysis is invaluable in search-engine ranking algorithms and social network analysis.

SECTION 7

Strengths, Limitations & Comparisons

Matrices are extraordinarily versatile for data representation, but like any tool, they have sweet spots and limitations. Understanding both will help you decide when a matrix approach is the right choice.

FEATURESTRENGTHLIMITATION
CompactnessEncodes an entire network or payoff structure in a single objectFor very large, sparse networks (millions of nodes, few connections), most entries are 0—wasting memory
OperationsStandard operations (add, multiply, transpose) have clear data interpretationsMatrix multiplication requires matching inner dimensions and follows non-commutative rules (AB ≠ BA in general)
Path countingMn counts paths of length n—elegant and mechanicalDoesn't directly tell you which paths exist—only how many; further analysis is needed for path enumeration
Game theoryPayoff matrices reveal dominant strategies, Nash equilibria, and saddle points at a glanceOnly practical for a finite, manageable number of strategies per player; continuous strategy spaces need other tools
ScalabilityComputer algorithms handle matrix operations on networks with thousands of nodesFor networks with billions of edges (e.g., the full internet), specialized sparse-matrix or graph-database methods replace brute-force matrix storage
✦

KEY TAKEAWAY

A matrix is like a Swiss Army knife for structured data: remarkably capable for a wide range of small-to-medium problems, but if you're building a skyscraper (billions of data points), you'll need specialized heavy machinery. In a precalculus course, the matrices you work with will be small enough that the standard operations cover every scenario beautifully.

SECTION 8

Connection to Advanced Theory

The matrix skills you're building now form the foundation of linear algebra, one of the most important branches of college mathematics. Here's how the concepts in this lesson scale up.

THIS LESSONADVANCED VERSIONWHERE IT APPEARS
Adjacency matrix (0s and 1s)Weighted adjacency matrix (real-valued edge weights for distance, cost, or probability)GPS routing, airline scheduling, logistics optimization
M² counts two-step pathsEigenvalue analysis of M reveals long-term connectivity, centrality, and community structureGoogle's PageRank algorithm, social influence modeling
2 × 2 payoff matricesn-player games with mixed strategies, linear programming, and the Minimax TheoremEconomics, political science, AI strategy optimization
Matrix addition & scalar multiplicationVector spaces, basis vectors, and linear transformationsComputer graphics, quantum mechanics, machine learning

One particularly exciting extension is the concept of Markov chains. If you replace the 0s and 1s in an adjacency matrix with probabilities (so each row sums to 1), you get a transition matrix that predicts the probability of moving from one state to another. Raising this matrix to higher powers reveals long-term predictions—for example, what percentage of web surfers will end up on a given page after many random clicks. This is essentially how Google originally ranked web pages, and it all starts with the same matrix representation you've learned today.

SECTION 9

Practice Problems

Question 1: Problem 1 — Conceptual

Explain why the adjacency matrix of an undirected network (where every connection goes both ways) must be symmetric. What specific property of the entries ensures this?
Show answer
In an undirected network, if node i is connected to node j, then node j is also connected to node i. This means entry ai,j = aj,i for every pair (i, j). When every entry above the main diagonal equals its mirror entry below the diagonal, the matrix is by definition symmetric (meaning M = MT, the transpose). In contrast, a directed network can have ai,j = 1 while aj,i = 0 (a one-way connection), so its adjacency matrix need not be symmetric.

Question 2: Problem 2 — Basic Calculation

Three friends—Alex (A), Blake (B), and Casey (C)—follow each other on a social platform as follows: A follows B and C; B follows A; C follows A and B. Write the 3 × 3 adjacency matrix for this directed network, and find the degree (number of outgoing follows) for each person by summing each row.
Show answer
The adjacency matrix is: A B C
A [ 0 1 1 ]
B [ 1 0 0 ]
C [ 1 1 0 ]
Row sums (outgoing follows): Alex follows 2 people (B and C), Blake follows 1 person (A), and Casey follows 2 people (A and B). Notice the matrix is not symmetric—for example, B follows A but does not follow C, while C follows B.

Question 3: Problem 3 — Intermediate

Using the adjacency matrix from Problem 2, compute M² and determine how many two-step "follow chains" exist from Casey (C) to Casey (C). List the actual paths to verify.
Show answer
Computing M²: each entry is a dot product of a row and column of M. A B C
A [ 2 1 0 ]
B [ 0 1 1 ]
C [ 1 1 1 ]
The entry (M²)3,3 = 1, so there is exactly one two-step path from C back to C. The path is C → A → C (Casey follows Alex, and Alex follows Casey). The path C → B → A doesn't end at C, so it doesn't count. This confirms the matrix calculation.

Question 4: Problem 4 — Applied / Multi-Step

Two food trucks, Taco Town (T) and Burger Barn (B), each choose to park at the Beach or the Park. Their daily profit payoff matrix (in hundreds of dollars) for Taco Town is: B: Beach B: Park
T: Beach [ 3 8 ]
T: Park [ 6 4 ]
A new tax reduces every payoff by $100 (i.e., subtract 1 from each entry). Write the adjusted payoff matrix. Then determine: does Taco Town have a dominant strategy (one choice that's better no matter what Burger Barn does)?
Show answer
Subtracting 1 from each entry (scalar addition of −1): B: Beach B: Park
T: Beach [ 2 7 ]
T: Park [ 5 3 ]
Now check for a dominant strategy. If Burger Barn goes to the Beach: T earns 2 (Beach) vs. 5 (Park) → Park is better. If Burger Barn goes to the Park: T earns 7 (Beach) vs. 3 (Park) → Beach is better. Since the best choice depends on what Burger Barn does, Taco Town does not have a dominant strategy in the adjusted game. This is a situation where more advanced game theory techniques (like mixed strategies) would be needed.

Question 5: Problem 5 — Critical Thinking

Consider a network of four computers: A, B, C, and D. The adjacency matrix M is given below. Without computing M² fully, explain a method to determine the entry (M²)2,4 and interpret what it means. Then calculate that single entry. A B C D
A [ 0 1 1 0 ]
B [ 1 0 1 1 ]
C [ 1 1 0 1 ]
D [ 0 1 1 0 ]
Show answer
Method: To find (M²)2,4, you only need row 2 of M and column 4 of M. Take their dot product: Row 2 = [1, 0, 1, 1] and Column 4 = [0, 1, 1, 0]. Dot product = (1)(0) + (0)(1) + (1)(1) + (1)(0) = 0 + 0 + 1 + 0 = 1. Interpretation: There is exactly one two-step path from computer B to computer D. We can verify: B connects to A, C, and D directly. From A, can we reach D? A connects to B and C—not D. From C, can we reach D? C connects to A, B, and D—yes! From D, can we reach D? D is not connected to itself. So the one two-step path is B → C → D. This approach—computing just one entry instead of the entire M²—is efficient when you only need a specific piece of information, and it highlights how matrix multiplication is fundamentally built from dot products.

SUMMARY

Lesson Summary

Summary

Matrices are powerful tools for organizing and manipulating structured data. An adjacency matrix encodes which nodes in a network are connected, with each entry recording whether a direct link exists (1) or doesn't (0). A payoff matrix captures the outcomes of strategic decisions in game theory, with rows and columns representing different players' choices and entries representing profits or losses. Through matrix addition, you can combine datasets; through scalar multiplication, you can uniformly scale or adjust all entries; and through matrix multiplication, you can uncover deeper relationships—most notably, raising an adjacency matrix to the nth power reveals the number of n-step paths between any two nodes.

These foundational techniques connect directly to advanced fields: Markov chains use transition matrices to model probabilistic processes, Google's PageRank relies on eigenvalue analysis of massive adjacency matrices, and linear programming in economics extends payoff analysis to complex optimization. Every application begins with the same simple idea you've mastered today—arranging data in rows and columns and letting matrix algebra do the heavy lifting.

Varsity Tutors • Precalculus (Common Core) • Using Matrices to Represent & Manipulate Data