![]()
MATH347 L2: Matrices and problems of linear algebra
|
Previous concept synopsis:
Vectors are groupings of scalars
Vector addition and multiplication of a vector by a scalar have been defined
Linear combination defined
Matrices are groupings of vectors
Matrix-vector product expresses a linear combination in a concise notation
New concepts:
Scalar product of two vectors
Orthogonal vectors
Norm of a vector
![]()
Matrices
|
Definition. An by matrix is a grouping of vectors,
where each vector has scalar components .
Notation conventions:
scalars: normal face, Latin or Greek letters, ,
vectors: bold face, lower case Latin letters,
matrices: bold face, upper case Latin letters,
![]()
Matrices
|
Matrix components
A real-valued matrix with lines and :
>> |
A=[3 1 2; -1 0 1; 3 4 1]; disp(A) |
3 1 2
-1 0 1
3 4 1
![]()
Matrix components
|
Instead of explicitly writing out components, it is often convenient to specify a matrix by a rule to construct each component
with indices taking values .
Example: A Hilbert matrix is defined as
Note that a vector is a matrix with a single column. The notation is a customary shorter form of .
![]()
Scalar product, innner product
|
Scalar products are useful in many other contexts than real-valued vectors.
Definition. Consider vectors and scalar The function
is a scalar product if:
(Symmetry)
(Linearity in first argument)
(Positive definiteness)
Inner product of ,
![]()
Vector norm
|
Definition. The norm of a vector is a function that takes a vector argument, returns a positive real number, , and for , ,satisfies properties:
.
A norm embodies the concept of measurement of the magnitude of a vector
Different ways of measuring the magnitude of a vector are most appropriate in various applications, resulting in different definitions of a vector norm for
1-norm |
|
2-norm (Euclidean norm) |
|
inf-norm |
|
Different norms are distinguished by subscripts as above. The most commonly used norm is the Euclidean norm that corresponds to the square root of the scalar product, i.e. , in which case the subscript is often suppressed to simplify notation
![]()
Angle between two vectors
|
Law of cosines
Dot product properties
Combine, and define
In particular if , are said to be orthogonal
![]()
Example: Column vectors of a matrix
|
>> |
A=[3 1 2; -1 0 1; 3 4 1]; disp(A) |
3 1 2
-1 0 1
3 4 1
>> |
A(:,2) |
![]()
Example: Row vectors of a matrix
|
>> |
A=[3 1 2; -1 0 1; 3 4 1]; disp(A) |
3 1 2
-1 0 1
3 4 1
>> |
A(2,:) |
![]()
Example: Block within a matrix
|
>> |
A=[3 1 2; -1 0 1; 3 4 1]; disp(A) |
3 1 2
-1 0 1
3 4 1
>> |
A(:,2:3) |
![]()
Example: Inner product of two vectors
|
>> |
u=[1 2 3]; v=[3 0 1]; dot(u,v) |
>> |
e1=[1 0 0]; e2=[0 1 0]; e3=[0 0 1]; dot(e1,e2) |
>> |
dot(e1,e3) |
>> |
dot(e2,e3) |
>> |
dot(e1,e1) |
>> |
dot(e2,e2) |
>> |
dot(e3,e3) |
![]()
Example: Vector norm
|
>> |
u=[1 2 3]; v=[3 0 1]; norm(u) |
>> |
sqrt(dot(u,u)) |
>> |
norm(v) |
>> |
sqrt(dot(v,v)) |
>> |
e1=[1 0 0]; e2=[0 1 0]; e3=[0 0 1]; norm(e1) |
>> |
norm(e2) |
>> |
norm(e3) |
![]()
Example: Angle between two vectors
|
>> |
dot(e1,e2)/norm(e1)/norm(e2) |
>> |
acos(0.0) |
>> |
dot(e1,e1)/norm(e1)/norm(e1) |
>> |
acos(1) |
>> |
u=[1 0]; v=[1 1]; dot(u,v)/norm(u)/norm(v) |
>> |
acos(0.7071)/pi*180 |