Perform Basic Matrix Operations

Download Report

Transcript Perform Basic Matrix Operations

Perform Basic Matrix
Operations
Chapter 3.5
History
• The problem below is from a Chinese book on mathematics written
over 2000 years ago:
There are three types of corn, of which three bundles of the first, two of
the second, and one of the third make 39 measures. Two of the first,
three of the second and one of the third make 34 measures. And one of
the first, two of the second and three of the third make 26 measures.
How many measures of corn are contained of one bundle of each type?
History
• Note that this can be set up as a system of equations, where x, y, and z
represent the “measures” of the three types of corn
• “three bundles of the first, two of the second, and one of the third make
39 measures”: 3𝑥 + 2𝑦 + 𝑧 = 39
• “Two of the first, three of the second and one of the third make 34
measures.”: 2𝑥 + 3𝑦 + 𝑧 = 34
• “And one of the first, two of the second and three of the third make 26
measures.”: 𝑥 + 2𝑦 + 3𝑧 = 26
History
• The use of variables to represent numbers did not come into wide use
until about 300 years ago, so this was problem was not represented as
we have written it
• Instead, the author of the text set up a table like the one below
1
2
3
26
2
3
1
34
3
2
1
39
History
• Next, the author performs what today we would call row operations
(though he uses columns) on the middle column to obtain the table
below
1
0
3
2
5
2
3
2
1
26
24
39
• The effect is to have eliminated the x-term in the middle equation
History
• Continuing in this manner, he is able to find the solution to the
problem
• The point to notice is that he did this in a table and without the use of
variables
• It was not until 1850 that this arrangement (changed somewhat, as you
will see) came to be called a matrix
History
To create a matrix, we take the original problem
3𝑥 + 2𝑦 + 𝑧 = 39
2𝑥 + 3𝑦 + 𝑧 = 34
𝑥 + 2𝑦 + 3𝑧 = 26
Remove the variables, the additions signs and the equal signs
3 2 1 29
2 3 1 34
1 2 3 26
We now remember that the x terms are in the first column, and so on
History
Finally, we surround the table with brackets
3 2 1 29
2 3 1 34
1 2 3 26
• A matrix is a rectangular array of numbers in rows and columns.
• You will see how we can use matrices (the plural of matrix) in the next
section
Matrices
• A few weeks back, we found that we needed a way to make certain
that a distance measure on the number line is always a positive number
• To do this, we invented the idea of an absolute value and came up with
a symbol to indicate when we wanted to take an absolute value
• However, we were later able to study the absolute value apart from the
idea of distance on a number line
• The same will be true of matrices
• They came about as a way to solve systems of equations
• But we will be able to study them without regard to a system of
equations
Matrices
• What mathematicians (in the 19th century and afterwards) found
interesting about matrices is that they behave a lot like numbers.
• We can perform operations on them, like adding, subtracting, and multiplying
• These operations obey many of the number properties (though not all for every
operation, and some properties are special to matrices)
• In this section you will learn about two basic operations on matrices
and the properties of these operations
The Basics
• A matrix may have any number of rows and columns
• The dimensions of a matrix that has m rows and n columns is 𝑚 × 𝑛
• In the previous example, the matrix had three rows and four columns,
so we would say that it is a 3 × 4 matrix (REMEMBER: the first
number is the rows, the second is the columns)
• The individual numbers in the matrix are sometimes called the
elements of the matrix
The Basics
3 × 4 matrix
4 columns
3 rows
3 2
2 3
1 2
1 29
1 34
3 26
The Basics
3 × 4 matrix
4th column
2nd row
3 2 1 29
2 3 1 34
1 2 3 26
We can refer to an individual element by referring to its row (from top to
bottom) and its column (from left to right), in that order.
The number in the 2nd row and 4th column is 34.
The Basics
• We will eventually perform algebra with matrices, so we must know
what it means for two matrices to be equal
• We say that two matrices are equal if they have the same rows and
columns, and if the elements in each row and column are the same
4
5
1 = 2
2
5
−5 0
−5 6 − 6
• The two matrices above are equal because they are both 2 × 2 and the
elements in the corresponding rows and columns are equal
The Basics
• The matrices below are not equal
1 2 −3
1 2
≠
4 −5 6
4 −5
The dimensions are not the same
2 3 4
2 0
5
1 0 8 ≠ 1 5
6
11 4 2
0 −4 −2
The corresponding elements are not all equal
Adding & Subtracting
• Since matrices are a new kind of mathematical object, we must define
what we mean by addition and subtraction
• We add or subtract matrices by adding or subtracting the elements in
corresponding positions, with the results recorded in the corresponding
positions
• This means that we may only add and subtract matrices of the same
dimensions and the result is a matrix of the same dimension
Adding & Subtracting
If a, b, c, d and w, x, y and z are numbers, then:
𝑎
𝑐
𝑤
𝑏
+ 𝑦
𝑑
𝑥
𝑎+𝑤
𝑧 = 𝑐+𝑦
𝑏+𝑥
𝑑+𝑧
𝑎
𝑐
𝑤
𝑏
− 𝑦
𝑑
𝑥
𝑎−𝑤
𝑧 = 𝑐−𝑦
𝑏−𝑥
𝑑−𝑧
Adding & Subtracting
The following cannot be added or subtracted
𝑏1 𝑏2
𝑎 1 𝑎2
𝑏
𝑏
+
3
4 = not possible
𝑎3 𝑎4
𝑏5 𝑏6
𝑎1
𝑎3
𝑎2
𝑎4
𝑏1
− 𝑏3
𝑏5
𝑏2
𝑏4 = not possible
𝑏6
Adding & Subtracting
Examples
a)
3 + (−1)
3
0
−1 4
+
=
−5 −1
2 0
−5 + 2
0+4
2
=
−3
−1 + 0
b)
7 − (−2)
7
4
−2
5
0−3
0 −2 − 3 −10 =
−1 − (−3)
−1 6
−3
1
4
−1
4−5
9 −1
−2 − (−10) = −3 8
6−1
2
5
Scalar Multiplication
• We will define two kinds of matrix multiplication
• Multiplication of a matrix by another matrix is called matrix
multiplication, and you will learn about this in the next section
• Multiplication of a matrix by a real number is called scalar
multiplication
• A scalar is just a regular number (not a matrix)
• Scalar multiplication is performed by multiplying each element in the
matrix by the scalar (much like using the distributive property)
Scalar Multiplication
Examples
−2(4) −2(−1)
4 −1
−8
2
a) −2 1 0 = −2(1) −2(0) = −2
0
−2(2) −2(7)
2 7
−4 −14
In this example, −2 is a scalar
Scalar Multiplication
For the next example, follow the order of operations
4 −2 4 −8
−2 −8
−3 8
−3 8
b) 4
+
=
+
4 5
4 0
5
0
6 −5
6 −5
−8 + (−3) −32 + 8
−8 −32
−3 8
=
+
=
20 + 6
0 + (−5)
20
0
6 −5
−11 −24
=
26
−5
Guided Practice
Perform the indicated operations, if possible.
−2 5 11
−3 1 −5
1.
+
4 −6 8
−2 −8 4
2.
−4 0
2
7 −2 − −3
−3 1
5
2
0
−14
Guided Practice
Perform the indicated operations, if possible.
2 −1 −3
3. −4 −7 6
1
−2 0 −5
4. 3
4
−3
−1
−2 −2
+
−5
0
6
Guided Practice
Solutions
−5
6
1.
2 −14
2.
−6 −2
10 −2
−8 15
6
12
Guided Practice
Solutions
−8
4
3. 28 −24
8
0
4.
10
−9
−5
−9
12
−4
20
Matrix Properties
• Matrices have many of the same properties as real numbers
Suppose that A, B, and C are matrices of the same dimension and that k
and m are scalars.
•
•
•
•
Closure: 𝐴 + 𝐵 is a matrix of the same dimensions as A and B
Associative Property of Addition: 𝐴 + 𝐵 + 𝐶 = 𝐴 + 𝐵 + 𝐶
Commutative Property of Addition: 𝐴 + 𝐵 = 𝐵 + 𝐴
Distributive Property of Addition Over Scalar Multiplication:
𝑘 𝐴 + 𝐵 = 𝑘𝐴 + 𝑘𝐵
• Distributive Property of Scalar Addition:
𝐴 𝑘 + 𝑚 = 𝐴𝑘 + 𝐴𝑚 = 𝑘𝐴 + 𝑚𝐴
Matrix Properties
• Matrices also have additive inverses as well as a zero matrix
• The zero matrices are different depending on the dimensions, but they
all have a zero in every position
• Having an additive inverse means that we can set up and solve a
matrix equation
Solve a Matrix Equation
Example
Solve the matrix equation for x and y.
3
5𝑥
6
3
−2
+
−5
−4
7
−𝑦
−21
=
3
15
−24
Solve a Matrix Equation
Begin by adding the two matrices in parentheses. Since some of the
elements include a variable, these must be left as addition (cannot be
combined).
3
5𝑥
6
3
−2
+
−5
−4
5𝑥 + 3
3
6 + (−5)
7
−𝑦
−21
=
3
15
−24
−2 + 7
−21
=
−4 + (−𝑦)
3
15
−24
Solve a Matrix Equation
Next perform scalar multiplication. You must use the distributive
property for the elements with two terms.
5𝑥 + 3
5
−21 15
3
=
1
−4 − 𝑦
3
−24
15𝑥 + 9
3
15
−21
=
−12 − 3𝑦
3
15
−24
Solve a Matrix Equation
Finally, solve for the two unknowns. You can do this apart from the
matrix.
15𝑥 + 9
3
15𝑥 + 9 = −21
15𝑥 = −30
𝑥 = −2
15
−21
=
−12 − 3𝑦
3
15
−24
−12 − 3𝑦 = −24
−3𝑦 = −12
𝑦=4
Guided Practice
Solve the matrix equation for x and for y.
−2
−3𝑥
4
−1
9
+
𝑦
−5
−4
3
12
=
2
10
−18
Guided Practice
Add the two matrices in parentheses.
−2
−3𝑥
4
−1
9
+
𝑦
−5
−2
−3𝑥 + 9
4 + (−5)
−4
3
−1 + (−4)
𝑦+3
12
=
2
10
−18
12
2
10
−18
=
Guided Practice
Multiply by the scalar.
−2
−3𝑥 + 9 −5)
−1
𝑦+3
12 10
=
2 −18
6𝑥 − 18
10
12 10
=
2
−2𝑦 − 6
2 −18
Guided Practice
Solve for the unknowns.
6𝑥 − 18
10
12 10
=
2
−2𝑦 − 6
2 −18
6𝑥 − 18 = 12
6𝑥 = 30
𝑥=5
−2𝑦 − 6 = −18
−2𝑦 = −12
𝑦=6
Exercise 3.5
• Page 191, #5-27 odds, Page 193, #7,8 (14 total problems)