Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 113

UNIVERSITY OF SOUTHERN MINDANAO

Linear Models and


Matrix Algebra
Subject Expert:
ROY B. GACUS
Def’n
• Linear models are a way of describing a response
(dependent) variable in terms of a linear
combination of predictor (independent) variables.
• The response should be a continuous variable and
be at least approximately normally distributed. 
• Types of Linear Model:
• Simple linear regression - models using only one predictor.
• Ex: Advertisement cost affects the Company’s sales
• Multiple linear regression - models using multiple predictors.
• Ex: Advertisement cost and product’s price affect Company’s sales
• Multivariate linear regression - models for multiple response
variables
• Ex: Advertisement cost and product’s price affect Company’s sales and
production duration
Functions of Matrix Algebra
• It provides a compact way of writing an equation
system (even extremely large one)
• It leads a way of testing the existence of a
solution by evaluation of a determinant – a
concept related to that of matrix
• It gives a method of finding the solution (if it
exists)
Def’n:
• A matrix A(m x n) is a rectangular array of numbers
or symbols with m rows and n columns.
• m x n is the size or dimension of a matrix
• if m = n, then the matrix is square
• Two matrices A & B are equal iff corresponding
entries/elements of A & B are equal
Def’n:
• Null or zero matrix is a matrix whose elements
are all zero
• Identity matrix is a square matrix whose main
diagonal are all 1, off diagonal are zero.
• Scalar matrix is a square matrix whose main
diagonal are non-zero real numbers, off diagonal
are zeroes.
• k x identity matrix
Def’n:
• Transpose of a matrix A(m x n) is a matrix obtained by
interchanging the rows and columns of A
• If the transpose of A is equal to A ( i.e. AT=A), then A
is called the symmetric matrix

• The minor of an element in a determinant (Mij) is


equal to the determinant obtained by deleting the ith
row and the jth column containing the given element
Def’n:
• The cofactor of an element aij is defined as
Cij = (-1)i+j (Mij), where Mij= minor of the
element on the ith row, jth column
• Let A be an (n x n) square matrix. Then a matrix
B is said to be an inverse of A if it satisfies: AB =
In and BA =In where In is the (n x n) identity
matrix
Def’n:
• A matrix A is said to be invertible or
nonsingular if it has an inverse, otherwise A is
singular.
Note:
• A-1 = inverse of A, A-1A =AA-1 = I
• If the inverse exists, then it is unique
• Not all matrices have inverse
Def’n:
UNIVERSITY OF SOUTHERN MINDANAO

Matrix Expression of a
System of Linear
Equations
Subject Expert:
ROY B. GACUS
Ingredients in the equation
system

• Coefficients
• Variables
• constant
Given this system of linear equation:
7x + 3y = 45
4x + 5Y = 25
Can be expressed in matrix form: AX=B
Cont:.

X & B is
always be a
column vectors
UNIVERSITY OF SOUTHERN MINDANAO

Matrices: Basic
Operations
Subject Expert:
ROY B. GACUS
Addition and Subtraction of matrices

• To add or subtract matrices, they must be of the same order, mxn. To


add matrices of the same order, add their corresponding entries. To
subtract matrices of the same order, subtract their corresponding
entries. The general rule is as follows using mathematical notation:

A  B   aij  bij 
A  B   aij  bij 
An example:
• 1. Add the matrices • Solution: Adding corresponding
entries we have

 4 3 1   1 2 3
 0 5 2    6 7 9 
   
 5 6 0   0 4 8 
• First, note that each matrix has
 3 1 4 
dimensions of 3X3, so we are 6 2 7 
able to perform the addition.  
The result is shown at right:
5 10 8 
Subtraction of matrices
• Now, we will subtract the • Subtract corresponding
same two matrices entries as follows:

 4  (1) 3  2 1 3 
 4 3 1   1 2 3  06 
 0 5 2    6 7 9   5  ( 7) 2  9 
     5  0 6  (4) 0  8 
 5 6 0   0 4 8 
 5 5 2 
=  6 12 11
 
 5 2 8 
Scalar Multiplication
• The scalar product of a number k and a matrix A
is the matrix denoted by kA, obtained by
multiplying each entry of A by the number k . The
number k is called a scalar. In mathematical
notation,

