Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems...

22
Matrices, Determinants and Linear Systems September 21, 2014 Matrices, Determinants and Linear Systems

Transcript of Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems...

Page 1: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices, Determinants and Linear Systems

September 21, 2014

Matrices, Determinants and Linear Systems

Page 2: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices

A matrix Am×n is an array of numbers in rows and columns

a11 a12 · · · a1na21 a22 · · · a2n...

.... . .

...am1 am2 · · · amn

→ r1→ r2...→ rm

↓ ↓ ↓c1 c2 · · · cn

We say that the dimension of A is m × n (we also could say m-by-n) . Ifm = n, we say that A is square, otherwise we say that it is rectangular.Recommended videos to follow the class at Khan Academy (click)

Matrices, Determinants and Linear Systems

Page 3: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices

Main diagonal. If A is a square matrix of dimension n, the elements aii ,i = 1, . . . , n form the main diagonal of the matrix; the sum of theseelements is called the trace of the matrix.

Transpose of a matrix. it is the matrix obtained when interchangingrows and columns.

Matrices, Determinants and Linear Systems

Page 4: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Generalities on Matrices

Special shapes: Khan Academy

Row matrix, column matrix.

Diagonal matrix.

Identity matrix I.

Null matrix O.

Triangular matrices (upper, lower).

Symmetric matrix, skew-symmetric matrix.

Diagonal by blocks matrix.

Matrices, Determinants and Linear Systems

Page 5: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices

Operations: Khan Academy

1. Addition. Properties:

Commutative: A+ B = B + A

Associative: A+ (B + C) = (A+ B) + C

Neutral element: null matrix. A+O = A

Inverse element: negative of a matrix. A+ (−A) = O

2. Multiplication by a number. Properties:

λ · (A+ B) = λ · A+ λ · B,(λ+ µ) · A = λ · A+ µ · A

λ · (µ · A) = (λ · µ) · A1 · A = A.

Matrices, Determinants and Linear Systems

Page 6: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices

Operations: Khan Academy

3. Multiplication of two matrices. Properties:

Not commutative, in general. i.e. A · B 6= B · A.Associative: A · (B · C) = (A · B) · CNeutral element for square matrices: identity matrix. A · I = I ·A = A

Inverse element for certain square matrices: inverse matrix.(A · B)T = B

T · AT .

Obs: The matrices A and B are said to commute if A · B = B · A.A is said regular, invertible if it has inverse, otherwise is said singular.

Matrices, Determinants and Linear Systems

Page 7: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Matrices

Inverse of a matrix: given an square matrix A, A−1 (its inverse) is thematrix, if it exists, fulfilling

A · A−1 = A−1 · A = I

A−1 does not always exist. A characterization of its existence can beachieved by using determinants, or the notion of rank.

(A−1)T = (AT )−1.

(A · B)−1 = B−1 · A−1

Two ways for computing it: determinants or Gauss-Jordan method(see later).

Matrices, Determinants and Linear Systems

Page 8: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Determinants

Given a square matrix A, the determinant of A, denoted by |A|, ordet(A), is a number associated with A.

|A| is defined first for 2× 2 matrices Khan Academy . For matricesof higher order, in principle it can be computed by expanding alongany row/column. For example, if A is 3× 3, then we can expandalong the first row (we might also choose any other row or column)

a11 a12 a13a21 a22 a23a31 a32 a33

= a11 · A11 + a12 · A12 + a13 · A13

where Aij denotes the cofactor of the entry aij (i.e. the signed minorof aij). Also, for 3× 3 matrices, Sarrus’ rule may be useful.

Matrices, Determinants and Linear Systems

Page 9: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Determinants

Basic properties:

1. |A| = |At |

2. If A and B are square matrices of the same order, then|A · B| = |A| · |B|.

3. If all the elements in a row (or column) admit a same factor, thenthat number can be taken out of the determinant.

4. If we interchange two rows (or columns), the determinant changessign.

Matrices, Determinants and Linear Systems

Page 10: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Determinants

Basic properties:

5. If A has a row or a column of 0’s, then det(A) = 0.

6. If A has two rows (or columns) which are either equal orproportional, then det(A) = 0. The value is also 0 if there is somerow (column) which is a linear combination of others.

7. The value of the determinant does not change if we add to a row (orcolumn) other rows (or columns) multiplied by numbers. Thisproperty is essential for efficiently computing determinants.

Efficient computation of determinants: Khan Academy

Matrices, Determinants and Linear Systems

Page 11: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Determinants

Computation of the inverse of an square matrix A.

The inverse A−1 exists if and only if |A| 6= 0.

A−1 =1

|A|· AdjT (A) =

1

|A|· Adj(AT ), where Adj(A) is the cofactor

matrix, i.e. for each i , j , the corresponding element is the cofactorof aij .

Alternative: Gauss’ method. Khan Academy

Matrices, Determinants and Linear Systems

Page 12: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Rank of a Matrix

We say that a certain row r (similarly for columns) is a linear

combination of the rows ri1 , . . . , ris if r can be obtained from theserows by means of an expression like

α1 · ri1 + · · ·+ αs · ris

for certain numbers α1, . . . , αs , which are called the coefficients ofthe linear combination.

