0% found this document useful (0 votes)
74 views57 pages

Matrices and Determinants

Uploaded by

Mansi Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views57 pages

Matrices and Determinants

Uploaded by

Mansi Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

Matrices and

Determinants
Why should managers care?
• The most relevant mathematical concept for managers.
• Matrices are the most widely used forms of data storage and
representation in all business scenarios.
• Matrices form the basic data structures for any data analysis in every
business scenarios.
• All data forms – both structured (such as tables) or unstructured
(such as images, voice, videos) are essentially represented using
matrices.
• The relationships between any two datapoints are represented using
determinants. Determinants are the primary metric for measuring
any dataset relationships.
• Almost all statistical analyses and optimization tools function using
matrix algebra and determinants (e.g. Pair of equations, linear
programming, regression, etc.)
2
Points and Vectors
• Point: Zero-dimensional entity.
O

Y
• Point on line: Uni-dimensional Vector.
Q (-3,4)
P (4,2)
B (-3) O (0) A (2)

• Point in plane: Two-dimensional Vector. O (0,0)


X
P (4,2) Q (-3,4)
P (x1,y1) Q (x2,y2) X2
• Point in space: Three-dimensional Vector.
R (3,2,1)
R (x1,x2,x3)
R (3,2,1)

• Point in n-dimensional space: n-dimensional Vector.


O (0,0,0)
X1
S (x1,x2,x3, … , xn)
X3
3
Vectors and Matrices
Vectors: Matrix:
Point (x1, x2) x1 x2

[ ]
P (4, 2) P 4 2
Q (-3, 4) Q −3 4
• A matrix is a collection of multiple vectors (i.e., set of points in space)
• A matrix is a consolidated representation of multiple vectors (points)
using a single data structure.
• In general, rows represent a single vector: It contains different
attributes of a single point (Each point represents an individual entity,
e.g., P, Q, etc.)
• Columns represent the specific attributes of the entity in rows. For
instance, the x1 attribute of the entity P has a measure 4.
Spreadsheet demonstration
• While it is customary to
Matrix: Columns: Attributes of
mention entities in rows and
entities
their attributes in columns, the
reverse practice may also be
adopted.
• In such cases, the points are
represented as column vectors
Rows: Individual and the matrix is a combination
Individual 5-dimensional
of column vectors.
Entities Vectors (points)
• In either cases, the
interpretation remains the
same.
• In general matrix algebra, the
transformation of rows into
x x x x x 15 x Matrix dimensions
columns and vice-versa is a
1 2 3 4 5
5 frequent practice. While
No. of rows No. of columns performing matrix operations,
the distinction of significance
Other illustrations and examples
(1/2)
• Suppose we wish to express the information that Radha has
15 notebooks. We may express it as [15] (15 is a uni-dimensional
vector)
• Now, we have to express that Radha has 15 notebooks and 6
pens
We may express it as [15 6] (It is a two-dimensional vector
where notebooks and pens are its dimensions)
• Let us now suppose that we wish to express the information
of possession of notebooks and pens by Radha and her two
friends Fauzia and Simran which is as follows:
o Radha has 15 notebooks and 6 pens
o Fauzia has 10 notebooks and 2 pens
o Simran has 13 notebooks and 5 pens
Other illustrations and examples
(2/2)
Matrix: Formal definition
• A matrix is an ordered rectangular array of numbers or
functions. The numbers or functions are called the elements
or the entries of the matrix.
Order of a Matrix
• A matrix having m rows and n columns is called a matrix of
order m × n

• In general, an m × n matrix has the following rectangular


array
Example
Consider the following information regarding the number of
men and women workers in three factories I, II and II.
Represent the above information in the form of a 3 × 2 matrix.

What does the entry in the third row and second


column represent?
Example
• Construct a 3 × 2 matrix whose elements are given by

[ ]
1 5/2
1/ 2 2
0 3/ 2
Types of matrices (1/4)

• Column matrix: A matrix is said to be a column matrix if it has only


one column

• Row matrix: A matrix is said to be a row matrix if it has only one


row
Types of matrices (2/4)
• Square matrix: A matrix in which the number of rows are equal to
the number of columns, is said to be a square matrix

• Diagonal matrix: A square matrix is said to be a diagonal matrix if


