PrecalculusSystems of Equations and Matrices4 of 6
Systems of Equations and Matrices · 4
Matrix Operations
When we work with a system of equations, we spend most of our time copying the variables x,y, and z over and over when only the numbers in front of them are changing.
1
Matrices, Dimensions, and Entries
A matrix is a grid of numbers where each number's position (its row and column) tells us what it stands for. To work with matrices, we need a standard way to state the size of a grid, point to a single number inside it, and tell when two matrices are equal.
Matrices, Dimensions, and Entries
3x+2y=12
5x−1y=7
2x+4y+1z=10
1x+0y+3z=5
4x−2y+2z=8
We name a matrix with a capital letter like A and point to an entry inside it with a lowercase letter and its row-then-column address:
A=[512894],arow, col⟶a13=9,a21=1
Read a13 as "a one-three" (Row 1, Column 3), not "a thirteen."
Two matrices are equal only when they have the exact same dimensions and their matching entries are equal in every spot, which lets us solve for missing entries inside equal matrices:
[x12893y]=[5128912]
Text solution
Match Row 1, Column 1Since both matrices are 2×3 and all the other entries already match, the top-left entries must be equal.
x=5
Match Row 2, Column 3Setting the bottom-right entries equal gives a one-step equation for y.
3yy=12=4
2
Adding, Subtracting, and Scaling Matrices
Now we want to combine two matrices of data or multiply a whole matrix by a single number at once.
Adding, Subtracting, and Scaling Matrices
Addition and subtraction combine matching spots directly, so both matrices must have the exact same dimensions:
Multiplying a matrix by a single number out in front multiplies every entry inside by that number:
scalar3[512894]=[1536242712]
When an equation combines scaling and addition, we can find an unknown entry by tracking just its position across the equation:
2[x3]+[14]=[910]
Text solution
Write the top-row equationScaling and adding the top entries on the left must equal the top entry on the right.
2x+1=9
Solve for xSubtract 1 and divide by 2 to get x by itself.
2xx=8=4
3
Multiplying Matrices
Entry-by-entry arithmetic works when two matrices represent the same kind of table, like Saturday sales and Sunday sales. When we multiply two matrices, the first matrix holds smoothie recipes across its rows and the second holds ingredient prices down its columns, so we need a way to combine each row with each column:
[211232]241312
Multiplying Matrices
Text solution
Combine Row 1 with Columns 1 and 2Walk across Row 1 of the first matrix and down each column of the second, multiplying paired numbers and adding them up to fill the top row of the answer.
Putting the four totals into their row-and-column spots gives the 2×2 product showing the cost of each smoothie at each store:
[211232]241312=[1112139]
Each spot in the product matrix comes from pairing the matching row of the first matrix with the matching column of the second matrix.
Every slot in the product matrix combines its matching row from the first matrix with its matching column from the second matrix.
4
When Multiplication Works and Why Order Matters
Because multiplication walks across a row of the first matrix and down a column of the second, we need to know when two matrices have sizes that can pair up, and whether multiplying A⋅B gives the same answer as B⋅A.
When Multiplication Works and Why Order Matters
A=[1023]B=[4102]
AB=?BA
Even when both products work, swapping the order of the matrices can change which numbers pair together, as we see with A=[1023] and B=[4102].
Text solution
Multiply AB using rows of A and columns of BPair each row of A with each column of B.
The top-left entry is 6 in AB and 4 in BA, so AB=BA for these matrices.
Each row of the first matrix pairs up with each column of the second, so the rows and columns have to be the same length, and the number of rows in the first and columns in the second set the size of the product.
Matching inner dimensions pair every entry across a row with an entry down a column, while the outer dimensions set the size of the product.
5
Writing a System as a Matrix Equation
Now that we know how rows multiply columns, we can write an entire system of linear equations as a single matrix equation.
Writing a System as a Matrix Equation
Walking across each row of coefficients and down the column of unknowns rebuilds the left-hand side of each equation, turning the system 3x+2y=12 and 5x−1y=7 into A⋅X=B:
When setting up A, keep the variables in the same column order in every equation, writing −1 for a subtracted variable like −y and 0 whenever a variable is missing from an equation.
6
The Identity Matrix
In ordinary algebra, multiplying a number by 1 leaves it unchanged (1x=x). The identity matrix I is the matrix version of 1: multiplying a matrix by an identity matrix of the matching size gives the exact same matrix right back.
The Identity Matrix
5x=101x=x
[????][xy]=[xy]
To leave every variable alone in its own row without mixing the other variables in, I puts 1s down the main diagonal and 0s everywhere else:
I=[1001],I=100010001
When I multiplies a column of unknowns, each row keeps one variable and zeroes out the rest:
[1001][xy]=[(1⋅x)+(0⋅y)(0⋅x)+(1⋅y)]=[xy]
With 1s on the main diagonal and 0s everywhere else, I leaves any matrix it can multiply unchanged.
In each row, 1s keep the matching variables and 0s multiply them by 0. To leave the column unchanged for every choice of x, y, and z, the matrix needs 1s down the main diagonal and 0s everywhere else.
Key concepts
Matrix operations split into two distinct ways of working depending on what the operation is doing:
Spot-by-spot operations (equality, addition, subtraction, and scaling)
Always read sizes and entry addresses as Row×Column (so a21 is Row 2, Column 1 of A). Two matrices can be equal only when their dimensions are identical, and you can add or subtract them only when their dimensions are identical. You work one matching spot at a time, never row-by-column. A scalar in front of a matrix multiplies every entry inside:
2[5128]+[3240]=[134816]
Row-by-column multiplication (AB)
Do not multiply matching entries spot-by-spot. First write the dimensions side by side in the exact order of multiplication, such as (2×3)⋅(3×2): the inner numbers must match for the product to be defined, and the outer numbers give the size of the answer. To find entry crow, col of the product, walk across that row of the first matrix and down that column of the second, multiplying pairs and adding them up. Because the first matrix uses its rows and the second uses its columns, order matters: AB and BA can differ, and one may be undefined.
Matrix equations and the identity matrix (AX=B and I)
Row-by-column multiplication writes a linear system as AX=B, where A holds the coefficients, X is the column of unknowns, and B is the column of constants on the right sides of the equations. The identity matrix I=[1001] has 1s down the main diagonal and 0s everywhere else, leaving any matching matrix unchanged when multiplied.
7
Practice
1
Find the dimensions of A=436−1987−2105−4, and find the entries a23 and a32.
Going columns-by-rows gives the wrong dimensions 4×3, and swapping the row and column subscripts gives a23=8 and a32=−2.
Count horizontal rows first and vertical columns second, then use that same row,column order to read each subscript.
Count 3 horizontal rows and 4 vertical columns to get dimensions 3×4. (Warning: Going columns-by-rows gives the wrong dimensions 4×3, and swapping the row and column subscripts gives a23=8 and a32=−2.)
For a23, look at Row 2, Column 3 to get −2. For a32, look at Row 3, Column 2 to get 8.
AnswerDimensions: 3×4;a23=−2;a32=8
2
For A=[40−1532] and B=[1320−14], find 2A−B.
Multiply every entry of A by the scalar 2 first, then subtract the matching entry of B in each spot.
Scale every entry of A by 2:
2A=[80−21064]
Subtract B entry by entry (Warning: Watch the negative sign in Row 1, Column 3 when subtracting −1; computing 6−1 instead of 6−(−1) gives 5 in the top-right spot and the wrong matrix [7−3−41050]):
2A−B=[8−10−3−2−210−06−(−1)4−4]=[7−3−41070]
Answer[7−3−41070]
3
Solve for x and y:3[2−1x4]+[−6352y]=[00176].
Forgetting to multiply x and 4 by the scalar 3 before adding gives x+5=17⟹x=12 and 4+2y=6⟹y=1.
Pull out only the two entry positions where x and y sit, making sure the scalar 3 multiplies the first matrix's entries in those spots.
Write the equations for Row 1, Column 2 and Row 2, Column 2 (Warning: Forgetting to multiply x and 4 by the scalar 3 before adding gives x+5=17⟹x=12 and 4+2y=6⟹y=1):
3x+5⟹3x⟹x3(4)+2y⟹12+2y⟹2y⟹y=17=12=4=6=6=−6=−3
Answerx=4,y=−3
4
Multiply [30−1421]25−11−23.
Check the dimensions (2×3)⋅(3×2) to see the size of the product, then pair each row of the first matrix with each column of the second.
Walk across Row 1 and Row 2 of the first matrix while walking down Column 1 and Column 2 of the second (Warning: Dropping a negative sign when multiplying (−1)(−2) in Row 1, Column 2 gives 3−2+6=7 instead of 11, leading to [−1197−5]):
Matrix A has dimensions 3×2 and matrix B has dimensions 2×4. Find the dimensions of AB and BA, or state if either product is undefined.
Write the dimensions side by side for AB, then rewrite them in the reversed order for BA and check the new inner numbers.
For AB, write (3×2)⋅(2×4): the inner numbers match (2 and 2), and the outer numbers give dimensions 3×4.
For BA, reverse the order to (2×4)⋅(3×2) (Warning: Flipping the answer dimensions of AB to 4×3 without checking the new inner numbers 4 and 3 misses that the rows of B and columns of A have different lengths): since the inner numbers 4 and 3 do not match, BA is undefined.
AnswerAB has dimensions 3×4;BA is undefined
6
For A=[23−10] and B=[124−1], find both AB and BA.
Multiplying matching spots entry-by-entry like addition gives the wrong matrix [26−40].
For AB, use the rows of A and columns of B; for BA, write B first so you walk across the rows of B and down the columns of A.
Multiply AB row by column (Warning: Multiplying matching spots entry-by-entry like addition gives the wrong matrix [26−40]):
Write the system of equations as a matrix equation AX=B:
4x−y+2zx+5z−2x+3y−z=9=−3=1
Line up the x,y, and z columns across all three equations first. What coefficient belongs in the y spot of the second equation?
Place the coefficients of x,y, and z into the three columns of A (Warning: Putting 5 into the middle spot of Row 2 because y is missing gives [150] instead of [105], and overlooking the minus signs on −y and −z writes 1 instead of −1):
41−2−10325−1xyz=9−31
Answer41−2−10325−1xyz=9−31
8
Find x and y so that [1021][1yx1]=I, where I is the 2×2 identity matrix.
Multiplying entry-by-entry instead of row-by-column gives [102x1]=[1001] and the wrong answer x=0.
Write out I=[1001] on the right side, multiply the two matrices on the left row-by-column, and match the resulting entries.
Multiply the left-hand side row by column and set it equal to I=[1001] (Warning: Multiplying entry-by-entry instead of row-by-column gives [102x1]=[1001] and the wrong answer x=0):