Lecture 1_matrix Operations
Lecture 1_matrix Operations
Definitions
Definition 1. Let K = R or C L = {1, · · · , n} and C = {1, · · · , p} with p, n ∈ N∗
We call a matrix with n rows and p columns with coefficients in K any mapping:
A:L×C → K
(i, j) 7→ A(i, j) = aij
Where:
i: row index
j: column index
aij : (i, j)th element of the matrix A
The set of all matrices with n rows and p columns with coefficients in K is denoted by Mn,p (K)
Example 1. A : {1, 2} × {1, 2, 3} → R
(i, j) 7→ aij avec A(1, 1) = a1,1 = 1; A(1, 2) = a1,2 = −2; A(1, 3) = a1,3 = 6
A(2, 1) = a2,1 = −4; A(2, 2) = a2,2 = 0; A(2, 3) = a2,3 = −3
It is easier to write the aij in the form of a table:
1 −2 6
A=
−4 0 −3
5
Matrix operations
Matrix addition
To be able to add two matrices, they must have the same size (same number of both lines and
columns) :
Let A, B ∈ Mn,p (K)
Note by ai,j the elements of A and by bi,j the elements of B
The elements of the matrix A + B are ci,j = ai,j + bi,j
Example 2.
1 −2 6 0 3 −2 1 1 4
A= B= A+B =
−4 0 −3 1 1 5 −3 1 2
Properties
1. The matrix whose elements are zero is called the zero matrix, it is denoted 0
A ∈ Mn,p (K), A + 0 = 0 + A = A
2. A + B = B + A
3. (A + B) + C = A + (B + C)
Matrix product
To be able to multiply two matrices, the number of columns of the first matrix must be equal to
the number of rows of the second matrix.
Let A ∈ Mn,p (K) and B ∈ Mp,q (K)
Note by ai,j the elements of A and by bi,j the elements of B
Definition 2. The product of A and B is defined by the matrix AB ∈ Mn,q (K) whose elements
are :
.. .. .. .. · · · b1,j · · ·
. . . .
· · · b2,j · · ·
AB = ai,1 ai,2 · · · ai,p
.. .. ..
.
. .. .. .. . . .
. . . . · · · bp,j · · ·
6
X
p
∀i ∈ {1, · · · , n}, j ∈ {1, · · · , q} ci,j = ai,1 b1,j + ai,2 b2,j + · · · + ai,p bp,j = ai,k bk,j
k=1
Example 4.
1 3 3 6 13
0 3 −2
A = 1 1 B= AB = 1 4 3
1 1 5
−2 1 1 −5 9
Properties
1. (AB)C = A(BC)
2. In general, AB 6= BA
Example 5.
1 3
0 3 −2 7 1
B= A = 1 1 BA = ⇒ AB 6= BA
1 1 5 −8 9
−2 1
Transpose of a matrix
Let A ∈ Mn,p (K) with ai,j the elements of A
Definition 3. The transpose of A is defined by the matrix AT ∈ Mp,n (K) whose elements are:
aj,i
Example 6.
1 3
1 1 −2
A = 1 1 AT =
3 1 1
−2 1
Properties
1. (A + B)T = AT + B T
2. (AB)T = B T AT
3. (AT )T = A