kA   kaij 
Example of scalar
multiplication
• Find (-1)A where • Solution:
• A= • (-1)A=
 1 2 3
 6 7 9  • -1  1 2 3
   6 7 9 
 0 4 8   
 0 4 8 
 1 2 3  1 2 3
 (1)  6 7 9    6 7 9 
 0 4 8   0 4 8
Alternate definition of subtraction of
matrices:
• The definition of subtract • If A and B are two matrices
of two real numbers a and of the same dimensions,
b is then
• a – b = a + (-1)b or a plus • A – B = A + (-1)B, where -
the opposite of b. We can 1 is a scalar.
define subtraction of
matrices similarly:
An example
• The example at right • Solution:
illustrates this procedure
for 2 2X2 matrices.
1 2   5 6  1 2 
3 4    7 8   3 4 
     
 5 6  1 2   5 6 
(1)      
 7 8   3 4   7 8 
 4 4 
 4 4 
 
Matrix product
• The method of • Matrix multiplication was
multiplication of matrices introduced by an English
is not as intuitive and may mathematician named
seem strange, although Arthur Cayley
this method is extremely • (1821-1895) . We will see
useful in many shortly how matrix
mathematical applications. multiplication can be used
to solve systems of linear
equations.
Arthur Cayley (1821-1895)

• Introduced matrix multiplication


