SlideShare a Scribd company logo
Matrix Algebra
Methods for Dummies
FIL
January 25 2006
Jon Machtynger & Jen Marchant
Acknowledgements / Info
• Mikkel Walletin’s (Excellent) slides
• John Ashburner (GLM context)
• Slides from SPM courses:
http://www.fil.ion.ucl.ac.uk/spm/course/
• Good Web Guides
– www.sosmath.com
– http://mathworld.wolfram.com/LinearAlgebra.html
– http://ceee.rice.edu/Books/LA/contents.html
– http://archives.math.utk.edu/topics/linearAlgebra.html
Scalars, vectors and matrices
• Scalar: Variable described by a single
number – e.g. Image intensity (pixel value)
• Vector: Variable described by magnitude and direction
Square (3 x 3) Rectangular (3 x 2) d r c : rth row, cth column
3
2
• Matrix: Rectangular array of scalars
Matrices
• A matrix is defined by the number of Rows and the
number of Columns.
• An mxn matrix has m rows and n columns.
A = 4x3 matrix
• A square matrix of order n, is an nxn matrix.
21 2 53
5 34 12
6 33 55
74 27 3
Matlab notes ( ;  End of matrix row )
A = [ 21 5 53 ; 5 34 12 ; 6 33 55 ; 74 27 3 ]
To extract data: Matrix name( row, column )
Scalar Data Point A( 1 , 2 ) = 2
Row Vector A( 2 , : ) = [ 5 34 12 ]
Column Vector A( : , 3 ) = [ 53 ; 12 ; 55 ; 3 ]
Smaller Matrix A(2:4,1:2) = [ 5 34 ; 6 33 ; 74 27 ]
Another Matrix A( 2:2:4 , 2:3 ) = [ 34 12 ; 27 3 ]
Addition (matrix of same size)
– Commutative: A+B=B+A
– Associative: (A+B)+C=A+(B+C)
Subtraction consider as the addition of a negative matrix
Matrix addition
Matrix multiplication
Matrix multiplication rule:
When A is a mxn matrix & B is a kxl matrix, the multiplication of
AB is only viable if n=k. The result will be an mxl matrix.
Constant (or Scalar)
multiplication of a matrix:
Visualising multiplying
b11 b12
b21 b22
b31 b32
a11 a12 a13 a11b11 + a12b21 + a13b31 a11b12 + a12b22 + a13b32
a21 a22 a23 a21b11 + a22b21 + a23b31 a21b12 + a22b22 + a23b32
a31 a32 a33 a31b11 + a32b21 + a33b31 a31b12 + a32b22 + a33b32
a41 a42 a43 a41b11 + a42b21 + a43b31 a41b12 + a42b22 + a43b32
a11 a12 a13 b11 b12 ? ?
a21 a22 a23 X b21 b22 = ? ?
a31 a32 a33 b31 b32 ? ?
a41 a42 a43 ? ?
A matrix = ( m x n )
B matrix = ( k x l )
A x B is only viable if
k = n
width of A = height of B
Result Matrix = ( m x l )
Jen’s way of
visualising the
multiplication
Transposition
column → row row → column
Mrc = Mcr
Outer product = matrix
Inner product = scalar
Two vectors:
Example
Note: (1xn)(nx1)  (1X1)
Note: (nx1)(1xn)  (nXn)
Identity matrices
• Is there a matrix which plays a similar role as
the number 1 in number multiplication?
Consider the nxn matrix:
A square nxn matrix A has one
A In = In A = A
An nxm matrix A has two!!
In A = A & A Im = A
1 2 3 1 0 0 1+0+0 0+2+0 0+0+3
4 5 6 X 0 1 0 = 4+0+0 0+5+0 0+0+6
7 8 9 0 0 1 7+0+0 0+8+0 0+0+9
Worked example
A In = A
for a 3x3 matrix:
Inverse matrices
• Definition. A matrix A is nonsingular or invertible if there exists a
matrix B such that: worked example:
• Notation. A common notation for the inverse of a matrix A is A-1.
• If A is an invertible matrix, then (AT)-1 = (A-1)T
• The inverse matrix A-1 is unique when it exists.
• If A is invertible, A-1 is also invertible  A is the inverse matrix of A-1.
1 1 X
2
3
-1
3
=
2 + 1
3 3
-1 + 1
3 3
= 1 0
-1 2
1
3
1
3
-2+ 2
3 3
1 + 2
3 3
0 1
Determinants
• Determinant is a function:
– Input is nxn matrix
– Output is a real or a complex number
called the determinant
• In MATLAB
– use the command det(A)" to compute the
determinant of a given square matrix A
• A matrix A has an inverse matrix A-1 if
and only if det(A)≠0.
+ + +
- - -
Matrix Inverse - Calculations
A general matrix can be inverted using methods such as the Gauss-Jordan elimination,
Gaussian elimination or LU decomposition
i.e. Note: det(A)≠0
Some Application Areas
Some Application Areas
• Simultaneous Equations
• Simple Neural Network
• GLM
System of linear equations
Resolving simultaneous equations can be applied using Matrices:
• Multiply a row by a non-zero constant
• Interchange two rows
• Add a multiple of one row to another row

