محاضرات الأسبوع الأول والثانى جبر خطى

advertisement
‫ فصل‬1
(‫)المصفوفات‬Matrices
1.1 Operations with Matrices (‫)عمليات على المصفوفات‬
1.2 Properties of Matrix Operations (‫)خواص عمليات المصفوفات‬
1.3 The Inverse of a Matrix (‫)معكوس المصفوفة‬
1.4 Elementary Matrices (‫)المصفوفة األولية‬
1.5 Applications of Matrix Operations ( ‫تطبيقات على عمليات‬
‫)المصفوفات‬
1.1
1.1 Operations with Matrices (‫)عمليات على المصفوفات‬

Matrix:
 a11 a12 a13  a1n 
a

a
a

a
22
23
2n 
 21
A  [aij ]   a31 a32 a33  a3n 
 M mn








am1 am 2 am3  amn 
mn
(i, j)-th entry (or element): aij
number of rows (‫)عدد الصفوف‬: m
number of columns (‫)عدد األعمدة‬: n
Size (‫)مقاس أو بعد‬: m×n
Square matrix (‫)مصفوفة مربعه‬: m
=n

1.2
Equal matrices (‫)المصفوفات المتساوية‬: two matrices are equal if they
have the same size (m × n) and entries corresponding to the same
position are equal
For A  [aij ]m n and B  [bij ]m n ,

A  B if and only if aij  bij for 1  i  m, 1  j  n

Ex 1: Equality of matrices (‫)تساوى المصفوفات‬
1 2
A

3
4


a b 
B

c
d


If A  B, then a  1, b  2, c  3, and d  4
1.3

Matrix addition (‫)جمع المصفوفات‬:
If A  [aij ]m n , B  [bij ]m n ,
then A  B  [aij ]mn  [bij ]mn  [aij  bij ]mn  [cij ]mn  C

Ex 2: Matrix addition (‫)جمع المصفوفات‬:
 1 2  1 3  1  1 2  3  0 5
 0 1   1 2   0  1 1  2   1 3

 
 
 

 1  1
  3   3 
   
 2  2
 1  1  0 
  3  3   0 

  
 2  2 0
1.4

Scalar multiplication (‫)الضرب المصفوفه في ثابت قياسي‬:
If A  [aij ]m n and c is a constant scalar,
then cA  [caij ]m n


Matrix subtraction (‫)طرح المصفوفات‬::
A  B  A  (1) B
Ex 3: Scalar multiplication and matrix subtraction
 1 2 4
A   3 0  1


 2 1 2
0 0
 2
B   1  4 3


3 2
 1
Find (a) 3A, (b) –B, (c) 3A – B
1.5
Sol:
(a)
(b)
(c)
 1 2 4  31 32 34  3 6 12
3A  3 3 0  1  3 3 30 3 1   9 0  3

 
 

6
 2 1 2  32 31 32  6 3
0
0
0 0   2
 2
4  3
 B   1 1  4 3    1



3 2  1  3  2
 1
0 0  1 6 12
 3 6 12  2
3 A  B   9 0  3   1  4 3   10 4  6


 
 
4
6  1
3 2  7 0
 6 3
1.6

Matrix multiplication (‫)ضرب المصفوفات‬:
If A  [aij ]m n and B  [bij ]n p ,
then AB  [aij ]m n [bij ]n p  [cij ]m p  C ,
should be equal
size of C=AB
n
where cij   aik bkj  ai1b1 j  ai 2b2 j    ainbnj
k 1
 a11 a12  a1n  b  b
 b1n  
 11

1j
 


 
 


b

b

b
21
2j
2n 


 ai1 ai 2  ain  



  ci1 ci 2  cij  cin 
 


 


 bn1  bnj  bnn  


an1 an 2  ann  
※ The entry cij is obtained by calculating the sum of the entry-by-entry
product between the ith row of A and the jth column of B
1.7

Ex 4: Find AB
 1 3
 3 2 


A   4 2
B


4
1

 2 2
 5 0 3 2