all its non diagonal elements are zero. Diagonal elements are those
for which the row number and the column number are equal.
Types of matrices (3/4)
• Identity matrix: A square matrix in which elements in the diagonal
are all 1 and rest are all zero

• Zero matrix: A matrix is said to be zero matrix or null matrix if all its elements are zero
Types of matrices (4/4)
• Upper triangular Matrix: A Matrix is said to be an upper triangular
matrix if it satisfies the following conditions:

i. It should be a square matrix.

ii. All the elements which lie below the diagonal should be zero.

• Lower triangular Matrix: A Matrix is said to be a lower triangular


matrix if it satisfies the following conditions:

i. It should be a square matrix.

ii. All the elements which lie above the diagonal should be zero.
Transpose of a Matrix
Consider a Matrix A, then the transpose of A denoted AT can be
obtained by interchanging the rows of A as columns or columns of A
as rows
Properties of Matrix
Transpose:

For any matrices A and B:


Symmetric and Skew Symmetric
Matrices
• A square matrix A = [aij] is said to be symmetric if = A,

• This means that [aij] = [aji] for all possible values of i and j

• Assume Here, a12 = a21 = 1; a13 = a31 = 4; a23 = a32 = -2

• A square matrix A = [aij] is said to be skew symmetric matrix if = – A

• This means that aji = – aij for all possible values of i and j

• All the diagonal elements of a skew-symmetric matrix are equal to


zero
Equality of Matrices
• Two matrices A = [aij] and B = [bij] are said to be equal, if
o They are of the same order

o Each element of A is equal to the corresponding element of B, that is

aij = bij for all i and j


Practice Examples
Given:

Find the values of a, b, c, x, y

Find the values of a, b, c, and d from the following equation


Matrix Addition

If and , then the operation:

is called addition of matrices A and B.


Properties of Matrix Addition
• (A + B) is possible if and only if both the Matrices A and B are of the
same order
• Matrix addition is commutative: A + B = B + A
• Matrix addition is associative: (A + B) + C = A + (B + C)
Example
Suppose Fatima has two factories at places A and B. Each factory
produces sport shoes for boys and girls in three different price
categories labelled 1, 2 and 3. Find the total production of sport
shoes in each price category
In category 1 : for boys (80 + 90), for
girls (60 + 50)

In category 2 : for boys (75 + 70), for


girls (65 + 55)

In category 3 : for boys (90 + 75), for


girls (85 + 75)
Scalar Multiplication of a Matrix
Suppose that Fatima has doubled the production at a factory A in all
categories

This is called scalar multiplication of a matrix. Here, all the elements


of the matrix get multiplied by the scalar.
Example
Given:

Find the matrix X, such that 2A + 3X = 5B


Solution

• X=
Example
Find the values of x and y from the following equation:

Solution:
A Scenario
• Akbar and Birbal are two friends. Akbar wants to buy 2 pens and 5
story books, while Birbal needs 8 pens and 10 story books. The
prices are as follows: Pen – Rs 5 each, story book – Rs 50 each.
How much money Can doeswe represent
each need tothe scenario using matrices?
spend?
Price matrix
Requirements matrix Money matrix
pens books
A pens
× =
B books
Akbar(A): 5×2 + 50×5 = 260
Birbal(B): 5×8 + 50×10 Matrix
= 540 Multiplication Operator
Matrix Multiplication
• Now suppose that they enquire about the rates from another
shop, quoted as follows: pen – Rs 4 each, story book – Rs 40
each

• In this case, the money required by Akbar and Birbal to make


Money Matrix
purchases will be respectively Rs (4 × 2 + 40 × 5) = Rs 208
X
and Rs (8 × 4 + 10 × 40) = Rs 432
Matrix Multiplication
• Now, information from both the cases can be expressed in
terms of matrices as follows (for comparison purpose):
Money Matrix
pens books S1 S2 S1 S2
A pens A
B
x books B

Information in-built in the output matrix, but the attribute disappears


• (A × B) is possible if and only if the number of columns of the Matrix A and the
number of rows of the Matrix B are equal.
• Let A = [aij] be an m × n matrix and B = [bjk] be an n × p matrix. Then the product of the
matrices A and B is the matrix C of order m × p.

