You are on page 1of 14

ECO401–Linear algebra

Fred Schroyen

22/8-2021

1 Vectors
1. The set of real numbers (the real line):
def
R = fx j 1 < x < 1g
[Note: the vertical bar j is a mathematical short hand for "such that", or
"under the condition that", or "given that"; sometimes it is replaced with :]
A real number is also called a scalar.
2. The set of real pairs of numbers (the Cartesian plane):
def
R2 = f(x1 ; x2 ) j x1 2 R and x2 2 Rg
3. An n dimensional vector is an ordered list of n numbers. A vector
can be represented in two ways:
2 3
x1
6 7
as a column vector : 4 ... 5
xn
or as a row vector : x1 xn or (x1 ; :::; xn )
4. The set of all n-dimensional real vectors (the n-dimensional Euclidean
space)
def
Rn = f(x1 ; :::; xn ) j xi 2 R; i = 1; :::; ng, or
2 3
x1
def 6 7
Rn = f4 ... 5 j xi 2 R; i = 1; :::; ng
xn
c 2021 by Fred Schroyen.

1
5. We make the convention that a vector x is a column vector.

6. The n-dimensional null vector is written as


2 3
0
6 .. 7
0 = 4 . 5:
0

7. Turning a column/row vector into a row/column vector is called


transposition. It is indicated with a superscript t (sometimes with 0 or with
superscript | (Dixit uses |)) If
2 3
x1
6 7
x = 4 ... 5 =) xt = x1 xn
xn
t
and (xt )t = x1 xn = x:

8. Vector inequalities. Suppose x; y 2 Rn .

x y if xi yi for all i
x > y if xi yi for all i and xj > yj for at least one j
x y if xi > yi for all i

9. Vector summation. Vectors of the same dimension can be added and


subtracted. Suppose x; y 2 Rn . Then
2 3 2 3 2 3
x1 y1 x1 + y1
6 7 6 7 6 7
x + y = 4 ... 5 + 4 ... 5 = 4 ..
. 52R :
n

xn yn xn + yn

10a. Multiplication of a scalar with a vector. Suppose 2 R and x 2 Rn


then 2 3 2 3
x1 x1
6 7 6 7
x = 4 ... 5 = 4 ... 5 2 Rn
xn xn

2
10b. Inner product (in-product) of two vectors. Suppose x; y 2 Rn .
Then
2 3
y1
6 .. 7
xt y = x1 xn 4 . 5
yn
= x1 y1 + ::: + xn yn
Xn
= xi yi 2 R (a scalar)
i=1

[Note: the dot in xt y is often omitted: xt y]


11. Orthogonality. Suppose x; y 2 Rn . Then x and y are said to be
orthogonal if xt y = 0. If n = 2, we say that the two vectors are perpendicular
(this means they make an angle of 900 ).

2 Matrices
12. A matrix is an ordered collection of vectors. A is an (n m)-matrix if
2 3
a11 a1m
6 .. 7
A = 4 ... ..
. . 5
an1 anm
where aij is the element on row i and column j. The description "(n m)"
indicates the dimensions of the matrix: n rows and m columns.
[Note: a vector can thus be thought of as a special kind of matrix: x 2 Rn
can be seen as an (n 1)-matrix, and xt is a (1 n)-matrix]
13. A matrix is square when it has as many rows as columns: if n = m.
14. Matrices of the same dimension can be added or subtracted. If A
and B are (n m)-matrices, then
2 3 2 3
a11 a1m b11 b1m
6 .. 7 + 6 .. . . .. 7
A + B = 4 ... ...
. 5 4 . . . 5
an1 anm bn1 bnm
2 3
a11 + b11 a1m + b1m
6 .
.. . .. .. 7
= 4 . 5
an1 + bn1 anm + bnm

3
which is again an (n m)-matrix. Note: A + B = B + A. See section 15.2
in SH02 or 8.1 in SB.

15. Matrix multiplication. The matrices A and B can be multiplied as

A B : if the number of columns of A = the number of rows of B


B A : if the number of columns of B = the number of rows of A

Thus if A is an (n m)-matrix and B is an (m s)-matrix, then A B


is well de…ned and results in an (n s)-matrix.

A B = C
(n m) (m s) (n s)

16. Multiplication of an (n m)-matrix A with an (m 1)-vector x.


