Math 210 - Operations With Matrices and The Identity Matrix - W22 - Solutions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

Operations with matrices

Modelling linear systems of equations. Application


What is a matrix?
Example

Matrices appear in different contexts. We have seen previously that matrices in their augmented form
can abbreviate a linear system of equations. Matrices also appear in the context of representing all
types of sets of data collected from real life.
For instance, the sales of different types of 2 l bottled beverages from 3 stores during a 1 hour period
could be represented in the form of a table as shown below:

Store A Store B Store C


Pepsi 46 27 53
Coke 27 59 34
Convert the information into a matrix

 If we eliminate the headings, the information from the table can be


represented as a matrix:

46 27 53
27 59 34

 If more information is collected at different times or from different stores,


matrices can be used to determine different type of conclusions about the
sales.
Types of matrices (by size)

 A general m x n matrix (m rows and n columns) can be written as:

𝑎11 ⋯ 𝑎1𝑛
𝐴= ⋮ ⋱ ⋮
𝑎𝑚1 ⋯ 𝑎𝑚𝑛

 A compact notation can be also used: 𝑎𝑖𝑗 .


𝑚×𝑛
 A square matrix is a matrix with n rows and n columns.

𝑎11 ⋯ 𝑎1𝑛
𝐴= ⋮ ⋱ ⋮
𝑎𝑛1 ⋯ 𝑎𝑛𝑛
1. Equal matrices

2 matrices are equal if they have the same entries in the same order.
 Ex.1: Given the following matrices:
2 6 2 6
𝐴= ;𝐵=
3 1 3 1
We can say that the matrices are equal, or : (A)ij=(B)ij

 Ex.2 Given the following matrices:

3 𝑥 3 7
 𝐴= ;𝐵=
6 𝑦 6 −2

 We can say that matrix A is equal to matrix B if and only if x=7 and y=-2.
2. Addition and subtraction of matrices

 Definition. If A and B are matrices of the same size, then the sum A+B is
obtained by adding the entries of B to the corresponding entries of A. The
difference A-B is obtained by subtracting the entries of B from the
corresponding entries of A. Matrices of different sizes cannot be added or
subtracted.
 Examples.
 Given the following matrices, find the sum and the difference:
5 2 −11 0
 𝐴= 4 9 ;𝐵= 7 1
10 − 3 −6 − 8
 The sum is:
5 2 −11 0 −6 2
 4 9 + 7 1 = 11 10
10 − 3 −6 − 8 4 − 11

 The difference is:

5 2 −11 0 16 2
 4 9 − 7 1 = −3 8
10 − 3 −6 − 8 16 5
3. Multiplying a matrix by a scalar

 If A is any matrix and c is any scalar, then the product cA is the matrix obtained
by multiplying each entry of the matrix A by c. The result is called the scalar
multiple of A.

 Examples.
2 5 7
 Given A= find 3A and (-1) A.
3 1 0

6 15 21
 3A =
9 3 0

−2 − 5 − 7
 (-1)A=
−3 − 1 0
4. Multiplying 2 matrices

 If A is a m x r matrix and B is a r x n matrix, then the product AB is a m x n


matrix. To find the entries of AB, multiply the corresponding entries of the
rows of A to the entries of the columns of B and add them together.
Example

 Given the following matrices, find their product.


4 1 0 −2
2 5 1
 𝐴= ; B= 2 3 1 0
3 1 −2
4 2 5 −1
 Answer:
22 19 10 − 5
 AB=
6 2 −9 −4
Theorem. If A is an m x n matrix, and x is a nx1 column
vector, then the product Ax can be expressed as a linear
combination of the column vectors of A in which the
coefficients are the entries of x.

In case of a linear system of the form:


Where:
𝑥1 𝑏1
𝑥2 𝑏2
𝑎11 ⋯ 𝑎1𝑛
. .
 A= ⋮ ⋱ ⋮ , 𝑥 = . , and 𝑏 = ,
𝑎𝑚1 ⋯ 𝑎𝑚𝑛 .
. .
𝑥𝑛 𝑏𝑚
 we can say that:
 Ax=b
 The above relationship can be proved by applying the rules of matrix multiplication and
verifying that the left side of the equation equals the right side of it.
5. The transpose of a matrix

 Definition. If A is any m x n matrix, then the transpose of A, denoted 𝐴𝑇 , is a


n x m matrix obtained by interchanging the rows and the columns of A.
Example.

 Find the transpose of A.