…
Also known as
Gaussian Elimination
Simplistic Neural Network
O = output vector
I = input vector
W = weight matrix
η = Learning rate
d = Desired output
t = time variable
Given an input, provide an output…
Weights learned in auto associative manner or given random values…
Over time, modify weight matrix to more appropriately reflect desired behaviour
a
m
b3
b4
b5
b6
b7
b8
b9
+
e
= b +
Y X ×
Design Matrix
=
a
m
b3
b4
b5
b6
b7
b8
b9
+
e
= b +
Y X ×
Design Matrix
=
Questions?

More Related Content

Similar to Linear_Algebra_Matrices.ppt

Matrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIAMatrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIA
Dheeraj Kataria
 
Matrices ppt
Matrices pptMatrices ppt
Matrices ppt
aakashray33
 
Maths-->>Eigenvalues and eigenvectors
Maths-->>Eigenvalues and eigenvectorsMaths-->>Eigenvalues and eigenvectors
Maths-->>Eigenvalues and eigenvectors
Jaydev Kishnani
 
งานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริงงานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริงNittaya Noinan
 
Calculus and matrix algebra notes
Calculus and matrix algebra notesCalculus and matrix algebra notes
Calculus and matrix algebra notes
VICTOROGOT4
 
Inverse Matrix & Determinants
Inverse Matrix & DeterminantsInverse Matrix & Determinants
Inverse Matrix & Determinantsitutor
 
งานนำเสนอMatrix
งานนำเสนอMatrixงานนำเสนอMatrix
งานนำเสนอMatrix
krunittayamath
 
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANKMatrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
Waqas Afzal
 
APM.pdf
APM.pdfAPM.pdf
APM.pdf
rushikumar17
 
Business mathametics and statistics b.com ii semester (2)
Business mathametics and statistics b.com ii semester (2)Business mathametics and statistics b.com ii semester (2)
Business mathametics and statistics b.com ii semester (2)
shamimakamili
 
Ch9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfCh9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdf
RahulUkhande
 
My Lecture Notes from Linear Algebra
My Lecture Notes fromLinear AlgebraMy Lecture Notes fromLinear Algebra
My Lecture Notes from Linear Algebra
Paul R. Martin
 
Determinants - Mathematics
Determinants - MathematicsDeterminants - Mathematics
Determinants - Mathematics
Drishti Bhalla
 
matrix algebra
matrix algebramatrix algebra
matrix algebra
kganu
 
Rosalina Apriana - Math Compulsory Grade XI - Matriks
Rosalina Apriana - Math Compulsory Grade XI - MatriksRosalina Apriana - Math Compulsory Grade XI - Matriks
Rosalina Apriana - Math Compulsory Grade XI - Matriks
RosalinaApriana
 
Matematika kelas XI semester 2 - Matriks fun mathematics
Matematika kelas XI semester 2 - Matriks fun mathematicsMatematika kelas XI semester 2 - Matriks fun mathematics
Matematika kelas XI semester 2 - Matriks fun mathematics
RosalinaApriana
 
Matrix and Determinants
Matrix and DeterminantsMatrix and Determinants
Matrix and Determinants
AarjavPinara
 