Think of the matrix A as a collection of n row vectors. Then take the in-
product of each row vector of A with the (column) vector x. The result is
an (n 1)-vector:
2 32 3
a11 a1m x1
6 .. 7 6 .. 7
A x = 4 ... ...
. 54 . 5
an1 anm xm
2 3
a11 x1 + ::: + a1m xm
6 .. 7
= 4 . 5
an1 x1 + ::: + anm xm

17. Multiplication of an (n m)-matrix A with an (m s)-matrix B.


Think of A as a collection of n row vectors and of B as a collection of s
column vectors. The inner product of the ith row vector of A with the kth

4
column vector of B is the element on row i and column j of A B:
2 3
a11 a1m
6 .. .. .. 7 2 b b1j b1s
3
6 . . . 7 11
6 76 .. 7
A B = 6 ai1 aim 7 4 ... ... ..
.
...
. 5
6 . .. .. 5 b7
4 .. . . m1 bmj bms
an1 anm
2 3
t
! a11 a1m
1
6 .. .. .. 7 2 b b b
3
6 . . . 7 11 1j 1s
t 6 76 . ... .. ... .. 7
i ! 6 a i1 a im 7 4 .. . . 5
6 . . . 7
4 .. .. .. 5 bm1 bmj bms
t
n ! an1 anm
,! 1 ,! j ,! s
2 t t t 3
1 1 1 j 1 s
6 .. .. .. .. .. 7
6 . . . . . 7
6 t t t 7
= 6 i 1 i j i s 7
6 .. .. .. .. .. 7
4 . . . . . 5
t t t
n 1 n j n s

t
Pm
with i j = k=1 aik bkj .

So if C = A B, then the element in row i and column j of the matrix


C is the inner product of the ith row of the matrix A with the j th column of
the matrix B:
X
m
cij = aik bkj :
k=1

18. Matrix notation allows you to write big systems of equations in a


very compact way.

Example 1: market share dynamics

Three …rms are active on a particular market: A, B and C. Their initial


market shares are 20%, 60% and 20%, respectively. If we denote si as the
market share for …rm i, the current market share vector is
2 3
:20
s = 4 :60 5 :
:20

5
Given their sales and advertisement policies, we expect the following ‡ows of
customers:

–A keeps 85% of its customers, but looses 5% to B and 10% to C;


–B keeps 55% but looses 10% to A and 35% to C;
–C keeps 70%, but looses 5% to A and 25% to B.

De…ne tij as the fraction of customers of …rm j that switches to …rm i.


Then the transition matrix is given by
2 3
:85 :10 :05
T = 4 :05 :55 :25 5 :
:10 :35 :70

A characteristic feature of a transition matrix is that the numbers in each


column sum to 1.
What market shares may we expect at the end of this year?
2 32 3 2 3
:85 :10 :05 :20 0:24
T s = 4 :05 :55 :25 5 4 :60 5 = 4 0:39 5
:10 :35 :70 :20 0:37

Example 2 There are three stocks in the economy: A, B and C. There


are three possible …nancial climates ("states of the world"): b(oom), n(ormal
times), r(ecession). The net rate of returns are as follows:

2 A B C 3
b r11 r12 r13
n 4 r21 r22 r23 5 = R
r r31 r32 r33

R is the return matrix in the economy. In general, if there are n stocks in the
economy and S states of the world, the return matrix is the (S n)-matrix
R 2 3
r11 r1n
6 .. . . .. 7
4 . . . 5
rS1 rSn
where rsi is the gross return from investing one krone in stock i when the
economy ends up in state s. Suppose that an investor holds xi shares in

6
company i. Then his portfolio is given by the vector x. The return of his
portfolio for the di¤erent states of the economy is then given by
2 Pn 3
i=1 r 1i x i
6 .. 7
R x=4 . 5
Pn
i=1 rSi xi

Example 3: Consider the following two linear equations:

3x1 + 4x2 = 5
7x1 2x2 = 2

This can be written as


3 4 x1 5
=
7 2 x2 2

Example 4: the linear econometric model


An econometrician speci…es the following linear relation between an out-
come variable yi and K explanatory variables x1i ; x2i ; :::; xKi where i (i =
1; :::; N ) denotes the observation index (e.g., the number identifying the …rm
if the data are …rm data):

X
K
yi = xki k + "i (i = 1; :::; N )
k=1

Here "i is the error term for …rm i (the in‡uence of all factors that are not
included in the x-variables). Using matrix notation, this relationship can be
written in a more compact way:

