Linear Algebra: With Sci-Lab
Linear Algebra: With Sci-Lab
Linear Algebra: With Sci-Lab
With Sci-lab
References
Digeteo (2009). Scilab [Software]. Available at http://
www.scilab.org/
Erwin Kreyszig, “Advanced Engineering Mathmatics”, 8 th
Edition, Copyright © 2003 John Wiley & Sons,
Peter V. O’Neil, “Advanced Engineering Mathematics”,
Copyright © 2007, Nelson, ad division of Thomson Canada
Ltd.
Strang, Gilbert. (Spring 2005). MIT OpenCourseWare. Linear
Algebra. Video Lectured retrieved from
http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/
VideoLectures/index.htm
Williams, Gareth. “Linear Algebra with applications”. 3rd
Edition. Copyright © 1996. Times mirror Higher education
Group, Inc.
Basic Concepts
Matrix Addition
Scalar Multiplication
Definition
A matrix is a rectangular array of
numbers (or functions) enclosed in
brackets.
These numbers (or functions) are called
entries or elements of the matrix
Matrix and Its Transpose
a11 a12 a1n
a a22
a2 n
A [a jk ] 21
am1 am 2 amn
a11 a21 am1
a a a
A [akj ]
T 12 22 m2
a1n a2 n amn
Vectors
Row Vector = matrix with one row
vrow a1 a2 an
vrow 4 0 1
Column Vector = matrix with on column
b1 8
b 2
vcolumn 2
vcolumn
3
bm 19
Matrices
Symmetric matrices
A AT
Skew-symmetric matrices
A A
T
Definition of Equality of Matrix
Two matrices are equal if and only if
they have the same size and the
corresponding entries are equal.
Matrix Operation
Size of Matrix, m x n is the numbers of
row, m and the numbers of column, n .
Only Matrices of the same size can be
added.
Scalar Multiplication of Matrix is that
each entry is multiplied by a constant
scalar value.
Matrix Multiplication
Matrix Multiplication
The product C=AB (in this order) of an
m x n matrix A=[ajk] and an n x p
matrix B=[bjk] is defined as the m x p
matrix C=[cjk] with entries
n
c jk a jl blk a j1b1k a j 2b2 k a jnbnk
l 1
ABBA
Cautions
ABBA
9 3 1 4 15 21 1 4 9 3 17 3
2 0 2 5 2 8 2 5 2 0 8 6
1 0 0 4 0 0
Lower Triangular 6 4 0 Scalar 4 0
4 9 6 4
1 0 0
Identity I 1 0
Scilab term eye 1
Products
Transpose of a Product AB B A
T T T
2 x1 5 x2 2 2 5 2
Aa
4 x1 3 x2 18 4 3 18
2 x1 5 x2 2 2 5 2
Aa
0 x1 7 x2 14 0 7 14
Elementary Operation
Equation
Interchange of two equations
Addition of a constant multiple of one equation to
another
Multiplication of an equation by a nonzero constant c
Matrix
Interchange of two rows
Addition of a constant multiple of one row to another
Multiplication of a row by a nonzero constant c
Infinitely many solution
3 2 2 5 8
.6 1.5 1.5 5.4 2.7
1.2 0.3 .03 2.4 2.1
3 2 2 5 8
0 1 . 1 1. 1 4. 4 1 . 1
0 1.1 1.1 4.4 1.1
3 2 2 5 8
0 1.1 1.1 4.4 1.1
0 0 0 0 0
Unique solution
1 1 2 2
3 1 1 6
1 3 4 4
1 1 2 2
0 2 7 12
0 2 2 2
1 1 2 2
0 2 7 12
0 0 5 10
No solution
3 2 1 3
2 1 1 0
6 2 4 8
3 2 1 3
1 1
0 2
0 3 3
2 2 0
3 2 1 3
1 1
0 3 3
2
0 0 0 12
Reduced Row Echelon Matrix
A matrix is in reduced row echelon form if it
satisfies the following conditions:
1. The leading entry of any nonzero row is 1.
2. If any row has its leading entry is column j, then all
other elements of the column j are zero.
3. If row I is a nonzero row and row k is a zero, then i
< k’
4. If the leading entry of row r1 is in column c1, and
the leading entry of row r2 is in column c2, and if r1
< r2, then c1 < c2.
A matrix in reduced row echelon form is said to
be in reduced form, or to be a reduced matrix.
Example
0 1 3 0
1 4 1 0
0 , 0 0 0 1 ,
0 0 1
0 0 0 0
0 1 2 0 0 1 0 0 3 1
0
0 0 1 0 0 1 0 2
4
,
0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 0
Vector Space
Definition
n-vector
If n is a positive integer, an n-vector is an
n-tuple (x1, x2, … xn), wotj eacj cpprdonate
xj a real number. The set of all n-vectors is
denoted Rn. Vector Space is Rn.
Algebra of Rn
x1 x 2 x n y 1 y 2 y n x1 y 1 x 2 y 2 x n y n
x 1 x 2 x n x 1 x 2 x n
O 0 0 0
Theorem
Let F, G, and H be in Rn, and let and be
real numbers. Then
1 FG G F
2 F (G H) (F G) H
3 FO F
4 ( )F F F
5 ( )F ( F)
6 (F G ) F G
7 O O
Magnitude of F is F x1 x2 xn
2 2 2
Definition
The Dot Product of n-Vector x1 x 2 xn
and y 1 y 2 y n is defined by
x1 x 2 x n y 1 y 2 y n x1 y 1 x 2 y 2 x n y n
Theorem
Let F, G, and H be in Rn, and let and be real
numbers. Then
1 F G G F
2 (F G) H F H G H
3 (F G ) 2 (F) G F (G )
4 FF F
5 F F 0 2 iff F 02 2
6 F F 2
F 2 F G 2
G
Cauchy-Schwarz Inequality in Rn
Let F and G be in Rn. Then F G F G
Angle between two vectors
0 if F or G equals the zero vector
F G
cos( )
F G if F 0 and G 0
Unit Vectors
e1 1 0 0 x x x x e x e x e
1 2 n 1 1 2 2 n n
e 2 0 1 0 n
x je j
j 1
e n 0 0 1
Definition
A set of n-vector is a subspace of Rn
if:
1. O is in S
2. The sum of any vectors in S is in S
3. The product of any vector in S with any
real number is also in S
Definition
A linear combinations of k vectors F1 , … , Fk
in Rn is a sum 1F1+…+ kFk in which each j
is a real number.
Let F1 , … , Fk be vectors in a subspace of Rn.
Then F1 , … , Fk form a spanning set for S if
every vector in S is a linear combination of F1 ,
… , Fk. In this case we say that S is spanned
by F1 , … , Fk, or that F1 , … , Fk span S.
Definition
Let F1 , … , Fk be vectors in a
subspace of Rn.
1. F1 , … , Fk are linearly dependent if and
only if one of these vectors is a linear
combinations of the others.
2. F1 , … , Fk are linearly independent if and
only if they are not linearly dependent
Theorem
Let F1 , … , Fk be vectors in a subspace of
Rn. Then
1. F1 , … , Fk are linearly dependent if and only if
there are real numbers 1, … k, not all zero,
such that
1F1+ 2F2+ …+ kFk=0
2. F1 , … , Fk are linearly independent if and only if
an equation
1F1+ 2F2+ …+ kFk=0
can hold only if 1=2 = … = k=0
Example
Determine whether (1,0,3,1), (0,1,-6,-1)
and (0,2,1,0) in R4 are linearly independent.
c1(1,0,3,1)+c2 (0,1,-6,-1)+c3 (0,2,1,0)=(0,0,0,0)
In terms of system of equations
c1 + 0 + 0 = 0
0 + c2 + 2c3 = 0
3 c1 - 6c2 + c3 = 0
c1 - c2 + 0 = 0
Solving for c1, c2, and c3, we have
c1= c2=c3 = 0
Lemma
Let F1 , … , Fk be vectors in a subspace of
Rn. Suppose each Fj has a nonzero
element in some component where each
of the other Fi’s has a zero component.
Then F1 , … , Fk are linearly independent.
F1 (0,4,0,0,2), F2 (0,0,6,0,5), F3 (0,0,0,4,12)
F1 F2 F3 (0,0,0,0,0)
0,4 ,6 ,4 ,2 5 12 (0,0,0,0,0)
0, 0, 0
Theorem
Let F1 , … , Fk be mutually orthogonal
nonzero vectors in Rn. Then are linearly
independent F1 , … , Fk.
Definition
Let V be a subspace of Rn. A set of
vectors F1 , … , Fk in V form a basis for
V if F1 , … , Fk are linearly independent
also span V.
The dimension of a subspace of Rn is
the number of vectors in any basis for
the subspace.
Linear Independence
Rank of a Matrix
Linear Independence and
Dependence of Vector
Linear Combination c1a(1) cm a( m )
Linear Equation c1a(1) cm a( m ) 0
Independent if all scalars must be
c , , c2
zero to satisfy above equation 1
Otherwise dependent
Rank of a Matrix
The maximum number of linearly independent row
vectors of a matrix A=[ajk] is called of the rank of A
and is denoted by
rank A
The rank of a matrix A is the number of nonzero rows
in reduced row echelon form of A
Solution of Linear Systems:
Existence, Uniqueness,
General Form
Fundamental Theorem for Linear Systems
Existence.
A linear system of m equations in n unknowns x1 ,..., xn
1 1 2 1 1 2 2
rank 0 2 7 rank 0 2 7 12 3
0 0 5 0 0 5 10
Infinitely many solution
3 2 2 5 8 3 2 2 5 8
.6 1.5 1.5 5.4 2.7 0 1.1 1.1 4.4 1.1
1.2 0.3 .03 2.4 2.1 0 1.1 1.1 4.4 1.1
3 2 2 5 8
0 1.1 1.1 4.4 1.1
0 0 0 0 0
3 2 2 5 3 2 2 5 8
rank 0 1.1 1.1 4.4 rank 0 1.1 1.1 4.4 1.1 2
0 0 0 0 0 0 0 0 0
arbitrary
No solution
3 2 1 3 3 2 1 3 3 2 1 3
1 1 1 1
2 1 1 0 0 3 3
2 0
3 3
2
6 2 4 8 0 2 2 0 0 0 0 12
3 2 1 3 2 1 3
1 1 1 1
rank 0 rank 0 2
0 0 3 3 3
0 0 0 12 3
0
2 3
Theorem
A homogeneous linear system
a11 x1 a12 x2 a1n xn 0
(4) a21 x1 a22 x2 a2 n xn 0
m1 x1 solution
always has theatrivial am 2 x2 amn xn 0. Nontrivial solutions
x1 A0=
exist if and only if rank A < n. If rank 0these solutions,
,...,r x<n n,
together with x=0, form a vector space of dimension n-r, called the
solution space of (4). In particular, if x (1) and x(2) are solutions vectors
of (4), then x=c1x(1) + c2x(2) with any scalars c1 and c2 is a solution
vector of (4). The term solution space called null space is used for
homogeneous systems only. The dimension of null space is nullity of A
rank a + nullity A = n
Equations Matrix
0 x1 3x2 x3 7 x4 4 x5
1 3 1 7 4
0 x1 2 x2 3 x3 0
A 1 2 3 0 0
0 x2 4 x3 x5 0 0 1 4 0 1
35 13
0 x1 x4 x5
1 0 0
35 13
16 16 16 16
28 20 28 20
0 x2 x4 x5 AR 0 1 0
16 16 16 16
0 0 1 7 9
7 9
0 x3 x4 x5 16 16
16 16
35 13
x4 , x5 16 16 35 13
35 13 28 20 28 20
x1
16 16 X 16 16 7 9 , 16
28 20 7 9
x2 16 16 16 0 16
16 16 0 16
7 9
x3
16 16
Theorem
A homogeneous linear system with fewer equations than unknowns
always has nontrivial solutions
If a nonhomogeneous linear system of equation of the form
a11 x1 a12 x2 a1n xn b1
a21 x1 a22 x2 a2 n xn b2
am1 x1 am 2 x2 amn xn bm
has solutions, then all these solutions are of the form x = x 0 + xh
where x0 is any fixed solution and xh runs through all the solutions of the
corresponding homogeneous system.
a11 x1 a12 x2 a1n xn 0
a21 x1 a22 x2 a2 n xn 0
am1 x1 am 2 x2 amn xn 0
Equations Matrix
1 0 1 2 1 6 3
3 x1 x3 2 x4 x5 6 x6 A B 0 1 1 3 2 4 1
1 4 3 1 0 2 0
1 x2 x3 3 x4 2 x5 4 x6
1 0 0 17 / 8 15 / 8 60 / 8 17 / 8
0 x1 4 x2 3 x3 x4 2 x6
A B R 0 1 0 13 / 8 9 / 8 20 / 8 1 / 8
27 15 60 17 0 0 1 11 / 8 7 / 8 12 / 8 7 / 8
x1 x4 x5 x6
8 8 8 8 27 / 8 x4 15 / 8 x5 60 / 8 x6 17 / 8
13 / 8 x 9 / 8 x 20 / 8 x 1 / 8 x4
13 9 20 1
x2 x4 x5 x6
4 5 6
8
11 / 8 x4 7 / 8 x5 12 / 8 x6 7 / 8 x5
8 8 8 8 X ,
x 8
11 7 12 7 4
x6
x3 x4 x5 x6 x5
8 8 8 8 x6
8