2 3 5
 A=
1 2 8

2 1
 𝐴𝑇 = 3 2
5 8
Special case

 When A is a square matrix, the transpose can be obtained by


interchanging entries that are symmetrical to the principal diagonal.

 Example.

2 5 9 2 1 5
 B= 1 4 6 𝐵𝑇 = 5 4 1
5 1 2 9 6 2
6. The trace of a matrix

 Definition. If A is a square matrix, then the trace of A, denoted tr (A), is


obtained by adding all the entries of the main (principal) diagonal.
 Example.
 Find the trace of A:

1 3 4 6 7
2 0 9 8 7
 A= 3 4 1 0 2
4 3 2 9 1
0 2 −1 3 6

 Tr (A) = 1+0+1+9+6 = 17
The identity matrix


The role of an identity matrix


 Since matrix A is a 2 x 3 matrix, for multiplication on the right side we will need an identity
matrix that is 3 x 3.

𝑎11 𝑎12 𝑎13 1 0 0 𝑎11 𝑎12 𝑎13


 𝐴𝐼3 = 𝑎 0 1 0 = 𝑎 =𝐴
21 𝑎22 𝑎23 21 𝑎22 𝑎23
0 0 1

 We can conclude that for any m x n matrix, the following statement is true:

 𝐴 𝐼𝑛 = 𝐴 and 𝐼𝑚 𝐴 = 𝐴

 The similarity of the identity matrix role in matrix multiplication to the role of number 1 in
algebraic multiplication is evident.
 𝑎×1= 1×𝑎
Matrix polynomials


Application
Modeling with Linear Systems
Modeling with Linear Systems
 Linear equations—often containing hundreds or even thousands of
variables—occur frequently in the applications of algebra to
the sciences and to other fields.

For now, let’s consider an example that


involves only three variables.
Nutritional Analysis

A nutritionist is performing an
experiment on student
volunteers.

He wishes to feed one of his subjects


a daily diet that consists of a combination
of three commercial diet foods:
MiniCal
LiquiFast
SlimQuick
Nutritional Analysis
For the experiment, it’s important
that, every day, the subject
consume exactly:

500 mg of potassium

75 g of protein

1150 units of vitamin D


Nutritional Analysis
The amounts of these nutrients in
one ounce of each food are given
here.

How many ounces of each food should


the subject eat every day to satisfy
the nutrient requirements exactly?
Nutritional Analysis
Let x, y, and z represent the number
of ounces of MiniCal, LiquiFast, and
SlimQuick, respectively, that the
subject should eat every day.
Nutritional Analysis
This means that he will get:
 50x mg of potassium from MiniCal
 75y mg from LiquiFast
 10z mg from SlimQuick

This totals 50x + 75y + 10z mg


potassium.
Nutritional Analysis
Based on the requirements of the
three nutrients, we get the system

 50 x  75y  10z  500 Potassium



 5 x  10y  3z  75 Protein
 90 x  100y  50z  1150
 Vitamin D
Nutritional Analysis
 Dividing the first equation by 5 and the third by 10 gives the system
showed below.

 We can solve this using Gaussian or Gauss - Jordan elimination.


 Alternatively, we could use SCILAB
to find the reduced row-echelon form of
the augmented matrix of the system.

10 x  15y  2z  100



 5 x  10y  3z  75
 9 x  10y  5z  115

Lab application
Use scilab to solve the system

 Answer:
 x = 5, y = 2, z = 10
Nutritional Analysis Using System of Linear
Equations

A more practical application might


involve dozens of foods and
nutrients rather than just three.

Such problems lead to systems with large


numbers of variables and equations.

Computers are essential for solving such


large systems.
Question 1

 Given the matrices below, perform the indicated operations (if possible).

3 0 1 0 1
2 1 −2 3
 𝐴= ; 𝐵= ; C= 2 1 5 ; D= 2 5
3 5 4 −1
−1 2 3 8 1
a) 𝐴 × 𝐵

b) 𝐴 + 𝐵

c) 𝐴 − 𝐵
d) −4/7 × 𝐴𝑇

e) 𝐶 × 𝐷

f) 𝐷 × 𝐶
g) 𝑡𝑟(𝐶)

h) 5𝐶 2
Question 2

2 −3 1
4 6 2 −3 1
 A= ;𝐵= ; 𝐶 = −2 0 5 ;
1 9 −2 0 5
−1 3 4
 𝐴 × (𝐵 × 𝐶)

You might also like