Sol:
 (1)(3)  (3)(4) (1)(2)  (3)(1) 
AB  (4)(3)  (2)(4) (4)(2)  (2)(1) 
 (5)(3)  (0)(4)
(5)(2)  (0)(1)  3 2
 9 1 
  4 6 
 15 10  3 2
 Note: (1) BA is not multipliable ‫غير قابلة للضرب‬
(2) Even BA is multipliable ‫ قابلة للضرب‬BA ‫حتى لو أن‬, AB≠BA
1.8
Matrix form of a system of linear equations in n variables ‫الشكل‬
‫المصفوفى لنظام المعادالت الخطيه‬:
 a11 x1  a12 x2    a1n xn  b1
 a x  a x  a x  b
 21 1 22 2
2n n
2

m linear equations


am1 x1  am 2 x2    amn xn  bm


 a11 a12  a1n   x1   b1 
a
x  b 
a

a
22
2n   2 
 21
 2
 


      

   
a
a

a
m2
mn   xn 
 m1
bm 
=
=
=
A
x
b
single matrix equation
A xb
m  n n 1
m 1
1.9

Trace operation (‫ )أثر المصفوفة‬Tr(A):
If A  [aij ]n n , then Tr ( A)  a11  a22 
Tr (A T )  Tr (A );
Tr (AB )  Tr (BA );

 ann
Tr (A  B )  Tr (A ) Tr (B )
Tr (kB )  kTr (A )
Diagonal matrix (‫)المصفوفه القطريه‬: a square matrix in which
nonzero elements are found only in the principal diagonal
d1 0
0 d
2
A  diag (d1 , d 2 ,, d n )  


0 0

 0
 0
  M nn
 
 d n 
※ It is the usual notation for a diagonal matrix.
1.10
1.2 Properties of Matrix Operations (‫)خواص عمليات المصفوفات‬



Three basic matrix operators, introduced in Sec. 1.1:
(1) matrix addition
(2) scalar multiplication
(3) matrix multiplication
Zero matrix (‫)المصفوفه الصفريه‬:
0mn
0 0
0 0



0 0
Identity matrix of order n (‫)مصفوفة الوحدة‬:
0
0 


0  mn
1 0
0 1
In  


0 0
0
0 


1  n n
1.11