y =X +"

where
2 3 2 3 2 3 2 3
y1 x11 xK1 1 "1
6 .. 7 6 .. .. 7 ; 6 7 6 7
y = 4 . 5;X = 4 . ...
. 5 = 4 ... 5 ; " = 4 ... 5
yN x1N xKN K "N
(N 1) (N K) (K 1) (N 1)

7
19. Matrix multiplication is in general not commutative: the order of
multiplication matters! Suppose that A is an (n m)-matrix and B is an
(m s)-matrix. Then A B is de…ned, but B A is not de…ned if n 6= s.
Even when n = s (i.e., both A and B are square) then A B will in general
be di¤erent from B A. Check this for A = 37 24 and B = 23 11 .

20. Transposition of a matrix. Suppose that A is an (n m)-matrix.


Then At is an (m n)-matrix obtained by moving what was on row i and
column j in the matrix A to row j and column i in the matrix At .

21. A matrix A is symmetric if it is square and identical to its transpose.


Thus if A is an (n n)-matrix, it is symmetric if

A = At :

3 Linear dependency of vectors


22. Consider n vectors of dimension m : a1 ; a2 ; :::; an 2 Rm . These vec-
tors are said to be linearly dependent if there exists n numbers 1 ; 2 ; :::; n ,
not all zero, such that

1 a1 + 2 a2 + ::: + n an = 0: ( )

The vectors are said to be linearly independent if (*) is only true when
all ’s are set to zero.

Example 5. Suppose that x and y 2 R2 . And suppose that x and y are


linearly dependent. Then there must exist two numbers, ( 1 ; 2 ) =
6 (0; 0),
such that
x1 y1 0
1 + 2 = .
x2 y2 0
Suppose that 1 6= 0. Then we can rewrite this vector equation as

x1 2 y1
= .
x2 1 y2
def
If we de…ne = 2
1
, we can write

x1 y1
= or just x = y:
x2 y2

8
Vector x is then proportional to vector y.

Example 6. Suppose that

3 1
x= and y = :
1 2

Are these two vectors linearly independent? To answer this, we have to look
for 1 and 2 such that

3 1 0
1 + 2 =
1 2 0
m
3 + 1 2 = 0
1+2 2 = 0

Solving this yields ( 1 ; 2) = (0; 0) as the only solution. Hence x and y


are independent.

23. An alternative way of saying that n vectors are linearly dependent is


thus that one of them can be written as a linear combination of the (n 1)
other vectors. Indeed, take (*) and assume that 1 6= 0, then

1 a1 = ( 2 )a2 + ::: + ( n )an , or


2 n
a1 = a2 + ::: + an .
1 1

Example 7 There are three stocks in the economy: A, B and C. There


are three possible …nancial climates ("states of the world"): b(oom), n(ormal
times), r(ecession). The net rate of returns are as follows:

2 A B C 3
3
b 1 2 2
n 4 0 1 1 5
=R
2
1 3 5
r 2 4 8

The columns of the return matrix are not linearly independent because rC =
1
r + 21 rB . Or 2rC = rA + rB .
2 A

9
4 Back to matrices
24. The determinant of a square (n n)-matrix A, written as det(A) or jAj,
is a measure of the extent to which the n vectors that make up matrix A are
linearly independent.

a11 a12
25. Suppose that n = 2. A = . Then det(A) = a11 a22
a21 a22
a12 a21 . The absolute value of det(A) is the shaded area T below:

2 3
a11 a12 a13
26. Suppose that n = 3. Let A = 4 a21 a22 a23 5.
a31 a32 a33
Then det(A) = a11 a22 a33 + a12 a23 a31 + a13 a21 a32 a31 a22 a13 a32 a23 a11
a33 a21 a12 . This is called the Sarrus rule. (Pierre Frédéric Sarrus o 1798-
y1861); use the graphical trick to memorise this rule.

The absolute value of det(A) is the volume of the box below.

Example 8 Use the Sarrus rule to verify that the determinant of the
return matrix R in example 7 is zero.

10
27. The matrix A is an (n n) diagonal matrix if
2 3
a11 0 0
6 0 a22 0 7
6 7
A=6 .. .. . . .. 7
4 . . . . 5
0 0 ann

The determinant of a diagonal matrix is given by det(A) = a11 a22


::: ann .

