Professional Documents
Culture Documents
Linear Algebra and Matrices: Methods For Dummies 21 October, 2009 Elvina Chu & Flavia Mancini
Linear Algebra and Matrices: Methods For Dummies 21 October, 2009 Elvina Chu & Flavia Mancini
Matrices
Methods for Dummies
21
st
October, 2009
Elvina Chu !lavia Mancini
"al# Outline
*elevance to $+M
Linear Algebra Matrices, MfD 2009
$calar
3
2
1
x
x
x
Matrices
4 7 6
1 4 5
3 2 1
A
$)uare /4 & 40 *ectangular /4 & 20 d
i 3
5 i
th
ro2, 3
th
column
De6ned as ro2s & columns /* & C0
1
1
1
]
1
8 3
7 2
4 1
C
1
1
1
]
1
33 32 31
23 22 21
13 12 11
d d d
d d d
d d d
D
Linear Algebra Matrices, MfD 2009
Matrices in Matlab
78matri&
98end of a ro2
,
_
9 8 7
6 5 4
3 2 1
$ubscri.ting : each element of a
matri& can be addressed 2ith a .air
of numbers9 ro2 6rst, column second
/*oman Catholic0
e,g, X(2,3) = 6
X(3, :) =
X( [2 3], 2) =
( ) 9 8 7
,
_
8
5
;$.ecial< matri&
commands5
= zeros(3,1) =
ones(2) =
magic(3) =
,
_
1 1
1 1
,
_
0
0
0
Linear Algebra Matrices, MfD 2009
,
_
2 9 4
7 5 3
6 1 8
Design matri&
=
9
+
+
Y X
d
a
t
a
v
e
c
t
o
r
d
e
s
i
g
n
m
a
t
r
i
x
p
a
r
a
m
e
t
e
r
s
e
r
r
o
r
v
e
c
t
o
r
=
t
h
e
b
e
t
a
s
(
h
e
r
e
:
1
t
o
9
)
Linear Algebra Matrices, MfD 2009
"rans.osition
1
1
1
]
1
2
1
1
b
[ ] 2 1 1
T
b
[ ] 9 4 3 d
column row row column
1
1
1
]
1
4 7 6
1 4 5
3 2 1
A
1
1
1
]
1
4 1 3
7 4 2
6 5 1
T
A
Linear Algebra Matrices, MfD 2009
1
1
1
]
1
9
4
3
T
d
Matri& Calculations
Addition
Commutative5 A>B8B>A
Associative5 /A>B0>C8A>/B>C0
1
]
1
1
]
1
+
1
]
1
1
]
1
1
]
1
1 1
1 1
1 1
1 1
2 2
2 2
1 1
1 1
2 2
2 2
A
$ubtraction
? @( adding a negative
matri&
1
]
1
1
]
1
+ +
+ +
1
]
1
+
1
]
1
+
6 5
4 3
1 5 3 2
0 4 1 2
1 3
0 1
5 2
4 2
A
Linear Algebra Matrices, MfD 2009
1
]
1
1
]
1
+
1
]
1
1
]
1
1
]
1
1 2
2 1
4 3
2 1
3 5
4 2
4 3
2 1
3 5
4 2
A
$calar multi.lication
Multi.lication method5
$um over .roduct of res.ective ro2s and columns
1 0
2 3
_
,
,
_
1 3
1 2
,
_
!! !1
1! 11
c c
c c
1
]
1
+ +
+ +
1) (3 1) (2 3) (3 2) (2
1) (0 1) (1 3) (0 2) (1
,
_
5 1"
1 !
7 8
8
8
De6ne
out.ut
matri&
A B
= Matlab does all this for (ouF
= $im.l( t(.e5 C 8 A G @
Linear Algebra Matrices, MfD 2009
Matri& multi.lication
A@H@A
A/@C08/A@0C
A/@>C08A@>AC
/A>@0C8AC>@C
Linear Algebra Matrices, MfD 2009
%ector +roducts
'nner .roduct 7
"
I is a scalar
/1&n0 /n&10
Outer .roduct 7I Outer .roduct 7I
" "
is a matri& is a matri&
/n&10 /1&n0 /n&10 /1&n0
xy
T
x
1
x
2
x
3
1
]
1
1
1
y
1
y
2
y
3
[ ]
x
1
y
1
x
1
y
2
x
1
y
3
x
2
y
1
x
2
y
2
x
2
y
3
x
3
y
1
x
3
y
2
x
3
y
3
1
]
1
1
1
[ ]
i
i
i
T
y x y x y x y x
y
y
y
x x x
+ +
1
1
1
]
1
3
1
3 3 2 2 1 1
3
2
1
3 2 1
# x
Inner product 8 scalar
Two vector:
1
1
1
]
1
3
2
1
x
x
x
x
1
1
1
]
1
3
2
1
y
y
y
y
!uter product 8 matri&
Linear Algebra Matrices, MfD 2009
'dentit( matri&
's there a matri& 2hich .la(s a similar role as the number 1 in
number multi.licationJ
Consider the n&n matri&5
!or an( n&n matri& A, 2e have A I
n
8 I
n
A 8 A
!or an( n&m matri& A, 2e have I
n
A 8 A, and A I
m
8 A /so 2 .ossible
matrices0
Linear Algebra Matrices, MfD 2009
'dentit( matri&
1 1 2 2 3 3 1 1 0 0 0 0 1+0+0 1+0+0 0+2+0 0+2+0 0+0+3 0+0+3
4 4 5 5 6 6 X X 0 0 1 1 0 0 = = 4+0+0 4+0+0 0+5+0 0+5+0 0+0+6 0+0+6
7 7 8 8 9 9 0 0 0 0 1 1 7+0+0 7+0+0 0+8+0 0+8+0 0+0+9 0+0+9
Kor#ed
e&am.le
A I
3
= A
for a 4&4
matri&5
= 'n Matlab5 e"e(r, c) .roduces an r & c identit( matri&
Linear Algebra Matrices, MfD 2009
Matri& inverse
= #e$n%t%on& A matri& A is called non%n'ul(r or
%nvert%)le if there e&ists a matri& B such that5
= *ot(t%on& A common notation for
the inverse of a matri& A is A
?1
, $o5
= "he inverse matri& is uni)ue 2hen it e&ists, $o if A is
invertible, then A
?1
is also invertible and then /A
"
0
?1
8 /A
?1
0
"
1 1 1 1 X X
2 2
3 3
-1 -1
3 3
= =
2 2 + + 1 1
3 3 3 3
-1 -1 + + 1 1
3 3 3 3
= = 1 1 0 0
-1 -1 2 2
1 1
3 3
1 1
3 3
-2 -2+ + 2 2
3 3
3 3
1 1 + + 2 2
3 3 3 3
0 0 1 1
= 'n Matlab5 A
?1
8 %nv(A) =Matri& division5 AL@8
A*B
?1
Linear Algebra Matrices, MfD 2009
Matri& inverse
= !or a 7&7 s)uare matri&5
= "he inverse matri& is5
Linear Algebra Matrices, MfD 2009
= E,g,5 2&2 matri&
Determinants
= Determinants are mathematical ob3ects that are ver( useful in
the anal(sis and solution of s(stems of linear e)uations /i,e,
MLMs0,
= "he determ%n(nt is a function that associates a scalar det/A0
to ever( s)uare matri& A,
'n.ut is n&n matri&
Out.ut is a single
number /real or
com.le&0 called the
determinant
det(M)
M
11
M
12
L M
1n
M
21
M
22
L M
2n
M M O M
M
n1
M
n2
L M
nn
sgn(
x
x)M
1x
1
M
2x
2
L M
nx
n
Linear Algebra Matrices, MfD 2009
Determinants
Determinants can onl( be found for s)uare matrices,
=!or a 2&2 matri& A, det(A) = (d+)c, Lets have at closer loo# at
that5
= A matri& A has an inverse matri& A
?1
if and onl( if det(A),-,
= 'n Matlab5 det(A) 8 det(A)
Linear Algebra Matrices, MfD 2009
a b
c d
det/A0 8
8 ad ? bc
N O
$olving simultaneous
e)uations
!or one linear e)uation ax=b 2here the un#no2n is x
and a and b are constants,
4 .ossibilities5
Linear Algebra Matrices, MfD 2009
Kith P1 e)uation and P1 un#no2n
!or e&am.le
1 2
5 3 2
2 1
2 1
+
x x
x x
A 7 8 @
1
]
1
1
]
1
1
]
1
1
5
2 1
3 2
2
1
x
x
7 8A
?1
@
Linear Algebra Matrices, MfD 2009
1
]
1
4
1
7 8A
?1
@
"o 6nd A
?1
!rom earlier
/2 ?20 : /4 10 8 ?A : 4 8 ?D
$o determinant is ?D
bc ad
d c
b a
A ) det(
1
]
1
2 1
3 2
Linear Algebra Matrices, MfD 2009
A
1
1
det(A)
d b
c a
1
]
1
1
]
1
1
]
1
2 1
3 2
7
1
2 1
3 2
) 7 (
1
1
A
1
2
7
14
7
1
4
1
2 1
3 2
7
1
1
]
1
1
]
1
1
]
1
X
1
]
1
4
1
if @ is
if @ is
x
1
2
x
2
1
$o
$o
b a x
1
9
+
+
Y X
d
a
t
a
v
e
c
t
o
r
d
e
s
i
g
n
m
a
t
r
i
x
p
a
r
a
m
e
t
e
r
s
e
r
r
o
r
v
e
c
t
o
r
9
X
d
e
s
i
g
n
m
a
t
r
i
x
p
a
r
a
m
e
t
e
r
s
E&.lanator(
variables
"hese are assumed to
be measured 2ithout
error,
Ma( be continuous9
Ma( be dumm(,
indicating levels of an
e&.erimental factor,
Y = X . +
$olve e)uation for S : tells us
ho2 much of the @OLD signal
is e&.lained b( 7
Linear Algebra Matrices, MfD 2009
'n +ractice
Keb Muides
htt.5LLmath2orld,2olfram,comLLinearAlgebra,html
htt.5LL222,maths,surre(,ac,u#Le&.loreLemmas.agesLo.
tion1,html
htt.5LL222,inf,ed,ac,u#LteachingLcoursesLfmcs1L
/!ormal Modelling in Cognitive $cience course0
htt.5LL222,2i#i.edia,org