We say that certain rows (similarly for columns) are linearly

independent, if none of them can be obtained as a linearcombination of the rest. Otherwise, we say that they are linearly

dependent.

Question: When are two rows (resp. two columns) linearly dependent?

Matrices, Determinants and Linear Systems

Page 13: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Rank of a Matrix

Definition

The rank of a matrix A, rank(A), is the maximum number of rows (orcolumns) which are linearly independent.

An equivalent definition of rank, in terms of determinants. A minor,in a matrix A, is any determinant that you can get by eliminating somerows and/or columns. Then one may see that rank(A) is the maximumorder of the non-zero minors of A. (explanation: Khan Academy)

Matrices, Determinants and Linear Systems

Page 14: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Rank of a Matrix

Some observations/properties:

We say that a square matrix of orden n has full rank (or is regular),if rank(A) = n. It can be proven that this happens if and only if thedeterminant of A is different from 0 (therefore, if and only if A isinvertible). If A is square and has not full rank, it is called singular;such a matrix has no inverse.

The rank by rows coincides with the rank by columns.

rank(A) = rank(AT ).

If the dimension of A is m × n, then rank(A) ≤ min(m, n).

When we compute the rank, we find rows/columns which are linearlyindependent!

Matrices, Determinants and Linear Systems

Page 15: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Rank of a Matrix

Some rules for computing rank(A):

A matrix has rank 0 if and only if all its elements are 0, i.e., A = O.

A row/column of 0’s does not count for determining the rank of A.Similarly, a row/colum which is clearly a multiple of anotherrow/colum, or a linear combination of rows/columns, does notcount, either.

The rank does not change if we perform elementary operations on A

(swapping rows/columns, multiplying a row/column by a number,add a linear combination of rows/column to another row/colum).

From a practical point of view, the computation of the rank can bedone either using determinants or by means of Gauss method.Khan Academy

Matrices, Determinants and Linear Systems

Page 16: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Linear Systems: Definitions

A System of Linear Equations is a set of equations of the type

a11 · x1 + a12 · x2 + · · · a1n · xn = b1a21 · x1 + a22 · x2 + · · · a2n · xn = b2

......

...am1 · x1 + am2 · x2 + · · · amn · xn = bm

xi ’s: unknownsaij ’s: coefficientsbj ’s: constant terms

Matrices, Determinants and Linear Systems

Page 17: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Linear Systems: Definitions

The system can be written in matrix form in the following way:

a11 a12 · · · a1na21 a22 · · · a2n...

.... . .

...am1 am2 · · · amn

·

x1x2...xn

=

b1b2...bm

Abbreviately,A · ~x = ~b

A: Coefficients matrix.~x : vector of unknowns~b: vector of constant terms.

Question: why is the above equality true?

Matrices, Determinants and Linear Systems

Page 18: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Classification of Linear Systems

Classification of Linear Systems: linear systems can be

1 Inconsistent, if it has no solution.2 Consistent, if it has some solution (i.e. it is solvable). In this case, it

can have

A Unique solution, orInfinitely many solutions.

Matrices, Determinants and Linear Systems

Page 19: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Classification of Linear Systems

In order to classify a given linear system, we use the augmented matrix,and Rouche-Frobenius Theorem. The augmented matrix, that wedenote by B, is

B =

a11 a12 · · · a1n b1a21 a22 · · · a2n b2...

.... . .

......

am1 am2 · · · amn bm

Matrices, Determinants and Linear Systems

Page 20: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Classification of Linear Systems

Theorem (Rouche-Frobenius Theorem)

Let A · ~x = ~b be a linear system of m equations with n unknowns, and let

B denote the augmented matrix of the system. Then the system is

consistent if and only if rank(A) = rank(B); furthermore, the system

has a unique solution if rank(A) = rank(B) = n, and infinitely many

solutions if rank(A) = rank(B) < n.

When rank(A) = rank(B) = n, the difference n − rank(A) is in fact thenumber of degrees of freedom of the system, i.e. the number ofparameters the solutions depend on.

Matrices, Determinants and Linear Systems

Page 21: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Solving Linear Systems

Two possibilities:

1 Cramer’s Method: uses determinants and must be applied on aCramer’s system (i.e. a system where the coefficients matrix has fullrank). It is not efficient for big systems.

2 Gauss and Gauss-Jordan Method: does not require to computedeterminants, but just simple operations with rows/columns.Efficient for big systems.

In both cases, Khan Academy

Matrices, Determinants and Linear Systems

Page 22: Matrices, Determinants and Linear Systems€¦ · Matrices, Determinants and Linear Systems September 21, 2014 Matrices,DeterminantsandLinearSystems. Matrices A matrix A m×n is an

Homogeneous Linear Systems

These are those linear systems where the constant terms are all 0:

a11 · x1 + a12 · x2 + · · · a1n · xn = 0a21 · x1 + a22 · x2 + · · · a2n · xn = 0

......

...am1 · x1 + am2 · x2 + · · · amn · xn = 0

Always consistent (why?)

The interesting question is whether it has other solutions, up to thetrivial one (in such a case it has infinitely many!)

This happens only if rank(A) < n.

If A is square, this is equivalent to |A| = 0.

Matrices, Determinants and Linear Systems