251x Filetype PDF File size 0.18 MB Source: www.facweb.iitkgp.ac.in
Lecture 5: Matrices
Dheeraj Kumar Singh
07CS1004
Teacher: Prof. Niloy Ganguly
Department of Computer Science and Engineering
IIT Kharagpur
th
29 July, 2008
Types of Matrices
Matrix Addition and Multiplication
Boolean Matrix Operations
1
1 MATRICES
1 Matrices
AMatrix is a rectangular array of numbers arranged in m horizontal rows and n vertical
columns.
a a ... a
11 12 1n
a a ... a
21 22 2n
. . .
A=
. . .
a. a. ... a.
n1 n2 nn
Here we say that A is of order m ×n
Acan also be written as
A=[aij]
The different types of Matrices are
1. Square Matrix: The number of rows and number of columns in a Square Matrix
are equal. If a matrix A is n × n it is said to be a square Matrix of order n. The
entries a ,a ,a ,...,a form the Main Diagonal of A.
11 22 33 nn
For example if
1 2 5
A=3 6 0
1 9 8
Then A is a square Matrix of order 3.
2. Diagonal Matrix: A Square Matrix A = [aij]is said to be a Diagonal Matrix if
every element off its Main Diagonal is 0.
Example :
1 0 0
A1 = 0 6 0
0 0 8
1 0 0 0
0 6 0 0
A =
2 0 0 0 0
0 0 0 1
2
1 MATRICES
3. Zero Matrix: A Matrix is said to be a Zero Matrix if all its entries are 0. A Zero
Matrix is denoted by 0
Example:
0 0 0
A1 = 0 0 0
0 0 0
A =· 0 0 ¸
2 0 0
4. Identity Matrix: An n×n diagonal matrix whose all the diagonal elements are
1 is called an Identity Matrix of order n.
1 0 ... 0
0 1 ... 0
. . .
I =
n . . .
. . .
0 0 ... 1
5. SymmetricMatrix: AsquarematrixA = [aij]ofordernissaidtobeasymmetric
matrix if a =a for all i,j such that 1 ≤ i,j ≤ n.
ij ji
3
2 ADDITIONOFMATRICES:
2 Addition of Matrices:
Twomatrices A = [a ] and B = [b ] can be added only if they are of the same order. If
ij ij
AandB are m×n matrices then the matrix
C=A+B
is defined as cij = aij + bij for 1 <= i <= m, 1 <= j <= n
Example :
2 4 1
A= 1 0 7
−1 3 6
12 3 1
B= 4 1 −7
4 6 2
14 7 2
A+B= 5 1 0
3 9 8
Some of the properties about Matrix Addition are
• A+B=B+A
• (A+B)+C=A+(B+C)
• A+0=0+A=A
4
no reviews yet
Please Login to review.