28. The (n n) identity matrix is de…ned as


2 3
1 0 0
6 0 1 0 7
6 7
In = 6 .. .. . . .. 7
4 . . . . 5
0 0 1

Multiplying a vector or matrix with the identity matrix (if it is possible)


results in the original vector or matrix.

29. Suppose that A is an (n n) matrix. Then A 1 is called the inverse


of A if
A A 1 = In () A 1 A = In .

30. Inverting a matrix by hand is di¢ cult, except in two special cases:
a b 1 1 d b 1 d b
A is a (2 2) matrix: c d
= det(A) c a
= ad cb c a
=
d b
ad cb
c
ad cb
a :
ad cb ad cb
A is an (n n) diagonal matrix: see exercise 8 of the problem set on
linear algebra.

31. Suppose we have a system of n linear equations in n unknowns

a11 x1 + a12 x2 + ::: + a1n xn = b1


a21 x1 + a22 x2 + ::: + a2n xn = b2
..
.
an1 x1 + an2 x2 + ::: + ann xn = bn

This we can write then as

A x = b
(n n)(n 1) (n 1)

11
32. An (n n)-matrix A has an inverse if and only if the n column (row)
vectors of A are linearly independent. In other words, A has an inverse if
and only if det(A) 6= 0.

The proof of =) is easy. It goes by contradiction.

Short note on logic: ("statement A is true" =)"statement B is true")


is equivalent with ("statement B is false" =)"statement A is false") which is
also equivalent with ("statement B is false and statement A is true" is false);
in other words, it is not logically possible that both B is false and A is true.
Hence if we want to prove that A=)B is correct, a strategy of proof can be
to show that "B false and A true" is impossible. End of note

We want to prove that "A has an inverse =) A’s columns are linearly
independent". Let’s therefore try to prove that "A has an inverse and A’s
columns are linearly dependent" is not possible, i.e. gives a contradiction.
If the n column vectors of A are linearly dependent, there must exists a
vector t = ( 1 ; :::; n ) 6= (0; :::; 0) (*) such that

A =0
1
But since by assumption A exists, we can premultiply both sides of this
equation with A 1 :

A 1A = A 10
= 0

which shows that = 0 , yielding a contradiction with (*).

33. If det(A) 6= 0, and hence A 1 exists, then the system of equations


Ax = b has a unique solution in x: premultiply both sides of the equation
with A 1 :

A 1 Ax = A 1 b
In x = A 1 b
x = A 1b

Example 9 Suppose that the investor holds a portfolio xt = (xA ; xB ; xC )


with xi > 0 (for i = A; B; C), and that the return vector for the entire

12
portfolio is
Rx = b; or
2 323 2 3
r11 r12 r13 xA b1
4 r21 r22 r23 5 4 xB 5 = 4 b2 5 ; or
r31 r32 r33 xC b3
2 3 2 3
xA b1
rA rB rC 4 x B 5 = 4 b2 5
xC b3
where ri is the return vector for stock i :
0 1
r1i
ri = @ r2i A :
r3i
Suppose now that the three return vectors are not linearly independent.
Then it is perfectly possible for this investor to obtain the same return vector
by investing only in stocks A and B.
This can be seen as follows. Since the return vectors of the three stocks
are not linearly independent, we have

A rA + B rB + C rC =0
for some vector ( A ; B ; C ) 6= (0; 0; 0). (For the numbers in example 6, we
have A = 21 ; B = 12 and C = 1.) Suppose that C 6= 0. Then we can
write
A B
rC = rA + rB (#)
C C
Consider then the return of the entire portfolio:
2 3 2 3
xA b1
[rA ; rB ; rC ] 4 xB 5 = 4 b2 5 :
xC b3
rA x A + r B x B + r C x C = b
using (#) +
A B
r A x A + rB x B + rA + rB x C = b
C C
rearranging +
A B
rA (xA xC ) + rB (xB xC ) = b
| {z C } | {z C }
rA bA
x + rB bB
x = b

13
Thus, instead of investing xA in stock A, xB in stock B and xC in stock
C, the investor could obtain the same returns in the three states of the world
bA in stock A and x
by investing x bB in stock B and nothing in stock C!

Example 7 (cont.)
Suppose the price of asset A is 1 and that of asset B is 2. What should
be the market price of asset C to rule out market arbitrage? (to rule out the
possibility of making a pro…t without taking any risks)?

14

You might also like