2008年12月15日 星期一

Maths(二)---Matrix Arithmetic and Relations(1)

matrix
 7 2 7
 {6 3 5}
  1 2 2  is a 3 ×3 matrix
Matrix Notation
{A11 A12}
 B21 B22
 C31 C32
Addition and Subtraction of Matrices
例一.
{7 9 5}+{427 429 427} = {434 438 432}
{3 6 3 }  { 369 371 369}   { 372 377 372}
例二.
{427 429 427} - {7 9 5}= {420 420 422}
{369 371 369 } {3 6 3 } {366 365 366 }
Multiplication of Matrices
例一.
4 {7 9 5 }={28 36 20}
 {3 6 3}  {12 24 12}
Multiplication of Two Matrices
例一.
{1 5}  {8 4 3 1}=   {18 29 43 31}
{2 7}   {2 5 8 6 }   {30 43 62 44}
{3 4 }         {32 32 41 27}
NOTE:
In general, the product of an (c × d) matrix and an (d × e) matrix has order (c × e).
*******************
例一.
Consider if we were to write an algorithm for matrix multiplication to multiple two(m × m) matrices;
(a) How many steps of addition and multiplication of integers are used?
(b) Given matrix multiplication is associative [i.e. (B1B2)B3 = B1(B2B3)], would suchpreference in the order of multiplication affects the number of steps taken?
...............................................................................
(a) Multiplying two (m × m) matrices C and D, there would be m2 entries in theproduct.
Total numbers of multiplication = m3
Total numbers of addition = m2(m - 1)
(b) If B1 is a (30 × 20) matrix, B2 is a (20 × 40) matrix, and B3 is a (40 × 10) matrix,then steps involved for (B1B2)B3:
Total numbers of multiplication = 30 × 20 × 40 + 30 × 40 ×10 = 36000.
and steps involved for B1(B2B3):
Total numbers of multiplication = 20 × 40 × 10 + 30 × 20 × 10 = 14000.
Clearly, we can see that the second method is much more efficient.
**************************
Transpose of a Matrix
例一
M = {4 6}           {4 8 5}
  {8 3} then MT=       {6 3 1}
  {5 1},
Special Matrices
A square matrix M is symmetric if M = MT
M = {1 2 5}      {1 2 5}
{2 8 9} and MT=    {2 8 9}
{5 9 4}        {5 9 4}
A diagonal matrix M is a square matrix with all elements 0 except those on the leading diagonal
M={1 0 0}
{0 8 0}
{0 0 4}
A unit matrix I is a diagonal square matrix with all elements 0 except those on the leading diagonal and elements of leading diagonal are 1.
I= {1 0 0}
{0 1 0}
{0 0 1}
I M = M I = M
A null matrix N is a matrix with all elements zero.
N= {0 0 0}
{0 0 0}
{0 0 0}

沒有留言: