Linear Algebra, Vectors, and Matrices
Linear Algebra, Vectors, and Matrices
x Z ½ 3; 2; 1
555
X2 X2
(2, 4) (2, 4)
X = [2, 4]
X1 X1
Figure A.1 A point in two-dimensional space (left) and the same point viewed as a
vector (right).
vectors, x and y:
x Z ½ 2; 3; 1
y Z½1 6 5
xCy Z½3 9 6
xK y Z ½ 1 K3 K4 :
x$w Z x1 w1 C x2 w2 C . C xn wn ;
which is the sum of products of vector components. The dot product can
also be written as
where q represents the angle between the two vectors. This is presented in
Figure A.2.
Example. Find the dot product of the vectors [K1 3 6 K2] and
[1 2 2 K3]. Find the angle between the two vectors.
Solution. The dot product is
The angle between the two vectors is (from the above equation)
23
cos q Z pffiffiffiffiffipffiffiffiffiffi Z 39:948 :
50 18
pffiffiffiffiffi pffiffiffiffiffi
The 50 and 18 in the above expression are norms or the lengths of
the two vectors x and w. When two vectors are perpendicular or
orthogonal to each other, their dot product is zero. This is because when
q Z908, cos q Z0.
X2
x
X1
Figure A.2 Two vectors, x and w, and the angle between them.
A.2 Matrices
Operating with many vectors can be greatly simplified by organizing them
in matrices. A matrix is a rectangular array of numbers. An m ! n matrix is a
matrix with m rows and n columns that represent vectors. Each element of a
matrix can be indexed by its row and column position. The order of
elements is therefore written as
2 3
a11 a12 a13 . a1n
6a a22 a23 a2n 7
6 21 . 7
6 7
A Z6
6 a31 a32 a33 . a3n 7:
7
6 7
4 « 5
am1 am2 am3 . amn
For the 3 ! 2 matrix B, given below, the element b32 ZK5 and b21 Z 2:
2 3
K3 3
6 7
B Z4 2 9 5:
1 K5
then
2 3 2 3
3K 2 1C1 1 2
6 7 6 7
C ZACB Z42C3 4 C 2 5 Z 4 5 6 5:
1C1 5C4 2 9
X
n
Z aik bkj :
kZ1
Solution.
2 3
K2 1
6 7
B Z AT Z 4 3 2 5
1 4
References
1. Callan, R. The Essence of Neural Networks, Pearson Education, London, UK,
1999.