Anda di halaman 1dari 18

Pertemuan ke-4

Matriks
 Sebuah matriks adalah susunan skalar elemen-
elemen dalam bentuk baris dan kolom.
 Sebuah matriks dengan m baris dan n kolom
dikatakan berukuran m x n
 Sebuah matriks dengan jumlah baris dan kolom
yang sama disebut matriks bujursangkar
(square)
 Dua matriks disebut sama atau equal jika
ukurannya sama dan elemen pada posisi yang
sama nilainya sama.
 The matrix 1 1  is a 3 x 2 matrix
0 2 
 
1 3 
3/30/2014 2
Elemen Matriks
 Definition
Let

The ith row of A is the 1 x n matrix [ai1, ai2, …, ain].


The jth column of A is the n x 1 matrix

The (i, j)th element or entry of A is the


element aij, that is, the number in the ith row
and jth column of A. A convenient shorthand
notation for expressing the matrix A is to write
A = [aij], which indicates that A is the matrix
with its (i, j)th element equal to aij.
3/30/2014 3
Penjumlahan Matriks
 Jika A = [aij] dan B = [bij] adalah m x n matrices.
 Jumlah dari A dan B, dilambangkan dengan
A + B, adalah m x n matrix yang elemen ke-(i,j)
adalah aij + bij.
1 0 - 1   3 4 - 1  4 4 - 2 
 2 2 - 3   1 - 3 0    3 - 1 - 3
     
 3 4 0    1 1 2   2 5 2 
 In other words, A + B = [aij + bij].

3/30/2014 4
Perkalian Matriks
 Dua buah matriks dapat dikalikan jika jumlah
kolom matriks pertama sama dengan jumlah
baris matriks pertama.
 Jika A adalah matriks berukuran m x k dan B
adalah matriks k x n, perkalian A dan B,
dilambangkan dengan AB adalah matriks m x n
dengan elemen ke-(i,j) adalah penjumlahan dari
perkalian elemen-elemen yang bersesuaian
pada baris ke-i dari A dan kolom ke-j dari B.
 In other words, if AB = [cij], then
Cij = ai1b1j + ai2b2j + … + aikbkj.

3/30/2014 5
Contoh Perkalian Matriks
1 1   2 1 3 2  4 3
A  and B    AB    and BA   
 2 1 1 1  5 3 3 2

1 0 4 14 4
2 4 8
2 1 1  9
A  and B  1 1  AB   
3 1 0   7 13 
   3 0   
0 2 2 8 2

3/30/2014 6
Matriks Identitas dan Perpangkatan
 Matriks identitas berderajat n : In = [ij],
di mana ij = 1 jika i = j dan ij = 0 jika i  j.

 A pangkat r adalah r kali perkalian A terhadap


dirinya sendiri. Perpangkatan 0 menghasilkan
matriks identitas.

3/30/2014 7
Transpose Matriks
 Let A = [aij] be an m x n matrix. The
transpose of A, denoted At, is the n x m
matrix obtained by interchanging the
rows and the columns of A.
 In other words, if At = [bij], then bij = aij
for i = 1, 2, …, n and j = 1, 2, …, m.
1 4 
1 2 3  2 5
4 5 6   
 
 3 6 
3/30/2014 8
Matriks Symmetric (Setangkup)
 A square matrix A is called symmetric if A = AT.
 Thus A = [aij] is symmetric if aij = aji for all i and j
with 1  i  n and 1  j  n.

1 1 0 
1 0 1 
 
0 1 0 

3/30/2014 9
Zero One Matrix
 Matriks zero one adalah matriks dengan entry
0 dan 1 saja.
 Direpresentasikan dalam aritmatika boolean
dengan operator boolean yang didefinisikan
sebagai:
1 if b1  b2  1
b1  b2  
0 otherwise
1 if b1  1 or b2  1
b1  b2  
0 otherwise
3/30/2014 10
Join dan Meet Matriks 0/1
(Penjumlahan)

 Let A = [aij] and B = [bij] be m x n zero-one


matrices. Then the join of A and B is the
zero-one matrix with (i, j)th entry aij  bij. The
join of A and B is denoted A  B.
 The meet of A and B is the zero-one matrix
with (i, j)th entry aij  bij. The meet of A and B
is denoted by A  B.

3/30/2014 11
1 0 1 0 1 0 
A  , B  .
0 1 0 1 1 0 
1  0 0  1 1  0  1 1 1
A B      .
0  1 1  1 0  0  1 1 0
1  0 0  1 1  0  0 0 0
A B      .
0  1 1  1 0  0  0 1 0

3/30/2014 12
Boolean Product (Perkalian)
 Let A = [aij] be an m x k zero-one matrix
and B = [bij] be a k x n zero-one matrix.
Then the Boolean product of A and B,
denoted by A  B, is the m x n matrix with
(i, j)th entry [cij] where
cij = (ai1  b1j)  (ai2  b2j)  …  (aik  bkj).

3/30/2014 13
Contoh
1 0 
  1 1 0 
A 0 1 , B  .
  0 1 1
1 0 
(1  1)  (0  0) ( 1  1 )  ( 0  1 ) ( 1  0 )  ( 0  1 )
A  B  (0  1)  (1  0) ( 0  1 )  ( 1  1 ) ( 0  0 )  ( 1  1 )
 
(1  1)  (0  0) ( 1  1 )  ( 0  1 ) ( 1  0 )  ( 0  1 )
1  0 1  0 0  0  1 1 0 
 0  0 0  1 0  1  0 1 1
   
1  0 1  0 0  0  1 1 0 
3/30/2014 14
Pangkat Boolean
 Let A be a square zero-one matrix and let r be a
positive integer. The rth Boolean power of A is the
Boolean product of r factors of A. The rth Boolean
product of A is denoted by A[r]. Hence

 We also define A[0] to be In

3/30/2014 15
0 0 1 1 1 0 
A  1 0 0  A[ 2 ]  A  A  0 0 1 .
   
1 1 0  1 0 1 
1 0 1 1 1 1 
A[ 3 ]  A[ 2 ]  A  1 1 0  , A [4]  A [ 3 ]  A  1 0 1 .
   
1 1 1  1 1 1 
1 1 1
A[ 5 ]  1 1 1 .
 
1 1 1
3/30/2014 16
Algoritma Matriks
Algoritma Penjumlahan Matriks
Input : matriks A ukuran m x n, B ukuran o x p
Output: matriks C
Step:
1. Pengecekan Ukuran:
a) Jika m = o dan n = p lanjut ke langkah 2
b) Jika tidak, berhenti, error
2. Penjumlahan
a) For i=1 to m
b) For j=1 to n
c) cij = aij + bij
3/30/2014 17
Algoritma Matriks
 Bagaimana algoritma Perkalian Matriks?

 Bagaimana algoritma Tranpose Matriks?

3/30/2014 18

Anda mungkin juga menyukai