Similar to Linear_Algebra_Matrices.ppt (20)

Matrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIAMatrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIA
 
Matrices ppt
Matrices pptMatrices ppt
Matrices ppt
 
Maths-->>Eigenvalues and eigenvectors
Maths-->>Eigenvalues and eigenvectorsMaths-->>Eigenvalues and eigenvectors
Maths-->>Eigenvalues and eigenvectors
 
Matrix algebra
Matrix algebraMatrix algebra
Matrix algebra
 
งานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริงงานนำเสนอMatrixของจริง
งานนำเสนอMatrixของจริง
 
Calculus and matrix algebra notes
Calculus and matrix algebra notesCalculus and matrix algebra notes
Calculus and matrix algebra notes
 
Inverse Matrix & Determinants
Inverse Matrix & DeterminantsInverse Matrix & Determinants
Inverse Matrix & Determinants
 
งานนำเสนอMatrix
งานนำเสนอMatrixงานนำเสนอMatrix
งานนำเสนอMatrix
 
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANKMatrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
Matrices ,Basics, Determinant, Inverse, EigenValues, Linear Equations, RANK
 
Maths
MathsMaths
Maths
 
APM.pdf
APM.pdfAPM.pdf
APM.pdf
 
Business mathametics and statistics b.com ii semester (2)
Business mathametics and statistics b.com ii semester (2)Business mathametics and statistics b.com ii semester (2)
Business mathametics and statistics b.com ii semester (2)
 
Ch9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfCh9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdf
 
My Lecture Notes from Linear Algebra
My Lecture Notes fromLinear AlgebraMy Lecture Notes fromLinear Algebra
My Lecture Notes from Linear Algebra
 
Determinants - Mathematics
Determinants - MathematicsDeterminants - Mathematics
Determinants - Mathematics
 
matrix algebra
matrix algebramatrix algebra
matrix algebra
 
Rosalina Apriana - Math Compulsory Grade XI - Matriks
Rosalina Apriana - Math Compulsory Grade XI - MatriksRosalina Apriana - Math Compulsory Grade XI - Matriks
Rosalina Apriana - Math Compulsory Grade XI - Matriks
 
Matematika kelas XI semester 2 - Matriks fun mathematics
Matematika kelas XI semester 2 - Matriks fun mathematicsMatematika kelas XI semester 2 - Matriks fun mathematics
Matematika kelas XI semester 2 - Matriks fun mathematics
 
Matrix and Determinants
Matrix and DeterminantsMatrix and Determinants
Matrix and Determinants
 
Matrices
MatricesMatrices
Matrices
 

Recently uploaded

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 

Recently uploaded (20)

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 

