BSC_COMPUTER _SCIENCE_UNIT-3_DISCRETE MATHEMATICS
-
Upload
rai-university -
Category
Education
-
view
33 -
download
2
Transcript of BSC_COMPUTER _SCIENCE_UNIT-3_DISCRETE MATHEMATICS
Class: B.Sc CS.
Subject: Discrete Mathematics
Unit-3
RAI UNIVERSITY, AHMEDABAD
UNIT-III: Basics Of Matrix
Definition: Matrix
A ractangular array of m rows and n columns, enclosed by brackets [ ] is
called a matrix of order m×n. A matrix of order 3×3 is expressed as,
A=[a11 a12 a13
a21 a22 a23
a31 a32 a33]
An element a ij denotes, ith row and jth column
a23 denotes, 2nd row and 3rd column.
Matrices are denoted by capital letters A,B,C,……..etc.
Types of Matrices:
1. Row Matrix:
A matrix having only single row is called row matrix. Its order is 1×n .
For example,
A=[1 4 ]1× 2
A=[ 2 4 −3 ]1× 3
2. Column Matrix:
A matrix having single column is called column matrix. Its order is n×1.
For example,
A=[21]2×1
A=[ 4−26 ]
3× 1
3. Square Matrix:
A matrx in which the number of rows is equal to number columns is called a
square matrix.
∴m=n.
∴ No. of rows = No. of columns
For example,
A=[ 1 3−4 2]
2×2
A=[−3 2 12 3 13 1 −5]
3×3
4. Null Matrix:
A matrix whose all elements are zero, is called null matrix.
For example,
A=[0 00 0]
A=[0 0 00 0 00 0 0]
5. Unit Matrix or Identity Matrix:
A matrix in which all the elements of its principal diagonal are unity(one)
and remaining elements are zero is called unit matrix.
It is denoted by I.
I=[1 00 1]
I=[1 0 00 1 00 0 1]
6. Diagonal Matrix:
A square matrix in which the elements on the principal diagonal are non zero
and all the other elements are zero, is called a diagonal matrix.
For example,
A=[1 00 −5]
A=[3 0 00 −1 00 0 2 ]
7. Scalar Matrix:
A diagonal matrix in which all the elements of its principal diagonal are
equal is called scalar matrix.
For example,
A=[5 0 00 5 00 0 5]
A=[−2 00 −2]
8. Transpose Matrix:
For a given matrix A, if rows and column are interchanged ,the new matrix
obtained A’ is called transpose of a matrix.
Transpose of matrix A is denoted by A ' or AT .
For example,
A=[ 2 1 47 6 −34 1 0 ] ∴ A '=AT=[ 2 7 4
1 6 14 −3 0]
( A' )'=A
9. Symmetric Matrix:
A square matrix A=[aij ] is said to be symmetric, if a ij=a ji of each pair (i, j) .
For Symmetric matrix A'=A
For example,
A=[4 2 02 −3 50 5 6 ] ∴ A '=[4 2 0
2 −3 50 5 6 ]
10. Skew Symmetric Matrix:
A square matrix A=[aij ] is said to be skew symmetric if a ij=−a ji for each pair
(i, j).
For Skew symmetric matrix A'=−A.
For example,
A=[ 0 3 5−3 0 4−5 −4 0] A'=[0 −3 −5
3 0 −45 4 0 ]
11. Singular Matrix:
For a square matrix, if value of its determinant is zero, it is called singular
matrix.
For example,
A=|6 29 3| ∴|A|= (6×3 )− (9×2 )=18−18=0
A=|1 2 34 1 53 6 9|∴|A|=1 ( 9−30 )−2 (36−15 )+3 (24−3 ).
|A|=−21−42+63
|A|=0
If |A|=0 is called singular matrix.
If |A|≠0 is called Non singular matrix.
12. Equal Matrix:
For two matrices, if their corresponding elements are equal, they are called
equal matrices.
For example,
A=[ 2 3−4 5 ] B=[ 2 3
−4 5]∴ A=B
13. Negative matrix:
For two matrices, if their corresponding elements are equal but opposite,
they are called Negative matrix.
For example,
A=[1 −23 −5]∴ (−A )=[−1 2
−3 5]14. Orthogonal matrix:
For square matrix A if Product of matirx A & its transpose matrix A’ (i.e.
AA’) is Identity matrix (I).
A=[cosθ −sinθsinθ cosθ ]
A'=[ cosθ sinθ−sinθ cosθ ]
A A'=[1 00 1 ]=I
15. Upper Triangular Matrix:
For square matrix A if all the elements below the main diagonal are zero
then it is called a Upper Triangular Matrix.
For example,
A=[1 4 50 −2 30 0 3]
16. Lower Triangular Matrix:
For square matrix A if all the elements above the main diagonal are zero
then it is called a Lower Triangular Matrix.
For example,
A=[1 0 04 2 03 −1 6]
17. Trace of Matrix:
For square matrix A sum of all diagonal elements are called trace of matrix
A.
For example,
A=[−1 2 73 5 −81 2 7 ]
tr ( A )=−1+5+7=11
18. Idempotent Matrix:
Matrix A is said to be Idempotent matrix if matrix A satisfy the equation
A2=A .
For example
A=[ 2 −2 −4−1 3 41 −2 −3]
19. Involuntary Matrix:
Matrix A is said to be Involuntary matrix if matrix A satisfy the equation
A2=I . Since I 2=I always. Therefore Unit matrix is involuntary.
20. Conjugate Matrix:
Let A=[ 1+i 2+3 i 47+2 i −i 3−2i ]
Conjugate of matrix A is A
A=[ 1−i 2−3 i 47−2i i 3+2 i ]
Note: Transpose of the conjugate of a matrix A is denoted by Aθ .
21.Unitary Matrix:
A square matrix A is said to be unitary if Aθ A=I
For example,
A=[ 1+i2
−1+i2
−1−i2
1−i2
] , Aθ=[ 1−i2
1−i2
−1−i2
1+i2
], A . Aθ=I
22. Hermitian Matrix:
A square matrix A=(aij) is called Hermitian matrix, if every i-jth element of
A is equal to conjugate complex j-ith element of A.
In other words, a ij=a ji
For example,
[ 1 2+3 i 3+i2−3 i 2 1−2i3−i 1+2 i 5 ]
23. Skew Hermitian Matrix:
A square matrix A=(aij) will be calledd a Skew Hermitian matrix if every i-
jth element of A is equal to negative conjugate complex of j-ith element of
A.
In other words , a ij=−a ji
For example, [ i 2−3i 4+5i−(2+3 i) 0 2i−(4−5i) 2 i −3 i ]
24. Minor:
The minor of an element in a third order determinant is a second order
determinant obtained by deletinng the row and column which contain that
element.
For example,
A=| 1 2 13 4 5
−1 1 2|Minor of element 2 = | 3 5
−1 2|
Minor of element 3 = |2 11 2|
Operations On Matrices and it’s Properties:
Addition of Matrices :
If A and B be two matrices of the same order, then their sum, A+B is defined
as the matrix ,each element of which is the sum of the corresponding
elements of A and B.
Thus if A=[4 2 51 3 −6 ] , B=[1 0 2
3 1 4 ]Then A+B=[4+1 2+0 5+2
1+3 3+1 −6+4 ] A+B=[5 2 7
4 4 −2]. If A=[aij ] ,B= [bij ] then A+B= [aij+bij ]
Properties Of Matrix Addition:
Only matrices of the same order can be added or subtracted.
i. Commutative law: A + B = B + A
ii. Associative law: A + (B + C) = (A + B) + C
Subtraction of Matrices:
The difference of two matrices is a matrix, each element of which is obtained
by subtracting the elements of the second matrix from the
Corresponding element of the first.
A−B=[a ij−a ji]
Thus [8 6 41 2 0]−[3 5 1
7 6 2]¿ [8−3 6−5 4−1
1−7 2−6 0−2]¿ [ 5 1 3
−6 −4 −2] Scalar Multiple of a Matrix:
If a matrix is multiplied by a scalar quantity K, then each element is
multiplied by k,
i.e. A=[ 2 3 44 5 66 7 9]
3 A=3[3×2 3×3 3×43×4 3×5 3×63×6 3×7 3×9]=[ 6 9 12
12 15 1818 21 27 ]
Multiplication:
The product of two matrices A and B is only possible if the number of
columns in A is equal to the number of rows in B.
Let A=[aij ] be an m×n matrix and B=[b ij ] be an n× p matrix. Then the product
AB of these matrices is an m× p matrix C=[c ij ] where,
c ij=a i1b1 j+ai2b2 j+ai3b3 j+…+a¿bnj
Properties of Matrix Multiplication:
a) Multiplication of matrix is not commutative.
AB≠ BA
b) Matrix multiplication is associative , if conformability is assured.
A (BC )=( AB )C
c) Matrix multiplication is distributive with respect to addition.
A (B+C )=AB+AC
d) Multiplcation of matrix A by unit matrix.
AI=IA=A
e) Multiplicative inverse of a matrix exists if |A|≠0.
A . A−1=A−1 . A=I
f) If A is a square then A× A=A2 , A× A × A=A3
g) A0=I
h) I n=I , where n is positive integer.
i) ( AB )'=B ' A'
j) ( AB )−1=B−1 A−1
Example-1. If A=[2 2 22 1 −31 0 4 ], B=[3 3 3
3 0 59 9 −1], C=[ 4 4 4
5 −1 5−7 8 −1]
Find 2 A−3 B+C .
Solution:
2 A−3 B+C=2[2 2 22 1 −31 0 4 ]−3 [3 3 3
3 0 59 9 −1]+ [ 4 4 4
5 −1 5−7 8 −1]
2 A−3 B+C=[4 4 44 2 −62 0 8 ]+[ −9 −9 −9
−9 0 −15−27 −27 3 ]+[ 4 4 4
5 −1 5−7 8 −1].
2 A−3 B+C=[ 4−9+4 4−9+4 4−9+44−9+5 2+0−1 −6−15+5
2−27−7 0−27+8 8+3−1 ].2 A−3 B+C=[ −1 −1 −1
0 1 −16−32 −19 10 ].
Example-2. If A=[1 2 13 4 2] ,B=[3 −2 4
1 5 0] find matrixX from X+A+B=0
Solution: X+A+B=0
∴ X+[1 2 13 4 2]+[3 −2 4
1 5 0 ]=0.
∴ X+[4 0 54 9 2]=[0 0 0
0 0 0] ∴ X=[−4 0 −5
−4 −9 −2] Example-3: show that any square matrix can be expressed as the sum of
two matrices, one symmetric and the other anti-symmetric.
Solution: Let A be a given square matrix.
Then A=12
(A+A' )+ 12(A−A ')
Now, ( A+A ' )'=A '+ (A ' )'=A'+A=A+A'
∴ A+A ' is a symmetric matrix.
Also, ( A−A ' )'=A'−( A ' )'=A '−A=−(A−A' )
∴ ( A−A' )∨12(A−A ') is an anti symmetric matrix.
∴ A=12
( A+A ' )+ 12(A−A ')
Example-4.Express A=[1 −2 −33 0 55 6 1 ] as the sum of a lower triangular
matrix and upper triangular matrix.
Solution: Let A=L+U
[1 −2 −33 0 55 6 1 ]=[ a 0 0
b c 0d e f ]+[1 p q
0 1 r0 0 1]
[1 −2 −33 0 55 6 1 ]=[ a+1 0 0
b+0 c+1 0+rd+0 e+0 f +1]
Equating the corresponding elements on both the sides, we get
a+1=1 p=−2 q=−3
b=3 c+1=0 r=5
d=5 e=6 f +1=1
On Solving these equations, we get
a=0 p=−2 q=−3
b=3 c=−1 r=5
d=5 e=6 f=0
Hence L=[0 0 03 −1 05 6 0]∧U=[1 −2 −3
0 1 50 0 1 ]
Example-5 If A=[1 2 34 5 6] and B=[1 2
2 11 2] find AB and BA .
Solution: AB=¿ [1 2 34 5 6] [1 2
2 11 2]
AB=[ (1×1 )+(2×2 )+(3×1) (1×2 )+(2×1 )+(3×2)( 4×1 )+(5×2 )+(6×1) (4×2 )+ (5×1 )+(6×2)]
AB=[ (1+4+3) (2+2+6)(4+10+6) (8+5+12)]
AB=[ 8 1020 25]
Now BA=¿ [1 22 11 2] [1 2 3
4 5 6 ]
A=[ (1×1 )+(2×4) (1×2 )+(2×5) (1×3 )+(2×6)(2×1 )+(1×4) (2×2 )+(1×5) (2×3 )+(1×6)(1×1 )+(2×4) (1×2 )+(2×5) (1×3 )+(2×6)]
A=[(1+8) (2+10) (3+12)(2+4) (4+5) (6+6)(1+8) (2+10) (3+12)]
A=[9 12 156 9 129 12 15]
Example-6. If A=[ 1 2−2 3] ,B=[2 1
2 3 ] and C=[−3 12 0].
Verify that ( AB )C=A (BC ) and A (B+C )=AB+AC .
Solution: AB=[ 1 2−2 3]×[2 1
2 3] AB=[ (1 ) (2 )+(2 )(2) (1 ) (1 )+(2 )(3)
(−2 ) (2 )+(3 )(2) (−2 ) (1 )+(3 )(3)]
AB=[6 72 7 ]
BC=[2 12 3]×[−3 1
2 0] BC=[−6+2 2+0
−6+6 2+0] BC=[−4 2
0 2] AC=[ 1 2
−2 3]×[−3 12 0]
AC=[−3+4 1+06+6 −2+0]
AC=[ 1 112 −2]
B+C=[2 12 3]+[−3 1
2 0] B+C=[2+(−3) 1+1
2+2 3+0 ] B+C=[−1 2
4 3]i. ( AB )C=[6 7
2 7 ]×[−3 12 0]
( AB )C=[−18+14 6+0−6+14 2+0 ]
( AB )C=[−4 68 2 ] .……………………………………………..(1)
& A (BC )=[ 1 2−2 3]×[−4 2
0 2] A (BC )=[−4+0 2+4
8+0 −4+6] A (BC )=[−4 6
8 2 ] ……………………………………………….(2)
Thus from (1) and (2), we get
( AB )C=A (BC )
ii. A (B+C )=[ 1 2−2 3][−1 2
4 3 ] A (B+C )=[−1+8 2+6
2+12 −4+9] A (B+C )=[ 7 8
14 5] ………………………………………….(3)
AB+AC=[ 6+1 7+12+12 7−2]
AB+AC=[ 7 824 5 ] …………………………………………..(4)
Thus from (3) and (4), we get
A (B+C )=AB+AC
Example-7. If A=[1 2 22 1 22 2 1] show that A2−4 A−5 I=0 where I, 0 are the unit
matrix and the null matrix of order 3 respectively. Use this result to find
A−1 .
Solution: Here, we have A=[1 2 22 1 22 2 1]
A2=[1 2 22 1 22 2 1][1 2 2
2 1 22 2 1]
A2=[9 8 88 9 88 8 9]
A2−4 A−5 I=[9 8 88 9 88 8 9]−4 [1 2 2
2 1 22 2 1]−5[1 0 0
0 1 00 0 1]
A2−4 A−5 I=[9−4−5 8−8+0 8−8+08−8+0 9−4−5 8−8+08−8+0 8−8+0 9−4−5]
A2−4 A−5 I=[0 0 00 0 00 0 0]
A2−4 A−5 I=0⟹5 I=A2−4 A
Both the side multiplying by A−1 , we get
5 A−1=A−4 I
5 A−1=[1 2 22 1 22 2 1]−4 [1 0 0
0 1 00 0 1]
5 A−1=[−3 2 22 −3 22 2 −3 ]
A−1=15 [−3 2 2
2 −3 22 2 −3 ]
Adjoint of a square Matrix:
Let the determinant of the square matrix Abe |A|=[a1 a2 a3
b1 b2 b3
c1 c2 c3]
The matrix formed by the co-factors of the elements in
|A|is [A1 A2 A3
B1 B2 B3
C1 C2 C3]
Where A1=|b2 b3
c2 c3|=b2c3−b3 c2 ,
A2=−|b1 b3
c1 c3|=−b1c3−b3 c1 ,
A3=|b1 b2
c1 c2|=b1c2−b2c1 ,
B1=−|a2 a3
c2 c3|= −a2c3+a3c2 ,
B2=|a1 a3
c1 c3|=a1c3−a3 c1 ,
B3=−|a1 a2
c1 c2|=−a1c2+a2 c1 ,
C1=|a2 a3
b2 b3|=a2b3−a3b2 ,
C2=−|a1 a3
b1 b3|=−a1b3+a3b1 ,
C3=|a1 a2
b1 b2|=a1b2−a2b1 ,
Then the transpose of the matrix of co-factors
[A1 B1 C1
A2 B2 C2
A3 B3 C3]
Is called the adjoint of the matrix A and is written as adj A .
Note: For 2×2 order matrix Adj A is defined as:
If A=[a1 a2
b1 b2] then Adj A = [b2 −a2
b1 a1]
i.e. Change location of elelment of principal diagonal
and change sign of elements of subsidary diagonal.
Property of Adjoint Matrix:
The product of a matrix A and its adjoint is equal to unit matrix multiplied by
the determinant A .
Example-1: If A=[5 27 3] then find A−1 .
Solution: Since here, given matrix A is of the Order 2×2.
∴adj A=[ 3 −2−7 5 ]
Example-2: For matrix A=[2 1 50 3 −12 5 0 ] find co-factor matrix adj A .
Solution: Let A=[aij ]
First we will find co-factors of each element.
A11=|3 −15 0 |=0−(−5 )=5
A12=−|0 −12 0 |=−[0−(−2 ) ]=−2
A13=|0 32 5|=(0−6)=−6
A21=−|1 55 0|=−(0−25 )=25
A22=|2 52 0|=(0−10)=−10
A23=−|2 12 5|=−(10−2 )=−8
A31=|1 53 −1|=(−1−15)=−16
A32=−|2 50 −1|=−(−2−0 )=2
A33=|2 10 3|=(6−0 )=6
∴adj A=[ A11 A21 A31
A12 A22 A32
A13 A23 A33] = [ 5 25 −16
−2 −10 2−6 −8 6 ]
Inverse of a Matrix:
If A and B are two square matrices of the same order, such that
AB=BA=I
Then B is called the inverse of A i.e. B=A−1 and A is the invese of B.
Condition for a square matrix A to possess an inverse is that matrix A is
non-singular.
i.e. |A|≠0
If A is square matrix and B its inverse, then AB=I . Taking determinant of
both sides, we get
|AB|=|I|∨|A||B|=I
From this relation it is clear that |A|≠0
i.e. the matrix A is non singular.
To find the inverse matrix with the help of adjoint matrix:
We know that A . (AdjA )=|A|I
A .1
|A|( Adj A )=I (Provided |A|≠0¿ ………………………..(1)
Since A . A−1=I …………………………………………….(2)
From (1) and (2), we have
∴ A−1= 1|A|
(Adj A )=I
Example-1: If A=[ 1 2−1 3 ] find A−1 .
Solution: |A|=| 1 2−1 3|=3−(−2 )=5≠0
∴ A−1is possible.
Adj A=[3 −21 1 ]
∴ A−1=adj A|A|
A−1=15 [3 −2
1 1 ]
A−1=[ 35
−25
15
15
]
Example-2: If A=[1 −1 12 −1 01 0 1] then find A−1 .
Solution: Let given matrix is A .
∴|A|=|1 −1 12 −1 01 0 1|
∴|A|=1 (−1−0 )+1 (2−0 )+1[0−(−1 )]
∴|A|=−1+2+1=2≠0
∴ A−1is possible.
First we will calculate, co-factors of each element.
A11=|−1 00 1|=(−1−0)=−1
A12=−|2 01 1|=[−(2−0 )]=−2
A13=|2 −11 0 |=[0−(−1 )]=1
A21=−|−1 10 1|=[−(−1−0 )]=1
A22=|1 11 1|=(1−1)=0
A23=−|1 −11 0 |=−[0−(−1)]=−1
A31=|−1 1−1 0|=[0−(−1 )]=1
A32=−|1 12 0|=[−(0−2 )]=2
A33=|1 −12 −1|=[−1−(−2 )]=1
∴adj A=[ A11 A21 A31
A12 A22 A32
A13 A23 A33] = [−1 1 1
−2 0 21 −1 1]
A−1=AdjA
|A| ¿12×[−1 1 1
−2 0 21 −1 1]
A−1=¿ [−12
12
12
−1 0 112
−12
12]
Example-3. If a matrix A satisfies a relation A2+A−I=0 prove that A−1
exists and that A−1=I+A , I being an identity matrix.
Solution: Here, A2+A−I=0
∴ A2+A=I
∴ A ( A+ I )=I
∴|A||A+ I|=|I|
∴|A|≠0 and so A−1 exists.
Again A2+A−I=0⟹ A2+A=I
Multiplying (1) by A−1, we get
A−1 ( A2+A )=A−1 I⟹ A+ I=A−1
∴ A−1=I+A
Reference Book and Website Name:
1. Polytechnic Mathematics -1 by Nirav Prakashan.2. Introduction to Engineering Mathematics-1 by H.K. Dass and Dr.Rama
Verma. (S.Chand)3. Engineering Mathematics ( Pearson Fourth Edition)
4. A Textbook of Engineering mathematics by N.P.Bali and Dr.Manish
goyal
5. http://aleph0.clarku.edu/~djoyce/ma130/elementary.pdf
EXERCISE-3
Q-1.Evaluate the following Questions:
1. If A=[0 2 01 0 31 1 2] ,B=[1 2 1
2 1 00 0 3] find ( i )2 A+3 B ( ii ) 3 A−4 B
2. Express [1 2 03 7 15 9 3]as a sum of symmetric matrix and skew-symmetric
matrix.
3. If A=[2 31 0], B=[4 1
2 −3] prove that ( A+B )T=AT+BT .
4. If A=[2 −1 03 2 −45 1 9 ] and B=[ 17 −1 3
−24 −1 −16−7 1 1 ] and 4 A+3C=B , then find matrix
C .
Q-2. Evaluate the following Questions:
1. If A=[0 1 21 2 32 3 4] and B=[ 1 −2
−1 02 −1] Obtain the product AB and explain why
BA is not defined.
2. If A=[1 2 −13 0 24 5 0 ] and B=[1 0 0
2 1 00 1 3] verify that ( AB )'=B ' A' .
3. Compute AB if A=[1 2 34 5 6] and B=[2 5 3
3 6 44 7 5 ].
4. Verify that A=13 [ 1 2 2
2 1 −2−2 2 −1] is Orthogonal.
Q-3. Evaluate the following Questions:
1. If A=[2 5 33 1 21 2 1] then find Adj A .
2. If A=[1 1 21 9 31 4 2] then find A−1 .
3. If A=[1 1 11 2 31 4 9] ,B=[2 5 3
3 1 21 2 1] ,then show that ( AB )−1=B−1 A−1 .
4. If A=[−4 −3 −31 0 14 4 3 ] Prove that Adj A=A .