Product of a Row Matrix and a Column
Matrix
• In order to understand the general procedure of matrix
multiplication, we will introduce the concept of the product of a row
matrix by a column matrix. A row matrix consists of a single row of
numbers while a column matrix consists of a single column of
numbers. If the number of columns of a row matrix equals the
number of rows of a column matrix, the product of a row matrix and
column matrix is defined. Otherwise, the product is not defined. For
example, a row matrix consists of 1 row of 4 numbers so this matrix
has four columns. It has dimensions
• 1 X 4. This matrix can be multiplied by a column matrix consisting of 4
numbers in a single column (this matrix has dimensions 4X1.
Row by column multiplication
• 1X4 row matrix multiplied by a 4X1
column matrix: Notice the manner
in which corresponding entries of
each matrix are multiplied:
Revenue of a car dealer
• A car dealer sells four model types: A,B,C,D. On a
given week, this dealer sold 10 cars of model A, 5
of model B, 8 of model C and 3 of model D. The
selling prices of each automobile are respectively
$12,500, $11,800, $15,900 and $25,300. Represent
the data using matrices and use matrix
multiplication to find the total revenue.
Solution using matrix multiplication

• We represent the number of each model sold using a row matrix (4X1) and we use a
1X4 column matrix to represent the sales price of each model. When a 4X1 matrix is
multiplied by a 1X4 matrix, the result is a 1X1 matrix of a single number.

12,500 
11,800 
10 5 8 3    10(12,500)  5(11,800)  8(15,900)  3(25,300)   387,100
15,900 
 
 25,300 
Matrix Product
• If A is an m x p matrix and B is a p x n matrix, the matrix
product of A and B denoted by AB is an m x n matrix
whose element in the ith row and jth column is the real
number obtained from the product of the Ith row of A
and the jth column of B. If the number of columns of A
does not equal the number of rows of B, the matrix
product AB is not defined.
Multiplying a 2X4 matrix by a 4X3 matrix
to obtain a 4X2

• The following is an illustration of the product of a 2 x 4 matrix with a 4 x 3 .


First, the number of columns of the matrix on the left equals the number of
rows of the matrix on the right so matrix multiplication is defined. A row by
column multiplication is performed three times to obtain the first row of
the product:
• 70 80 90.
Final result
Undefined matrix
multiplication

Why is this matrix multiplication not defined? The answer is that the
left matrix has three columns but the matrix on the right has only
two rows. To multiply the second row [4 5 6] by the third column, 3
there is no number to pair with 6 to multiply.
7
More examples:

1 6
Given A = 3 1 1  3B= 5
2 0 3   
 
 2 4 

3 1 1  1 6
Find AB if it is defined:   3
 2 0 3   5
 2 4 
Is Matrix Multiplication Commutative?

• Now we will attempt to multiply the • Now we are multiplying a 3 x 2 matrix


matrices in reverse order: by a 2 x 3 matrix. This matrix
multiplication is defined but the result
• BA = 1 6 will be a 3 x 3 matrix. Since AB does
3 5 3 1 1 not equal BA, matrix multiplication is
 2 0 3  not commutative.
 2 4    • BA=
15 1 17 
Commutative property of
 1 3 18
multiplication is defined as   
AB = BA  2 2 14 
Practical application
• Suppose you a business owner and sell clothing. The following
represents the number of items sold and the cost for each item: Use
matrix operations to determine the total revenue over the two days:
• Monday: 3 T-shirts at $10 each, 4 hats at $15 each, and 1 pair of shorts
at $20.
Tuesday: 4 T-shirts at $10 each, 2 hats at $15 each, and 3 pairs of shorts
at $20.
Solution of practical
application
• Represent the information using two matrices: The product of the
two matrices give the total revenue:

Unit price of each Qty sold of each


item: item on Monday

 3 4
10 15 20  4 2
Qty sold of each item
on Tuesday

 1 3 

• Then your total revenue for the two days is =[110   130] Price
Quantity=Revenue
UNIVERSITY OF SOUTHERN MINDANAO

Determinants
Subject Expert:
ROY B. GACUS
Determinants
• Given a square matrix A its determinant is a real
number associated with the matrix.
• The determinant of A is written:
det(A) or |A|
• For a 2x2 matrix, the definition is

det a b = a b = ad - bc
c d c d
• For larger matrices the definition is more
complicated
Determinants 2x2 examples

det 1 2 = 1 2 = (1)(4) – (2)(3) = -2


3 4 3 4

det -5 2 = -5 2 = (-5)(0) – (2)(-2) = 4


-2 0 -2 0

det 1 2 = 1 2 = (1)(4) – (2)(2) = 0


2 4 2 4
Determinants
• To define det(A) for larger matrices, we will need
the definition of a minor Mij
• The minor Mij of a matrix A is the matrix formed by
removing the ith row and the jth column of A

M11 : remove row 1, col 1


1 1 -2
A = -1 2 3 2 3
M11 =
2 7 0 7 0
Determinants
• To define det(A) for larger matrices, we will need
the definition of a minor Mij
• The minor Mij of a matrix A is the matrix formed by
removing the ith row and the jth column of A

M12 : remove row 1, col 2


1 1 -2
A = -1 2 3 -1 3
M12 =
2 7 0 2 0
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M13 : remove row 1, col 3
1 1 -2
A = -1 2 3 -1 2
M13 =
2 7 0 2 7
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M21 : remove row 2, col 1
1 1 -2
A = -1 2 3 1 -2
M21 =
2 7 0 7 0
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M22 : remove row 2, col 2
1 1 -2
A = -1 2 3 1 -2
M22 =
2 7 0 2 0
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M23 : remove row 2, col 3
1 1 -2
A = -1 2 3 1 1
M23 =
2 7 0 2 7
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M31 : remove row 3, col 1
1 1 -2
A = -1 2 3 1 -2
M31 =
2 7 0 2 3
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M32 : remove row 3, col 2
1 1 -2
A = -1 2 3 1 -2
M32 =
2 7 0 -1 3
Determinants
• To define det(A) for larger matrices, we will
need the definition of a minor Mij
• The minor Mij of a matrix A is the matrix
formed by removing the ith row and the jth
column of A
M33 : remove row 3, col 3
1 1 -2
A = -1 2 3 1 1
M33 =
2 7 0 -1 2
3.9.1 The formula for a 3x3 matrix
• For a matrix
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
• Its determinant is given by
|A| = a11|M11| - a12|M12| + a13|M13|
• From the formula for a 2x2 matrix:
a22 a23
|M11|= = a22a33 - a23a32
a32 a33
3.9.1 The formula for a 3x3 matrix
• For a matrix
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
• Its determinant is given by
|A| = a11|M11| - a12|M12| + a13|M13|
• From the formula for a 2x2 matrix:
a21 a23
|M12|= = a21a33 - a23a31
a31 a33
3.9.1 The formula for a 3x3 matrix
• For a matrix
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
• Its determinant is given by
|A| = a11|M11| - a12|M12| + a13|M13|
• From the formula for a 2x2 matrix:
a21 a22
|M13|= = a21a32 - a31a22
a31 a32
3x3 Example

1 1 -2
A = -1 2 3
2 7 0

|A| = 1x|M11| - 1x|M12| + (-2)x|M13|

|A|= 1x 2 3 - 1x -1 3 + (-2) -1 2
7 0 2 0 2 7

= 1x(-21) -1x(-6) +(-2)x(-11) = 7


3x3 Example

0 1 3
B= 5 3 1
-1 2 0

|B| = 0x|M11| - 1x|M12| + 3x|M13|

|B|= 0x 3 1 - 1x 5 1 + 3x 5 3
2 0 -1 0 -1 2

= 0x(-2) -1x(1) +(3)x(13) = 38


3.9.1 The formula for a 3x3 matrix
• For the matrix
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
• We used the top row to calculate the determinant:

|A| = a11|M11| - a12|M12| + a13|M13|


• However, we could equally have used any row of
the matrix and performed a similar calculation
3.9.1 The formula for a 3x3 matrix
• For the matrix
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
• Using the top row:
|A| = a11|M11| - a12|M12| + a13|M13|
• Using the second row
|A| = -a21|M21| + a22|M22| - a23|M23|
• Using the third row
|A| = a31|M31| - a32|M32| + a33|M33|
3.9.1 The formula for a 3x3 matrix
|A| = a11|M11| - a12|M12| + a13|M13|

= -a21|M21| + a22|M22| - a23|M23|

= a31|M31| - a32|M32| + a33|M33|


• Notice the changing signs depending on what row we use:

+ - +
- + -
+ - +
3.9.1 The formula for a 3x3 matrix
• Equally, we could have used any column as long as we
follow the signs pattern
+ - +
a11 a12 a13 - + -
A = a21 a22 a23 + - +
a31 a32 a33
• E.g. using the first column:
|A| = a11|M11| - a21|M21| + a31|M31|
• This choice sometimes makes it a bit easier to
calculate determinants. e.g.

1 1 -2
A= 0 2 3
0 1 1
• Using the first row:

|A|= 1x 2 3 - 1x 0 3 + (-2) x 0 2
1 1 0 1 0 1

= 1x(-1) -1x(0) + (-2)x(0) = -1


• This choice sometimes makes it a bit easier to
calculate determinants. e.g.

1 1 -2
A= 0 2 3
0 1 1
• However, using the first column:

|A|= 1x 2 3 - 0 + 0 = 1x(-1) = -1
1 1
3.9.2 A general formula for determinants
• For a 4x4 matrix we add up minors like the 3x3 case, and
again use the same signs pattern

+ - + -
- + - +
+ - + -
- + - +
• Notice that if we think of the signs pattern as a matrix, then
it can be written as (-1)i+j
3.9.2 A general formula for determinants

• For a nxn matrix A=(aij) the co-factors of A are


defined by
Cij:= (-1)i+j|Mij|
• The determinant of A is given by the formula
n
|A|= aC
i 1
ij ij for any j=1,2,...,n

• Or, n
|A|= a C
j 1
ij ij for any i=1,2,...,n
UNIVERSITY OF SOUTHERN MINDANAO

Cofactor Method for


Inverses
Subject Expert:
ROY B. GACUS
Cofactor Method for Inverses

• Let A = (aij) be an nxn matrix

• Recall, the co-factor Cij of element aij is:


• Cij = (-1)i+j |Mij|
• Mij is the (n-1) x (n-1) matrix made by
removing the ROW i and COLUMN j of A
Cofactor Method for Inverses
• Put all co-factors in a matrix – called the
matrix of co-factors:

C11 C12 C1n


C21 C22 C2n

Cn1 Cn2 Cnn


Cofactor Method for Inverses
• Inverse of A is given by:
1
A =
-1
(matrix of co-factors)T
|A|

C11 C21 Cn1


= 1 C12 C22 Cn2
|A|

C1n C2n Cnn


Examples
a b
• Calculate the inverse of A =
c d

M11 = d |M11| = d C11 = d


Examples
a b
• Calculate the inverse of A =
c d

M12 = c |M12| = c C12 = -c


Examples
a b
• Calculate the inverse of A =
c d

M21 = b |M21| = b C12 = -b


Examples
a b
• Calculate the inverse of A =
c d

M22 = a |M22| = a C22 = a


Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1
A =
-1
(matrix of co-factors)T
|A|
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,

A =
-1 1 (matrix of co-factors)T
(ad-bc)
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
T
1 C11 C12
A-1 =
(ad-bc) C C
21 22
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1 C11 C21
A-1 =
(ad-bc) C C
12 22
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1 d C21
A-1 =
(ad-bc) C C
12 22
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1 d -b
A =
-1
(ad-bc) C C
12 22
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1 d -b
A =
-1
(ad-bc) -c C
22
Examples
a b
• Calculate the inverse of A =
c d
• Found that:

C11 = d C12 = -c C21 = -b C22 = a


• So,
1 d -b
A =
-1
(ad-bc) -c a
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M11 = 2 2 |M11| = 2 C11 = 2


3 4
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M12 = 1 2 |M12| = 0 C12 = 0


2 4
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M13 = 1 2 |M13| = -1 C13 = -1


2 3
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M21 = 1 1 |M21| = 1 C21 = -1


3 4
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M22 = 1 1 |M22| = 2 C22 = 2


2 4
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M23 = 1 1 |M23| = 1 C23 = -1


2 3
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M31 = 1 1 |M31| = 0 C31 = 0


2 2
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Find the co-factors:

M32 = 1 1 |M32| = 1 C32 = -1


1 2
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• First find the co-factors:

M33 = 1 1 |M33| = 1 C33 = 1


1 2
Examples 3x3 Matrix
1 1 1
• Calculate the inverse of B =
1 2 2
2 3 4
• Next the determinant: use the top row:

|B| = 1x |M11| -1x |M12| + 1x |M13|


= 2 – 0 + (-1) = 1
Examples 3x3 Matrix
• Using the formula,
1
B =
-1
(matrix of co-factors)T
|B|

1
= (matrix of co-factors)T
1
Examples 3x3 Matrix
• Using the formula,
1
B =
-1
(matrix of co-factors)T
|B|

1
2 0 -1 T
=
1 -1 2 -1
0 -1 1
Examples 3x3 Matrix
• Using the formula,
1
B =
-1
(matrix of co-factors)T
|B|

2 -1 0
= 0 2 -1
-1 -1 1
• Same answer obtained by Gauss-Jordan method
Examples 3x3 Matrix
Example: Find the inverse of a matrix using co-factor expansion:

-3 4 5
B= -1 5 -1
2 4 2
UNIVERSITY OF SOUTHERN MINDANAO

Cramer's Rule
Gabriel Cramer, a Swiss mathematician (1704-1752)

Reference from: http://www.mathcentre.ac.uk


: Fundamentals Methods of Mathematical Economics
4th Edition (Page 103-107)
Introduction
• Cramer’s Rule is a method for solving linear
simultaneous equations. It makes use of
determinants and so a knowledge of these is
necessary before proceeding.

• Cramer’s Rule relies on determinants


Coefficient Matrices
• You can use determinants to solve a system of
linear equations.
• You use the coefficient matrix of the linear
system.
• Linear System Coeff Matrix
ax+by=e
cx+dy=f
a b 
c d 
 
Cramer’s Rule for 2x2 System
• Let A be the coefficient matrix
• Linear System Coeff Matrix
ax+by=e a b
cx+dy=f = ad – bc
c d
• If detA  0, then the system has a unique
solution:
e b a e
and
f d c f
x y
det A det A
Key Points
• The denominator consists of the coefficients of
variables (x in the first column, and y in the
second column).

• The numerator is the same as the denominator,


with the constants replacing the coefficients of
the variable for which you are solving.
Example - Applying Cramer’s Rule
on a System of Two Equations
Solve the system:
• 8x+5y= 2
• 2x-4y= -10

The coefficient matrix is: 8 5  and 8 5


 2  4  (32)  (10)  42
  2 4

So: 2 5 8 2
 10  4 and 2  10
x y
 42  42
2 5
 10  4  8  (50) 42
x    1
 42  42  42
8 2
2  10  80  4  84
y   2
 42  42  42

Solution: (-1,2)
Applying Cramer’s Rule
on a System of Two Equations
 ax  by  e 2 x  3 y  16
 
cx  dy  f  3x  5 y  14
a b 2 3
D  D  (2)(5)  (3)(3)  10  9  19
c d 3 5

e b  16  3
Dx  Dx   (16)(5)  (3)(14)  80  42  38
f d 14 5
2  16
a e Dy   (2)(14)  (3)(16)  28  48  76
Dy  3 14
c f Dx  38 D y 76
x   2 y   4
Dx Dy D 19 D 19
x y
D D
Evaluating a 3x3 Determinant
(expanding along the top row)

• Expanding by Minors (little 2x2 determinants)


a1 b1 c1
b2 c2 a2 c2 a2 b2
a2 b2 c2  a1  b1  c1
b3 c3 a3 c3 a3 b3
a3 b3 c3
1 3 2
0 3 2 3 2 0
2 0 3  (1)  (3)  (2)
2 3 1 3 1 2
1 2 3
 (1)(6)  (3)(3)  (  2)(4)
 6  9  8   23
Using Cramer’s Rule
to Solve a System of Three
Equations
Consider the following set of linear equations

a11 x1  a12 x2  a13 x3  b1


a21 x1  a22 x2  a23 x3  b2
a31 x1  a32 x2  a33 x3  b3
Using Cramer’s Rule
to Solve a System of Three
Equations
The system of equations above can be written in a
matrix form as:

 a11 a12 a13   x1   b1 


a a22    
a23   x2   b2  
 21
 a31 a32 a33   x3   b3 
Using Cramer’s Rule
to Solve a System of Three
Equations
Define  a11 a12 a13 
a 
   21 22 23 
A  a a
 a31 a32 a33 
 x1   b1 
 x    x2 and  B   b2 
 x3   b3 
If D  0,thenthesystemhasauniquesolution
asshownbelow(Cramer'sRule).
D1 D2 D3
x1  , x2  , x3 
D D D
Using Cramer’s Rule
to Solve a System of Three
Equations
where

a11 a12 a13 b1 a12 a13


D  a12 a22 a23 D1  b2 a22 a23
a13 a32 a33 b3 a32 a33

a11 b1 a13 a11 a12 b1


D2  a12 b2 a23 D3  a12 a22 b2
a13 b3 a33 a13 a32 b3
Example 1
Consider the following equations:
2 x1  4 x2  5 x3  36
3 x1  5 x2  7 x3  7
5 x1  3 x2  8 x3  31
 A x    B 
where
 2 4 5 
 A   3 5 7 
 5 3 8
Example 1
 x1   36 
 x    x2 and  B    7 
 x3   31

2 4 5
D  3 5 7  336
5 3 8

36 4 5
D1  7 5 7  672
31 3 8
Example 1
2 36 5
D2  3 7 7  1008
5 31 8
2 4 36
D3  3 5 7  1344
5 3 31
D1 672
x1   2
D 336
D 1008
x2  2   3
D 336
D3 1344
x3   4
D 336
Cramer’s Rule - 3 x 3
• Consider the 3 equation system below with
variables x, y and z:

a1 x  b1 y  c1z  C1
a2 x  b2 y  c2 z  C2
a3 x  b3 y  c3 z  C3
Cramer’s Rule - 3 x 3
• The formulae for the values of x, y and z are shown
below. Notice that all three have the same
denominator.

a1 C1 c1 a1 b1 C1
C1 b1 c1
a2 C2 c2 a2 b2 C2
C2 b2 c2
a 3 C 3 c3 a3 b3 C3
C3 b3 c3 y z
x a1 b1 c1 a1 b1 c1
a1 b1 c1
a2 b2 c2 a2 b2 c2
a2 b2 c2
a3 b3 c3 a3 b3 c3
a3 b3 c3
Example 1
• Solve the system : 3x - 2y + z = 9
• x + 2y - 2z = -5
x + y - 4z = -2

9 2 1 3 9 1
5 2 2 1 5 2
2 1 4 23 1 2 4 69
x  1 y   3
3 2 1 23 3 2 1 23
1 2 2 1 2 2
1 1 4 1 1 4
Example 1

3 2 9
1 2 5
1 1 2 0
z  0
3 2 1 23 The solution is
1 2 2
1 1 4 (1, -3, 0)
Business Application
• A commodity was produced by using 3 units of
labor and 2 units of capital, the total cost is P62.
If the commodity had been produced by using 4
units of labor and one unit of capital, the cost is
P56. What is the cost per unit of labor and
capital?
UNIVERSITY OF SOUTHERN MINDANAO

Simplex Method
Subject Expert:
PROF. ROY B. GACUS

You might also like