UPI Study › Courses › Discrete Mathematics › Free lessons › Lesson 12.2 Free with a free account
Matrix Operations and Inverses
Discrete Mathematics · Chapter 12: Matrices and TransformationsSection 12.2 · lesson 78 of 8710 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Discrete Mathematics.
Lesson complete
Earn the 4 college credits for Discrete Mathematics
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Rotation Matrices and Their Applications →← Introduction to MatricesNext lesson: Rotation Matrices and Their Applications →
In this lesson
The arithmetic that turns a grid into a tool for solving equations.
- Multiply matrices and check dimensions
- Compute 2 × 2 and 3 × 3 determinants
- Find and verify a 2 × 2 inverse
- Solve a linear system with an inverse
Transcript
Everything said in the video, section by section (1,401 words). Read along, or search it.
Matrices and Transformations
Matrix Operations and Inverses
This section turns the matrix from a grid of numbers into a tool for solving equations. We'll multiply matrices, compute a single number called the determinant, and use it to find an inverse. Then we'll use that inverse to solve a system of linear equations outright.
The Opening Problem
Equations Collapsed Into One Formula
Suppose a machine learning practitioner fits a simple linear regression, predicting a house's price from its size and its age. The standard closed-form solution comes down to solving a small system of linear equations, for the model's coefficients. In matrix form, that system is A x equals b. And it has an exact solution, x equals A inverse times b, whenever the square matrix A has an inverse. The same idea, collapsing a system of equations into one matrix inversion, underlies circuit analysis, structural load calculations, and much more. This section develops the mechanics that make that formula usable. It's all algebraic here. Sections twelve point three and twelve point four add the geometric side.
12.2.1
Matrix Multiplication
Start with multiplication. Let A be an m by n matrix, and B an n by p matrix. The key is that the number of columns of A equals the number of rows of B. Their product, A B, is an m by p matrix. Take the entry in row i, column j of the product. It's the dot product of row i of A, with column j of B. Multiply term by term, then add. If A's column count doesn't match B's row count, the product A B simply isn't defined. That's not a convenience. Each output entry pairs a whole row of A against a whole column of B, so the two must be the same length to pair up completely.
Figure 1
Computing One Entry of AB
Here's a concrete case. A is two by three, with rows one, two, three, and four, five, six. B is three by two, with rows seven, eight, then nine, ten, then eleven, twelve. A has three columns, and B has three rows. They match, so A B is defined, and it will be two by two. To get the top left entry, pair row one of A with column one of B. One times seven, plus two times nine, plus three times eleven. That's seven plus eighteen plus thirty-three, which is fifty-eight. Every other entry of A B is a different row and column pairing of the same two matrices.
Worked Example
All 4 Entries of AB
Working out all four entries the same way. Row one with column two gives one times eight, plus two times ten, plus three times twelve, which is sixty-four. Row two with column one gives four times seven, plus five times nine, plus six times eleven, which is one hundred thirty-nine. And row two with column two gives one hundred fifty-four. So A B is the two by two matrix with rows fifty-eight, sixty-four, and one hundred thirty-nine, one hundred fifty-four.
Order Matters
BA Is a Different Shape Entirely
Now multiply in the other order. Something more surprising happens than just a different answer. B A is defined too, because B has two columns and A has two rows. But B is three by two, and A is two by three, so B A is three by three. That's a different shape entirely. Carrying out the same row and column pairing gives rows thirty-nine, fifty-four, sixty-nine, then forty-nine, sixty-eight, eighty-seven, then fifty-nine, eighty-two, one hundred five. So matrix multiplication is not commutative. Order can change not only the values, but the very dimensions of the result.
12.2.2
The 2 × 2 Determinant
Next, the determinant. For a two by two matrix with entries a, b in the top row, and c, d in the bottom row, the determinant is a d minus b c. Take A, with rows two, one, and five, three. Its determinant is two times three, minus one times five. Six minus five is one. Now take S, with rows two, four, and one, two. Its determinant is two times two, minus four times one. Four minus four is zero. That zero isn't a coincidence of these particular numbers. It's the exact signal that S has no inverse. A's nonzero determinant guarantees that A does have one.
3 × 3 in Brief
Cofactor Expansion Along Row 1
For a three by three matrix, the determinant uses cofactor expansion. Pick a row, usually the first. Delete one entry's row and column, and a smaller two by two matrix is left. Its determinant is called that entry's minor. Each entry is combined with its minor. The signs alternate: plus, minus, plus. Take M, with rows one, two, three, then zero, one, four, then five, six, zero. The three minors work out to minus twenty-four, minus twenty, and minus five. So the determinant is one times minus twenty-four, minus two times minus twenty, plus three times minus five. That's minus twenty-four, plus forty, minus fifteen, which is one. So a two by two determinant combines two products directly, and a three by three combines three minors, each a two by two determinant.
12.2.3
The Inverse Matrix
Now, the inverse. For a square matrix A, its inverse, A inverse, is the matrix that multiplies A from either side to give the identity. If no such matrix exists, A is called singular. Otherwise, it's nonsingular. Here's the central fact. A square matrix is invertible if and only if its determinant is not zero. For a two by two matrix, there's a direct formula. Swap a and d, negate b and c, and then divide every entry by the determinant.
Worked Example
Computing and Verifying an Inverse
Let's use it on A, with rows two, one, and five, three, whose determinant is one. Swapping and negating gives rows three, minus one, and minus five, two. Dividing by one changes nothing. Check it. Multiplying A by this matrix gives six minus five, then minus two plus two, then fifteen minus fifteen, then minus five plus six. That's one, zero, zero, one, the identity, so the inverse is confirmed. Why does a zero determinant rule out an inverse? Multiplying A by the formula gives a d minus b c times the identity, all divided by a d minus b c. That works whenever a d minus b c isn't zero. For S, the formula would divide by zero, which is undefined. So S has no inverse at all.
12.2.4
Solving a System With the Inverse
Here's the payoff. The system two x plus y equals seven, and five x plus three y equals seventeen, can be written as one matrix equation, A x equals b. A is the same matrix as before, x is the column of unknowns, and b is the column of constants, seven and seventeen. Multiply both sides on the left by A inverse. Since A inverse times A is the identity, the left side collapses to just x. So x equals A inverse times b. That's three times seven, minus seventeen, which is four. And minus five times seven, plus two times seventeen, which is minus one. So x is four and y is minus one. Substituting back confirms both original equations.
Table 2
What det(A) Settles, and What It Doesn't
This method depends entirely on A being invertible. When the determinant is nonzero, there's exactly one solution, given directly by A inverse times b. When the determinant is zero, the inverse method can't be used at all. But be careful. That alone doesn't say whether the system has no solution, or infinitely many. It depends on b. The method also scales awkwardly. A full n by n inverse needs n squared minors, each an n minus one by n minus one determinant, so the work grows rapidly. In practice, larger systems are solved with Gaussian elimination, combining the rows of A alongside b, to reach a solution directly. Still, the inverse method remains the clearest way to see why a nonzero determinant means a unique solution.
Takeaways
Multiply, Test, Invert, Solve
To summarize. Matrix multiplication needs the inner dimensions to match. An m by n matrix times an n by p matrix gives an m by p result, and A B and B A usually differ. A two by two determinant is a d minus b c. A three by three determinant reduces to three two by two determinants by cofactor expansion. A square matrix has an inverse exactly when its determinant is nonzero. And then A x equals b has the unique solution, A inverse times b. Here's something to think about. A matrix S has determinant zero, so a student concludes that S x equals b has no solutions. Using S, with rows two, four, and one, two, test that claim against two different choices of b. Is the student's conclusion justified?
About Discrete Mathematics at UPI Study
Discrete Mathematics (Math 230) is a self-paced online course of 87 video lessons in 13 chapters, from logic and proof to counting, probability, graph theory and trees. It carries a NCCRS credit recommendation for 4 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus Every course with PRO →
Why take it here
Why students take Discrete Mathematics with UPI Study
Where the credit goes
Universities that work with NCCRS
Discrete Mathematics carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Matrix Operations and Inverses
When can you multiply two matrices, and how do you find the size of the product?
How do you calculate a 2 × 2 and a 3 × 3 determinant?
How do you find the inverse of a 2 × 2 matrix and check that it's correct?
How do you solve a system of linear equations using a matrix inverse?
About the Discrete Mathematics course
How many college credits is Discrete Mathematics?
How much does Discrete Mathematics cost and what is included?
Which universities accept UPI Study credits?
How long does Discrete Mathematics take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 4 credits in Discrete Mathematics.
87 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
4 credits · NCCRSEnroll →