• To get the (i, k)th element cik of the matrix C, we take the ith row of A and kth column of B,
multiply them elementwise and take the sum of all these products.
Matrix Multiplication
• In other words, if A = [aij] m × n , B = [bjk] n × p
• Then the ith row of A is [ai1 ai2 ... ain] and the kth column of
B is
• The matrix C = [cik]m × p is the product of A
Example

• Matrix C is (2×3), and Matrix D is (3×2), thus product CD


is defined.
• CD will be a (2×2) matrix in which each entry is the sum
of the products across some row of C with the
corresponding entries down some column of D
• 1strow,1stcolumn
• 1strow,2ndcolumn
Example (…ctd.)

• 2nd row, 1st column

• 1st row, 2nd column


Example
Find AB, if

Solution:
Properties of Matrix Multiplication
• Matrix multiplication is associative → A(BC) = (AB)C

• Matrix multiplication is distributive → A(B + C) = AB + AC

• Matrix multiplication is not commutative → It is not necessary


that
• If AB = that
, Show BA AB ≠ BA
Example Solution

• This does not mean that AB ≠ BA for every pair of matrices.


• For example, AB = BA for
Practice Example
Let , , , Find a matrix D such that CD- AB = O.

Solution:
Let . Hence,

. Hence,

2𝑑 1+5𝑑 3=3;2𝑑2+5𝑑 4=0;3𝑑1+48 𝑑3=43;3𝑑 2+48 𝑑 4=22.


Four Equations, four unknowns. Solve yourself for .
In case you find it difficult to solve linear equations in 4 variables, that’s
an important application of matrices. Let’s deal that in solving linear
Relationships between Vectors
Back to points and vectors:
Entity No. of dimenions Description Metric
.
Single Point Zero Zero Vector No metric.
O

Point on line
A (x1)
One Uni-dimensional vector Length
Ever heard of absolute value / modulus
(How to measure?) B (-3) O (0) A (2)
.
Observe
PPoint
(x1,y1)in plane Two Two-dimensional vector Area the
symbol.
(How to
measure
?)
RPoint in space
(x1,x2,x3) Three 3-dimensional Vector. Volume
Determinant

Point in hyperplane
S (x1,x2,x3, … , xn)
n (n>3) n-dimensional vector n-dim
volume 36
Determinant
• A determinant is a quantity which determines the metric of the
respective dimensional vector.

• In 1-dimension, it is length, represented as the absolute value /


modulus.

• In 2-dimension, a determinant provides the area encompassed by


two 2-D vectors. Y
1 x 2 = 2 sq. units
(0,2)
det(A) = |A| = 2
• Consider an identity matrix . It represents(0,1)
a combination
1 sq. unit of two
det(I) = |I| = 1
unit vectors (1,0) and (0,1). X
O (0,0) (1,0)
Determinant
• Similarly, in 3-dimensional space, a determinant represents the
volume encompassed by the three 3-D vectors.

• In n-dimensional hyperplane, a determinant represents the n-


dimensional volume encompassed by the “n” n-dimensional vectors.

• Thus, a determinant is nothing but the measure of the


relevant metric in the respective dimension.

• A determinant is a tool to establish relationships between


different points in space.
Determinant
For every square matrix A = [aij]of order n,
we can associate a number, which is determinant of the
square matrix A, where aij = (i, j)th element of A

Calculating determinant of a matrix

• Let A = [b] be a matrix of order 1, then determinant of A is


defined to be equal to b
• Determinant of a matrix of order two. Let us assume:
Example
Evalua
te

Now check for the diagonal matrix det ( 𝐴 ) =| 𝐴|=1 ×2 −0 × 0=2

Y
Now check for the matrix Q (-3,4)
Area of this parallelogram P (4,2)
det ( 𝐵 )=| 𝐵|=4 × 4 − ( − 3 ) × 2= 16+6= 22