Properties of matrix addition and scalar multiplication:
If A, B, C  M mn , and c, d are scalars,
then (1) A+B = B+A
(Commutative property of addition) (‫)األبدال‬
(2) A+(B+C) = (A+B)+C
(3) ( cd ) A = c ( dA )
(4) 1A = A
(Associative property of addition) (‫)الدمج‬
(Associative property of scalar multiplication)
(Multiplicative identity property, and 1 is the multiplicative
identity for all matrices)
(5) c( A+B ) = cA + cB
(6) ( c+d ) A = cA + dA
(Distributive property of scalar multiplication
over matrix addition) (‫)التوزيع عند الضرب فى ثابت‬
(Distributive property of scalar
multiplication over real-number addition)
‫ حيث‬c, d )‫أعداد حقيقيه (ثوابت‬
1.12

Properties of zero matrices (‫)خواص المصفوفه الصفرية‬:
If A  M mn , and c is a scalar,
then (1) A  0mn  A
※ So, 0m×n is also called the additive identity for the set of all m×n matrices
(2) A  (  A)  0mn
※ Thus , –A is called the additive inverse of A
(3) cA  0mn  c  0 or A  0mn
1.13

Properties of matrix multiplication (‫)خواص ضرب المصفوفات‬:
(1) A(BC) = (AB ) C (Associative property of matrix multiplication) (‫)الدمج‬
(2) A(B+C) = AB + AC
(Distributive property of LHS matrix multiplication
over matrix addition)
(Distributive property of RHS matrix multiplication
over matrix addition)
(3) (A+B)C = AC + BC
(4) c (AB) = (cA) B = A (cB)
※ For real numbers, the properties (2) and (3) are the same.

Properties of the identity matrix (‫)خواص مصفوفة الوحدة‬: :
If A  M mn , then (1) AI n  A
(2) I m A  A
※ For real numbers, the role of 1 is similar to the identity matrix. However, 1 is
unique for real numbers and there could be many identity matrices with
different sizes
1.14

Ex 3: Matrix Multiplication is Associative (‫)ضرب المصفوفات دامج‬
Calculate (AB)C and A(BC) for
1 2
1 0 2 
A
, B
,


 2 1
3 2 1 
Sol:
 1
( AB )C   
 2
 5

 1
 1 0 
and C  3 1  .
 2 4
 1
2  1 0
2  
 3



1 3 2 1  
 2
 1 0 
4 0 
17

3 1  


2 3
13

 2 4 
0
1 
4 
4
14 
1.15
1
A( BC )  
2
1

2

2   1
1  3

2   3
1  7
 1 0  
0 2 

3
1

2 1  
 2 4  
8  17 4 


2  13 14 
1.16

Definition of Ak : repeated multiplication of a square matrix:
A1  A, A2  AA,
, Ak  AA
A
k matrices

Properties for Ak:
(1) AjAk = Aj+k
(2) (Aj)k = Ajk
where j and k are nonnegative (‫ )غير سالبه‬integers and A0
is assumed to be I

For diagonal matrices ‫فقط للمصفوفة القطرية‬:
 d1 0
0 d
2
D


0 0
0
 d1k

0 
0
k

D 




dn 
 0
0
d 2k
0
0

0


d nk 
1.17

Transpose of a matrix (‫)مدور (منقول) المصفوفة‬:
 a11 a12
a
a22
21

If A 


 am1 am 2
 a11
a
then AT   12


 a1n
a21
a22
a2 n
a1n 
a2 n 
 M mn ,


amn 
am1 
am 2 
 M n m


amn 
※ The transpose operation is to move the entry aij (original at the position (i, j)) to
the position (j, i)
※ Note that after performing the transpose operation, AT is with the size n×m
1.18

Ex 8: Find the transpose of the following matrix ‫أوجد مدور المصفوفات‬
 2
(a) A   
8 
Sol: (a)
(b)
 1 2 3
A   4 5 6


7 8 9
 2
A 
 AT  2
8 
(b)
 1 2 3
1
A  4 5 6  AT  2



7 8 9
3
(c)
1
0
0
A  2 4  AT  


1
1

1


1
0


(c) A  2 4
 1  1
8
4 7
5 8

6 9
2 1
4  1
1.19

Properties of transposes ()‫)خواص على المدور (المنقول‬:
(1) ( AT )T  A
(2) ( A  B)T  AT  BT
(3) (cA)T  c( AT )
(4) ( AB)T  BT AT
※ Properties (2) and (4) can be generalized to the sum or product of
multiple matrices. For example, (A+B+C)T = AT+BT+CT and (ABC)T =
CTBTAT
1.20

Ex 9: Show that (AB)T and BTAT are equal
1 2
 2
A   1 0 3
 0 2
1
 3 1
B   2 1
 3 0
Sol:
T
 2
1 2   3 1 
 2 1
 2 6 1







T
( AB)    1 0
3  2 1    6 1  

1

1
2


  0 2






1
3
0

1
2





T
 2 1 0 
3 2 3  
 2 6 1

T T
B A 
1 0 2   



1

1
0
1

1
2

  2 3



1


1.21

Symmetric matrix (‫)مصفوفة متماثلة‬:
A square matrix A is symmetric if A = AT

Skew-symmetric matrix (‫)مصفوفة متماثلة تخالفيا‬: :
A square matrix A is skew-symmetric if AT = –A

Ex:
 1 2 3
If A  a 4 5 is symmetric, find a, b, c?


b c 6
Sol:
 1 2 3
1 a b 
T
A

A
A  a 4 5 AT  2 4 c 



  a  2, b  3, c  5
b c 6
3 5 6
1.22

Ex:
 0 1 2
If A  a 0 3 is a skew-symmetric, find a, b, c?


b c 0
Sol:
 0  a  b
 0 1 2
A   a 0 3
 AT    1 0  c 


b c 0
 2  3 0 
A   AT  a  1, b  2, c  3

Note: AAT must be symmetric
Pf:
( AAT )T  ( AT )T AT  AAT
 AA is symmetric
T
※ The matrix A could be with any size,
i.e., it is not necessary for A to be a
square matrix.
※ In fact, AAT must be a square matrix.
1.23
Before finishing this section, two properties will be discussed,
which is held for real numbers, but not for matrices: the first is the
commutative property of matrix multiplication and the second is
the cancellation law (‫)قانون الحذف‬



Real number (‫)االبدال متوفر فى األعداد الحقيقيه‬:
ab = ba (Commutative property of real-number multiplication)
Matrix (‫)االبدال غير متوفر فى المصفوفات‬: :
AB  BA
m n n p n  p m  n
Three situations for BA:
( 1) If m  p , then AB is defined, but BA is undefined
( 2) If m  p, m  n, then AB  M mm , BA  M nn (Sizes are not the same)
(3) If m  p  n, then AB  M mm, BA  M mm
(Sizes are the same, but resultant matrices are not equal)
1.24

Ex 4:
AB  BA ‫بين أن‬
Sow that AB and BA are not equal for the matrices.
2  1
 1 3
B
A
and


0
2
2

1




Sol:
5
 1 3 2  1 2
AB  





2

1
0
2
4

4


 

7
2  1  1 3 0
BA  





0
2
2

1
4

2


 

AB  BA (noncommutativity of matrix multiplication)
1.25

Notes:
(1) A+B = B+A (the commutative law of matrix addition)
(2) AB  BA (the matrix multiplication is not with the
commutative law) (so the order of matrix multiplication is very
important) (‫)الترتيب فى الضرب مهم جدا‬
1.26

Real number ‫لألعداد الحقيقية‬:
ac  bc, c  0
(Cancellation law for real numbers)
 a b

Matrix (‫)قانون الحذف فى المصفوفات‬:
AC  BC and C  0 (C is not a zero matrix)
(1) If C is invertible (‫)قابله للعكس‬, then A = B
(2) If C is not invertible (‫)غير قابله للعكس‬, then A  B
(Cancellation law is not necessary to be valid)
‫قانون الحذف ليس بالضرورة يكون متوفر‬
1.27

Ex 5: (An example in which cancellation is not valid)
Show that AC=BC
 1 3
 2 4
 1  2
A
, B
, C



0
1
2
3

1
2






Sol:
1
AC  
0
2
BC  
2
3  1  2  2 4




1  1
2   1 2
4  1  2   2 4




3  1 2    1 2
So, although AC  BC , A  B
‫قانون الحذف فى المصفوفات ليس بالضروره يكون متوفر‬

1.28
2.3 The Inverse of a Matrix (‫)معكوس المصفوفة‬

Inverse matrix:
Consider A  M nn , ‫مصفوفة مربعه‬
if there exists a matrix B  M nn such that AB  BA  I n ,
then (1) A is invertible (or nonsingular)
(2) B is the inverse of A

 B  A 1
Note:
A square matrix that does not have an inverse (‫)ليس لها معكوس‬
is called noninvertible (or singular) (‫)غير قابله للعكس او شاذه‬
1.29

Theorem ‫ نظرية‬: The inverse of a matrix is unique
If B and C are both inverses of the matrix A, then B = C
‫معكوس المصفوفه وحيد‬.
AB  I
Pf:
C ( AB)  CI
(CA) B  C
IB  C

(associative property of matrix multiplication and the property
for the identity matrix)
BC
Consequently, the inverse of a matrix is unique.
‫معكوس المصفوفه وحيد‬


Notes:
(1) The inverse of A is denoted by A1
(2) AA1  A1 A  I

A1 ‫ هو‬A ‫معكوس المصفوفة‬
1.30
Download