Linear_Algebra_Matrices.ppt

  • 1. Matrix Algebra Methods for Dummies FIL January 25 2006 Jon Machtynger & Jen Marchant
  • 2. Acknowledgements / Info • Mikkel Walletin’s (Excellent) slides • John Ashburner (GLM context) • Slides from SPM courses: http://www.fil.ion.ucl.ac.uk/spm/course/ • Good Web Guides – www.sosmath.com – http://mathworld.wolfram.com/LinearAlgebra.html – http://ceee.rice.edu/Books/LA/contents.html – http://archives.math.utk.edu/topics/linearAlgebra.html
  • 3. Scalars, vectors and matrices • Scalar: Variable described by a single number – e.g. Image intensity (pixel value) • Vector: Variable described by magnitude and direction Square (3 x 3) Rectangular (3 x 2) d r c : rth row, cth column 3 2 • Matrix: Rectangular array of scalars
  • 4. Matrices • A matrix is defined by the number of Rows and the number of Columns. • An mxn matrix has m rows and n columns. A = 4x3 matrix • A square matrix of order n, is an nxn matrix. 21 2 53 5 34 12 6 33 55 74 27 3 Matlab notes ( ;  End of matrix row ) A = [ 21 5 53 ; 5 34 12 ; 6 33 55 ; 74 27 3 ] To extract data: Matrix name( row, column ) Scalar Data Point A( 1 , 2 ) = 2 Row Vector A( 2 , : ) = [ 5 34 12 ] Column Vector A( : , 3 ) = [ 53 ; 12 ; 55 ; 3 ] Smaller Matrix A(2:4,1:2) = [ 5 34 ; 6 33 ; 74 27 ] Another Matrix A( 2:2:4 , 2:3 ) = [ 34 12 ; 27 3 ]
  • 5. Addition (matrix of same size) – Commutative: A+B=B+A – Associative: (A+B)+C=A+(B+C) Subtraction consider as the addition of a negative matrix Matrix addition
  • 6. Matrix multiplication Matrix multiplication rule: When A is a mxn matrix & B is a kxl matrix, the multiplication of AB is only viable if n=k. The result will be an mxl matrix. Constant (or Scalar) multiplication of a matrix:
  • 7. Visualising multiplying b11 b12 b21 b22 b31 b32 a11 a12 a13 a11b11 + a12b21 + a13b31 a11b12 + a12b22 + a13b32 a21 a22 a23 a21b11 + a22b21 + a23b31 a21b12 + a22b22 + a23b32 a31 a32 a33 a31b11 + a32b21 + a33b31 a31b12 + a32b22 + a33b32 a41 a42 a43 a41b11 + a42b21 + a43b31 a41b12 + a42b22 + a43b32 a11 a12 a13 b11 b12 ? ? a21 a22 a23 X b21 b22 = ? ? a31 a32 a33 b31 b32 ? ? a41 a42 a43 ? ? A matrix = ( m x n ) B matrix = ( k x l ) A x B is only viable if k = n width of A = height of B Result Matrix = ( m x l ) Jen’s way of visualising the multiplication
  • 8. Transposition column → row row → column Mrc = Mcr
  • 9. Outer product = matrix Inner product = scalar Two vectors: Example Note: (1xn)(nx1)  (1X1) Note: (nx1)(1xn)  (nXn)
  • 10. Identity matrices • Is there a matrix which plays a similar role as the number 1 in number multiplication? Consider the nxn matrix: A square nxn matrix A has one A In = In A = A An nxm matrix A has two!! In A = A & A Im = A 1 2 3 1 0 0 1+0+0 0+2+0 0+0+3 4 5 6 X 0 1 0 = 4+0+0 0+5+0 0+0+6 7 8 9 0 0 1 7+0+0 0+8+0 0+0+9 Worked example A In = A for a 3x3 matrix:
  • 11. Inverse matrices • Definition. A matrix A is nonsingular or invertible if there exists a matrix B such that: worked example: • Notation. A common notation for the inverse of a matrix A is A-1. • If A is an invertible matrix, then (AT)-1 = (A-1)T • The inverse matrix A-1 is unique when it exists. • If A is invertible, A-1 is also invertible  A is the inverse matrix of A-1. 1 1 X 2 3 -1 3 = 2 + 1 3 3 -1 + 1 3 3 = 1 0 -1 2 1 3 1 3 -2+ 2 3 3 1 + 2 3 3 0 1
  • 12. Determinants • Determinant is a function: – Input is nxn matrix – Output is a real or a complex number called the determinant • In MATLAB – use the command det(A)" to compute the determinant of a given square matrix A • A matrix A has an inverse matrix A-1 if and only if det(A)≠0. + + + - - -
  • 13. Matrix Inverse - Calculations A general matrix can be inverted using methods such as the Gauss-Jordan elimination, Gaussian elimination or LU decomposition i.e. Note: det(A)≠0
  • 15. Some Application Areas • Simultaneous Equations • Simple Neural Network • GLM
  • 16. System of linear equations Resolving simultaneous equations can be applied using Matrices: • Multiply a row by a non-zero constant • Interchange two rows • Add a multiple of one row to another row  … Also known as Gaussian Elimination
  • 17. Simplistic Neural Network O = output vector I = input vector W = weight matrix η = Learning rate d = Desired output t = time variable Given an input, provide an output… Weights learned in auto associative manner or given random values… Over time, modify weight matrix to more appropriately reflect desired behaviour
  • 18. a m b3 b4 b5 b6 b7 b8 b9 + e = b + Y X × Design Matrix =
  • 19. a m b3 b4 b5 b6 b7 b8 b9 + e = b + Y X × Design Matrix =