Professional Documents
Culture Documents
cT = (c1 c2 c3 ... cn )
Computational Science &
Engineering
• Quantum Mechanics, Quantum
Computing
• Survey adjustment (network),
etc
ROW AND COLUMN
VECTORS IN a11 a12 … a1n
MATRICES a21 a22 … a2n
Matrix Am x n = (aij)m x n = … … … …
a1j am am … am
Column vector j = a2j 1 2 n
…
Row vector i = ai1
amj
ai2
• Scalar matrix: diagonal
matrix with same non-zero ⎡5 0 0 ⎤ …
values on entire main ⎢0 5 0 ⎥ ain
diagonal
⎢ ⎥
⎡0 0 L 0⎤ ⎢⎣0 0 5⎥⎦
⎢0 0 L 0⎥⎥
Zero matrix Z =⎢
⎢M M O M⎥
⎢ ⎥
⎣0 0 L 0⎦
⎡ λ1 0 ... 0 0⎤
⎢0 ⎡1 0 0⎤
Diagonal Matrix
⎢ λ2 ... 0 0 ⎥⎥ ⎢0 5 0 ⎥⎥
⎢
Diagonal matrix: one or λ = ⎢ ... ... ... ... ... ⎥ ⎢⎣ 0 0 8 ⎥⎦
more non-zero values ⎢ ⎥
⎢0 0 ... λ n −1 0⎥
on main diagonal (top-
left to bottom-right); all ⎢⎣ 0 0 ... 0 λ n ⎥⎦
zeros on off-diagonal
⎡1 0 ... 0 0⎤
Identity Matrix ⎢0
⎢ 1 ... 0 0 ⎥⎥
Unity or identity matrix is I = ⎢ ... ... ... ... ... ⎥
special case of scalar matrix ⎢ ⎥
⎢0 0 ... 1 0⎥
where diagonal values = 1 ⎢⎣ 0 0 ... 0 1 ⎥⎦
⎢ 0 0 U 33 U 34 ... ... U 3n ⎥
U=⎢ ⎥
⎢ ... ... ... ... ... ... ... ⎥
⎢ ... ... ... ... 0 U n −1,n −1 U n −1,n ⎥
⎢ ⎥
⎢⎣ 0 ... ... ... ... 0 U n ,n ⎥⎦
Symmetric matrix Aij = A ji
y = B −1 (I + 2 A )b
z = B − 1 ( I + 2 A )( C − 1 + A ) b + d
3 4
+ 7 8
= 10 12
A + B = C
Addition Conformability
To add two matrices A and B:
• # of rows in A = # of rows in B
• # of columns in A = # of columns in B
• each nm elements added together to produce a new matrix of
same order
– Addition not defined for matrices of different orders
The SUM of two matrices of the same size, m × n, is an m × n
matrix whose elements are the sum of the corresponding
elements of the two given matrices. Addition is not defined for
matrices with different sizes.
Matrix addition is commutative, if:
A + B = B + A,
and associative, if: (A + B) + C = A + (B + C).
ADDITIVE IDENTITY: A + 0 = 0 + A = A
ADDITIVE INVERSE: A + (-A) = (-A) + A = 0
A matrix with all elements equal to zero is called a ZERO
MATRIX.
Addition:
(aij) m × n + (bij) m × n = (aij+bij) m × n
(2 i + 3 j) + (4 i + 5 j) [2 3] +[4 5] = [6 8]
⎡a11 +b11 a12 +b12 ⎤
A+ B = ⎢ ⎥ [
= aij +bij ]
⎣a21 +b21 a22 +b22⎦
Exercise
⎛3 5 1/2 4⎞ ⎛−1 4 0 3⎞
A=⎜⎜ B=⎜⎜
⎝4 −1 2 0⎠ ⎝ 0 2 1 5⎠
⎛2 0 ⎞ ⎛0 − 6⎞
⎜ ⎟ ⎜ ⎟
A = ⎜3 − 6 ⎟B = ⎜ 6 7 ⎟
⎜5 1 ⎟⎠ ⎜3 0 ⎟⎠
⎝ ⎝
⎛2 0 ⎞ ⎛0 − 3⎞
⎜ ⎟ ⎜ ⎟
A = ⎜3 − 6 ⎟B = ⎜ 3 1 ⎟
⎜5 1 ⎟⎠ ⎜ ⎟
⎝ ⎝ ⎠
EQUALITY
• ADDITION: If A = B then A + C = B + C.
⎡1 2 ⎤ ⎡ 5 6⎤ ⎡1 2⎤
⎢3 4 ⎥ − ⎢ 7 8 ⎥ = ⎢3 4 ⎥
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡ 5 6 ⎤ ⎡1 2 ⎤ ⎡ −5 −6⎤
+(−1) ⎢ ⎥ =⎢ ⎥ +⎢ ⎥
⎣ 7 8 ⎦ ⎣ 3 4 ⎦ ⎣ −7 −8 ⎦
⎡ −4 −4 ⎤
⎢ −4 −4 ⎥
⎣ ⎦
Exercise
⎛3 5 1/ 2 4⎞ ⎛−1 4 0 3⎞
A=⎜⎜ ⎟⎟ B = ⎜⎜ ⎟⎟
⎝4 −1 2 0⎠ ⎝ 0 2 1 5⎠
⎛2 0 ⎞ ⎛0 − 6 ⎞
⎜ ⎟ ⎜ ⎟
A = ⎜3 − 6 ⎟B = ⎜6 7 ⎟
⎜5 ⎟ ⎜3 ⎟
⎝ 1 ⎠ ⎝ 0 ⎠
⎛2 0 ⎞ ⎛0 − 3⎞
⎜ ⎟ ⎜ ⎟
A = ⎜3 − 6 ⎟B = ⎜ 3 1 ⎟
⎜5 1 ⎟⎠ ⎜ ⎟
⎝ ⎝ ⎠
ie aij = wij + k eg ⎛ 1 2 3⎞ ⎛ 2 3 4⎞
A = ⎜⎜ ⎟⎟ + 1 = ⎜⎜ ⎟⎟
⎝ 4 5 6⎠ ⎝ 5 6 7⎠
Matrix plus/minus a matrix: both must be of the same size and
we add each element together (point-by-point or point-wise
operation)
ie if C = A + B then cij = aij + bij
⎛ 1 2 3⎞ ⎛ 1 1 1 ⎞ ⎛ 1+1 2 +1 3 +1 ⎞ ⎛ 2 3 4⎞
eg ⎜
⎜ 4 5 6 ⎟⎟ + ⎜⎜ 2 2 2 ⎟⎟ = ⎜⎜ 4 + 2 5 + 2 6 + 2 ⎟⎟ = ⎜⎜ 6 7 8 ⎟⎟
⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠
Multiplication of a Row Matrix and a Column Matrix
• In general procedure of matrix multiplication, the concept of
the product of a row matrix by a column matrix is important.
• A row matrix consists of a single row of numbers while a
column matrix consists of a single column of numbers. If the
number of columns of a row matrix equals the number of rows
of a column matrix, the product of a row matrix and column
matrix is defined.
• Otherwise, the product is not defined. For example, a row
matrix consists of 1 row of 4 numbers so this matrix has four
columns. It has dimensions
• 1 X 4. This matrix can be multiplied by a column matrix
consisting of 4 numbers in a single column (this matrix has
dimensions 4X1.
Matrix Product (Multiplication)
• If A is an m x p matrix and B is a p x n matrix, the matrix product of
A and B denoted by AB is an m x n matrix whose element in the ith
row and jth column is the real number obtained from the product of
the ith row of A and the jth column of B. If the number of columns of A
does not equal the number of rows of B, the matrix product AB is
not defined.
⎡d ⎤
[a b c]⎢⎢ e ⎥⎥ = (a * d ) + (b * e) + (c * f ) = k
⎢⎣ f ⎥⎦
• Matrix*matrix multiplication:
– Inner product of First row (first matrix) * first
column (second matrix) → a1
– First row * second column → a2
– Second row * first column → b1
– Second row * second column → b2
⎡a b ⎤ ⎡ g i ⎤ ⎡ag + bh ai + bj ⎤
⎢c d ⎥ x⎢h =⎢
⎣ ⎦ ⎣ j ⎦ ⎣ cg + dh ci + cj ⎥⎦
⎥
Matrix-Constant Multiplication
if A=Bk = kB, where k is a constant: multiply all elements in B
by k ie
aij= kbij
⎛ 1 2 3 ⎞ ⎛ 1× 3 2 × 3 3 × 3 ⎞ ⎛ 3 6 9 ⎞
A = ⎜⎜ ⎟⎟3 = ⎜⎜ ⎟⎟ = ⎜⎜ ⎟⎟
⎝ 4 5 6 ⎠ ⎝ 4 × 3 3 × 3 6 × 3 ⎠ ⎝12 15 18 ⎠
Multiplication Conformability
5 6 1 2 23 34
• Regular Multiplication
7 8
x 3 4
= 31 46
• To multiply two matrices A and B:
• # of columns in A = # of rows in B A x B = C
mxn nxp mxp
• Multiply: A (m x n) by B (n by p)
MULTIPLICATIVE IDENTITY: AI = IA = A
MULTIPLICATIVE INVERSE:
If A is a square matrix and A-1 exists, then
AA-1 = A-1A = I.
Get A * B
Since A is a 2 x 3 matrix and B is a 3 x 2
B matrix, the solution of product AB will
A be a 2 x 2 matrix.
⎡1 6⎤ 1. Multiply first row of A by first column of
⎢3 − 5 ⎥⎥
B:
⎡ 3 1 −1⎤ ⎢
⎢2 0 3 ⎥ ⎢⎣ − 2 4 ⎥⎦ 3(1) + 1(3) +(-1)(-2)=8
⎣ ⎦
2. First row of A times second column of
⎡ ⎤
B:
AB =
8 9
⎢−4 24⎥
3(6)+1(-5)+ (-1)(4)= 9
⎡12,500⎤
⎢11,800⎥
[10 5 8 3] ⎢⎢ ⎥ = [10(12,500) +5(11,800) +8(15,900) + 3(25,300)] = [387,100]
15,900⎥
⎢ ⎥
⎣25,300⎦
Solution using matrix multiplication
(1x1+2x4+3x7+4x10): 1x1+2x5+3x8+4x11:1x3+2x6+3x9+4x12
Undefined matrix multiplication
• Why is this matrix multiplication not defined? The answer is
that the left matrix has three columns but the matrix on the
right has only two rows. To multiply the second row [4 5 6] by
the third column, 3 there is no number to pair with 6 to multiply,
i.e. 4 x 3, 5 x 7, 6 x ?
• Matrix*matrix multiplication:
– Multiplication only defined (conformable) if # columns in left
factor = # rows in right factor
– Multiplication not commutative (even subset of cases in
which conformable in both directions)
– Multiplication only defined (conformable) if # columns in left
factor = # rows in right factor
⎡2 0⎤ ⎡2 1⎤ ⎡(2x2)+(0x0) (2x1)+(0x5)⎤ ⎡4 2⎤
⎢0 ⎥x⎢ ⎥ =⎢ ⎥ =⎢ ⎥
⎣ 2⎦ ⎣0 5⎦ ⎣(0x2)+(2x0) (0x1)+(2x5)⎦ ⎣0 10⎦
– Multiplying by scalar matrix same as
multiplying by a scalar
⎡1 0⎤ ⎡2 1⎤ ⎡(1x2)+(0x0) (1x1)+(0x5)⎤ ⎡2 1⎤
⎢0 ⎥x⎢ ⎥ =⎢ ⎥ =⎢ ⎥
⎣ 1⎦ ⎣0 5⎦ ⎣(0x2)+(1x0) (0x1)+(1x5)⎦ ⎣0 5⎦
– Multiplying by identity matrix same as multiplying by 1 in
regular algebra
Get the following solutions of :
AB, BA. 2A +2B, Give comment on the results
⎛1 2⎞
⎜ ⎟ ⎛7⎞
A = ⎜3 4⎟ B = ⎜⎜ ⎟⎟
⎜5 ⎟ ⎝ 8⎠
⎝ 6⎠
⎛p q⎞ ⎛ s − q⎞
A = ⎜⎜ ⎟⎟ B = ⎜⎜ ⎟⎟
⎝r s⎠ ⎝− r p ⎠
Get the solution of IA and AI
⎛1 0⎞ ⎛ p q⎞
I = ⎜⎜ ⎟⎟ A = ⎜⎜ ⎟⎟
⎝0 1⎠ ⎝ r s⎠
CLASS EXERCISE – GIVE SOME COMMENTS
Transpose of a matrix
• If the rows and columns of a matrix are
interchanged, i.e.
– The first row becomes the first column,
– The second row becomes the second column,
– The third row becomes the third column etc,
⎡ 4 7 2 ⎤
Then AT: ⎢ 6 ⎥
⎣ 9 5 ⎦
Exercise:
⎡4 0⎤
⎡ 2 7 6⎤
Given:: A=⎢ ⎥ B = ⎢⎢3 7 ⎥⎥
⎣ 3 1 5⎦ ⎢⎣1 5⎥⎦