X
O (0,0)
Higher Order Determinants
Expansion along first Row (R1)
Multiply first element a11 of R1 by (–1) (1 + 1) [(-1) (sum of suffixes in a11 ] and
with the second order determinant obtained by deleting the
elements of first row (R1) and first column (C1) of | A | as a11 lies in
R1 and C1

Example: Evaluate the determinant of the matrix Note: Determinant can


be evaluated by
expanding along any
row or column by
following the similar
logic
Higher Order Determinants
Higher order determinants are better found using MS Excel, scientific
calculator or other software tools.
Excel Demonstration: The MDETERM() function
Matrix Determinant

5 1 2 24
7 2 0 =MDETERM(L3:N5)
1 2 0
Refer to the
13 12 13 10 3456 embedded excel
6 12 13 5 =MDETERM(L8:O11) sheet
3 15 15 11
12 15 11 10

-1 -6 -4 -10 1 -87858
4 -3 10 3 -3 =MDETERM(L13:P17)
8 6 1 -8 -10
-1 -1 -1 6 -4
10 4 5 -4 8
Properties of Determinants

• If A is a square matrix, then det(A) = det(A’)

• A matrix B is said to be singular if det (B) = 0

• A matrix B is said to be non-singular if det (B) ≠ 0


Important Application: Solving Linear Equations
• Consider the system of linear
equations:
o a1x + b1y + c1z = d1
o a2x + b2y + c2z = d2
• o a3xof+equations
The system b3y + c3z can
= d3be written as, AX = B,
where

The co-efficient matrix The variable matrix The constant matrix

• AX = B The operation is known as the inverse of


matrix
Known as the Matrix Method A Linear Equations.
of solving
Inverse of a Matrix
• Let A be a non-singular square matrix, i.e., .

• Let B be another square matrix, such that , the identity matrix of the
corresponding order.

• Then is known as the Inverse of Matrix A.

• Thus, an inverse of a matrix is defined as the matrix, which when pre-


multiplied by the matrix, gives an identity matrix of the corresponding
order. Thus,

• This is obtained from the relationship through the elementary row


Calculating the Inverse of a Matrix
• A shorter way of computing the inverse of the matrix: Using
determinant.

• Let A be a square matrix, such that

• Then (Hence, the non-singularity condition is critical)

• Here, , read as “Adjoint of matrix A”, “Adjugate matrix” or “Adjunct


matrix” is the matrix obtained by transposing the co-factor matrix, .
Thus,

• Co-factors in a matrix are the sign-adjusted determinants of the


Adjoint of A

47
Cofactor Matrix
• Let

• The co-factor matrix of A is given as , where


Calculation for Cofactor

49
Example
• If , find .
Solution:
(i) Finding |A| = 1x4 – 2x3 = -2
(ii) Finding Co-factor matrix, C and Adjunct Matrix Adj(A):
;;;.

= A trick (only for 2x2 matrix):


Example
Solve the following system of equations using the matrix method:
Solution:
(i)
(ii)
(iii) Finding Co-factor matrix, C and Adjunct Matrix Adj(A):
;;;.
Example
Solve the following system of equations using the matrix method:

(i)
(ii)
(iii) Finding Co-factor matrix, C and Adjunct Matrix Adj(A):
;;;

.
Example (…ctd.)
(iv)

Excel Demonstration: MINVERSE() and MMULT() functions

A= 3 -2 3 B= 8
2 1 -1 1 Refer to the
4 -3 2 4 embedded excel
sheet
A_inv = 0.06 0.29 0.06 {=MINVERSE(L20:N22)}
0.47 0.35 -0.53
0.59 -0.1 -0.41

x 1 {=MMULT(L24:N26,Q20:Q22)}
y 2
z 3
Back to the example in slide 35
2𝑑 1+5𝑑 3=3;2𝑑2+5𝑑 4=0;3𝑑1+48 𝑑3=43;3𝑑 2+48 𝑑 4=22. ;

A= 2 0 5 0 B= 3
0 2 0 5 0
3 0 48 0 43
0 3 0 48 22

A_inv = 0.593 0 -0.06 0 {=MINVERSE(L33:O36)} Refer to the


0 0.5926 0 -0.06 embedded excel
-0.037 0 0.025 0
0 -0.037 0 0.02
sheet

d1 -0.877 {=MMULT(L38:O41,R33:R36)}
d2 -1.358
d3 0.9506
d4 0.5432
Practice Problems (Do them Yourself)

Ex1.

Ex2.
Practice Problems (Do them Yourself)

Solve the pairs of linear equations using matrix method:

Ex4.

Use Matrix method to solve the linear equations.

Ex5.
All the Best!!!

You might also like