Anda di halaman 1dari 60

MATERI PERKULIAHAN

Dosen Pengampu : Drs. Sri Mulyana, M.Kom

Editor:
MULYANTO

PROGRAM PASCA SARJANA ILMU KOMPUTER


FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS GADJAH MADA
YOGYAKARTA
2012

1
Pertemuan 2
12/9/2012
Bentuk lain inferensi
pvq
p .
q
Cerita: Ada fakta-fakta:
Telah terjadi pembunuhan
- Terdapat banyak jejak di seluruh ruang
- Tidak ada barang yang hilang
Apa motif pembunuhan ? (Politik, pencurian, other)
Asumsi:
p : motif politik
q : motif pencurian
r : other motif
s : ada barang hilang
t : pembunuh segera pergi
u : banyak jejak kaki
Rule:
1. q s
2. p t
3. t u
Inferensi
1. p v q v r (kesimpulan)
2. q s
s
q (MP) p v r
q
r
3. t u
(u)
t
p t

t (MT) p

Himpunan Klasik & Himpunan Fuzzy


Himpunan: kmpulan obyek dengan syarat keanggotaan tertentu.
Penyajian:
- list
A = {a, b, c, d, e}
- Syarat
A = {x | x 5 abjad pertama}
Disimbolkan: x A x anggota A
Y A y bukan anggota A

2
Universe (Semesta pembicaraan) , dilambangkan dengan V atau X : himpunan yang memuat semua
obyek yang dibicarakan.
Operasi Dasar Himpunan: A & B himpunan dalam semesta X
1. Union : A B = {x X | x A atau x B}
2. Irisan: A B = {x X | x A dan x B}
3. Complemen : Ac = {{x| x X dan x A} - Ac = X A
4. Differensi: A | B atau A B = {x | x A dan x B}
5. Selisih simetri: A B = (A B) (A B) atau
A B = (A B) (B A)
Derajat Keanggotaan A (x) {1, 0}
Dimana: A (x) =
1, x A
0, x A
Sifat-sifat operasi himpunan setara dengan logika
^
v
C
deMorgan
(p ^ q) = p v q
(p v q) = p ^ q

not(A B) = not(A) not(B)


(A B)c = Ac Bc

p ^ p = 0
pvp=1

A Ac =
A Ac = X(S)

tidak berlaku di fuzzy

Pembuktian A B
A B = (A B) (A B)
= (A B) (A B)c
= (A B) (Ac Bc)
= {(A B) Ac} {(A B) Bc}
= {(A Ac) (B Ac) } {(A Bc) (B Bc)}
= (B Ac) (A Bc)
= (B A) (A B)
= (A B) (B A)
Gambar himpunan keanggotaan
1 ,axb
A (x) =

0, x < a atau x > b


A (x) : fungsi keanggotaan x pada himpunan A (membership function)
a

Contoh:
1. X = {1, , 8}

3
A = {x | x 4}

{1, 2, 3, 4}

B = {x | x genap} {2, 4, 6, 8}
AB=

1
1

1
+
1
0
= 1+
0
1
+8
7

+2+3+4+5+6+

1
2
1
2

+3+4+5+6+7+8
+3+4+5+6+7+8

Himpunan Fuzzy
X = semesta pembicaraan
Himpunan fuzzy A (A), suatu himpunan dengan A (x) [0, 1]
Contoh:
A
1

Penyajian:
1. A =

1
1

2
2

+ =

diskrit

Kalo pak Yoyo nulisnya: A = {(x1, A (x1)), (x2, A (x2)), }


Kalo kontinu : A =

()

Fungsi keanggotaan yang biasa dipakai:


A (x) =

0,

x<a
ax<b

1,

xb

1,

x<a
ax<b
xb

A (x) =

0,
a

Inti dari membership function nilai maksimum 1, nilai minimum 0.


Di Buku Wang ada membershift function number close to zero gaussion function

y = e-x2
0

0
A (x) = x + 1
1x

-1

, x <-1 atau x 1
, -1 x < 0
,0x<1

Operasi Himpunan Fuzzy


Himpunan semesta X
Didefinisikan himpunan fuzzy A, B pada X.
1. AB (x) = A(x) B(x) = min(A(x), B(x))
2. AB (x) = A(x) B(x) = max(A(x), B(x))
3. = 1 - A(x)
Grafiknya:
1

AB

AB

Yang tidak berlaku Fuzzy, tapi berlaku di klasik.


A Ac
A Ac
Kalau pada klasik
A=X

A=
Kalau pada Fuzzy
A Ac X

A AC

Contoh:
x = {1, 2, 3, 4, 5}
Didefinisikan A =
B=

1
0,5
0,3
0,2
+ 3 + 4 + 5
2
0,5
0,7
0,2
0,4
+ 3 + 4 + 5
2

Tentukan : , , AB, AB, A B, B A, AB, A , A , B , (A B)C, (A B)c

Jawab:
1
0
0,5
0,7
0,8
+2+ 3 + 4 + 5
1
1
0,5
0,3
0,8
0,6
= 1+ 2 + 3 + 4 + 5
0
0,5
0,5
0,2
0,2
0,5
0,5
0,2
0,2
AB = + + + +
bisa ditulis
+ + +
1
2
3
4
5
2
3
4
5
1
0,7
0,3
0,4
AB = 2 + 3 + 4 + 5
0,5
0,3
0,3
0,2
A B = A Bc = 2 + 3 + 4 + 5
0,5
0,5
0,2
0,4
B A = B Ac = 2 + 3 + 4 + 5
0,5
0,5
0,3
0,4
A B = (A B) (B A) =
+ + +
2
3
4
5
0,5
0,3
0,3
0,2
A= 2 + 3 + 4 + 5
1
1
0,5
0,8
0,6
A= 1+2+ 3 + 4 + 5
0,5
0,2
0,4
B= 3 + 4 + 5
1
0,7
0,3
0,4
1
0
0,3
0,7
0,6
(A B)C = 1 2 + 3 + 4 + 5 = 1 + 2 + 3 + 4 + 5
1
0
0,3
0,7
0,6
= Ac Bc = 1 + 2 + 3 + 4 + 5 (prove)
0
0,5
0,5
0,2
0,2
1
0,5
0,5
0,8
0,8
(A B)c = 1 - 1 + 2 + 3 + 4 + 5 = 1 + 2 + 3 + 4 + 5
1
0,5
0,5
0,8
0,8
= Ac Bc = + + + +
1
2
3
4
5

Pembuktian bahwa A Ac
A Ac =
A Ac =

0,5
0,3
0,2
+ 4 + 5
3
1
1
0,5
0,7
0,8
+2+ 3 + 4 + 5
1

X=

1
1

+2+3+4+5

Contoh untuk yang kontinu


1

anak

muda

10 15

1
A (x) =

15
5

0
0
(x) =

10
5

1
0
(x) =

10
5

1
50
5

tua

45 50

, x < 10
, 10 x < 15
, x 15
, x < 10
, 10 x < 15
, x 15
, x < 10 atau x 50
, 10 x < 15
, 15 x < 45
, 45 x < 50

60

usia

6
1
(x) =

15
5

0
45
5

0
45
15

T (x) =

1
1
60
15

(x) =

0
anak

, x < 10 atau x 50
, 10 x < 15
, 15 x < 45
, 45 x < 50
, x < 45
, 45 x < 60
, x 60
, x < 45
, 45 x < 60
, x 60
muda

tua

0
AM (x) =

10 15

anak

45 50

usia

60

muda

10
5
15
5

, x < 10 atau x 15
, 10 x < 12,5
, 12,5 x < 15

tua

MT (x) =

10
5

1
10 15

45 50

usia

60

50
5
45
15

, x < 10
, 10 x < 15
, 15 x < 45
, 45 x < 48,75
, 48,75 x < 60

1
, x 60
Fuzzy Relations
Relasi fuzzy melibatkan dua buah himpunan yang saling berelasi. Misal usia dengan kekuatan.
Konsep-konsep dasar himpunan Fuzzy
Support dari himpunan A adalah yang memiliki fungsi keanggotaan A (x) > 0.
Supp (A) = { x U | A (x) > 0 }
0,5

0,8

Contoh : (di Wang) several = 3 + 4 + 5 + 6 +


Supp (several) = { 3, 4, 5, 6, 7, 8 }

0,8
7

Konsep lain: alpha cut (cut)


cut (A) = { x U | A (x) }
Misalnya: untuk = 0,7 maka several = {4, 5 , 6 ,7}

0,5
8

7
Pada fuzzy yang kontinu.
Jika = 0,1 maka A = [-0,9 ; 0,9]
Jika = 0,9 maka A = [-0,1 ; 0,1]

-1

8
Pertemuan 3 (19 September 2012)
Standard Zadeh
AB (x) = max (A (x), B (x))
AB (x) = min (A (x), B (x))
= 1 - A (x)
Operator-operator yang lain:
Fuzzy Complement, yang penting memenuhi 2 syarat pokok. Fuzzy complement merupakan komplemen
jika memenuhi aksioma-aksioma:
i) C(0) = 1 dan C(1) = 0
(boundary condition)
ii) a, b [0, 1] jika a b maka C(a) C(b)
(non increasing condition)
Contoh:
A (x1) = 0,5
A (x2) = 0,2
1 = 0,5
2 = 0,8

, x2 < x1
2 > 1

Berdasarkan aksioma di atas, berikut termasuk complement:


1. Sugeno Complement
C (a) =

2.

1
1+

, (-1, )

Kalau: a = 0,2

b = 0,4

C (a) =

1
+ 1

10,2
1+0,2
10,4
1+0,4

, [0, 1]

Jika: a = 0

a=1

10
0+ 10
11
1+ 11

3. Yager Complement
C(a) = (1 a)1/ , (0, )
a=0
= (1 0)1/ = 1
a=1
= (1 1)1/ = 0

Contoh:

0
1

= =1
= =0

9
1. x : {1, 2, 3, 4, 5}
A=
B=

0
1
0,5
0,3
0,2
+2+ 3 + 4 + 5
1
0
0,5
0,7
0,2
0,4
+ + + +
1
2
3
4
5

Tentukan A-B, B-A, dengan menggunakan C Sugeno = 2! (standard himpunan)


(10)/(1+2.0)
(11)/(1+2.1)
(10,5)/(1+2.0,5)
(10,3)/(1+2.0,3)
(10,2)/(1+2.0,2)
+
+
+
+
1
2
3
4
5
1
0
0,25
0,44
0,57
= + +
+
+
1
2
3
4
5
(10)/(1+2.0)
(10,5)/(1+2.0,5)
(10,7)/(1+2.0,7)
(10,2)/(1+2.0,2)
(10,4)/(1+2.0,4)
B =
+
+
+
+
1
2
3
4
5
1
0,25
0,125
0,57
0,33
= 1+ 2 + 3 + 4 + 5
min
(0,1)
min
(1,0.25)
min
(0.5,0.125)
min
(0.3,0.57)
min
(0.2,0.33)
A B = A Bc =
+
+
+
+
1
2
3
4
5
0
0,25
0,125
0,3
0,2
= +
+
+ +
1
2
3
4
5

B A = B Ac =
=

min
(0,1)
min
(0.5,0)
min
(0.7,0.25)
min
(0.2,0.44)
min
(0.4,0.57)
+
+
+
+
1
2
3
4
5
0
0
0,25
0,2
0,4
+
+
+
+
1
2
3
4
5

Untuk yang gabungan (union), misalkan akan diperiksa apakah hukum de Morgan berlaku jika
menggunakan Sugeno Complement dengan = 2?
Contoh:
(A B)c = Ac Bc
0
1
0,5
0,3
0,2
+ + + +
1
2
3
4
5
0
0,5
0,7
0,2
0,4
B= + + + +
1
2
3
4
5
1
0
0,25
0,44
0,57
Ac = 1 + 2 + 3 + 4 + 5
1
0,25
0,125
0,57
0,33
Bc = +
+
+
+
1
2
3
4
5
0
1
0,7
0,3
0,4
(A B) = 1 + 2 + 3 + 4 + 5
(10)/(1+2.0)
(11)/(1+2.1)
(10,7)/(1+2.0,7)
(10,3)/(1+2.0,3)
(10,4)/(1+2.0,4)
(A B)c =
+
+
+
+
1
2
3
4
5
1/1
0/3
0,3/2,4
0,7/1,6
0,6/1,8
= 1 + 2 + 3 + 4 + 5
1
0
0,125
0,44
0,33
= 1+2+ 3 + 4 + 5
min
(1,1)
min
(0,0.25)
min
(0.25,0.125)
min
(0.44,0.57)
min
(0.57,0.33)
Ac Bc =
+
+
+
+
1
2
3
4
5
1
0
0,125
0,44
0,33
= 1+2+ 3 + 4 + 5

A=

Dengan menggunakan komplemen Sugeno dan union/intersection standard, hukum de Morgan tetap
berlaku.
(A B) =

0
1

(A B)c =
=
=

0,5
0,5
0,2
0,2
+ 3 + 4 + 5
2
(10)/(1+2.0)
(10,5)/(1+2.0,5)
(10,5)/(1+2.0,5)
(10,2)/(1+2.0,2)
(10,2)/(1+2.0,2)
+
+
+
+
1
2
3
4
5
1/1
0,5/2
0,5/2
0,8/1,4
0,8/1,4
+ 2 + 3 + 4 + 5
1
1
0,25
0,25
0,57
0,57
+ 2 + 3 + 4 + 5
1

10
Ac Bc =
=

max
(1,1)
max (0,0.25)
max
(0.25,0.125)
max
(0.44,0.57)
max
(0.57,0.33)
+
+
+
+
1
2
3
4
5
1
0,25
0,25
0,57
0,57
+ 2 + 3 + 4 + 5
1

Relasi / Fungsi
C : [ 0, 1 ] [ 0, 1 ]

complement

Union (S-Norm)
S : [ 0, 1 ] x [ 0, 1 ]

[ 0, 1 ]
Union dari himpunan fuzzy dengan himpunan fuzzy menghasilkan sebuah himpunan fuzzy.
A (x) dan B (x)

AB (x)
Pemetaan fungsi keanggotaan himpunan A dan himpunan B ke fungsi keanggotaan A B dinyatakan:
S (A (x), B (x)) = AB (x)
Suatu fungsi S merupakan fungsi union (S-norm) jika memenuhi aksioma-aksioma sebagai berikut:
1. S(1, 1) = 1, S(0, a) = S(a, 0) = a
(boundary condition)
2. S(a, b) = S(b, a)
(comutative condition)
3. Jika a a dan b b maka S(a, b) S(a, b)
(non decreasing condition)
4. S(S(a, b), c) = S(a, S(b, c))
(assosiative condition)
Beberapa fungsi yang memenuhi S-Norm
1. Dombi Class
1
S(a, b) =
, [ 0, ]
1
1+

1
1
1
+ 1

2. Dubois-Prade Class
S(a, b) =

+ min
(,,1)
max
(1,1,)

, [ 0, 1]

3. Yager Class
4.

5.
6.
7.

S (a, b) = 1, +
Drastic Sum
a, jika b = 0
SDS (a, b) = b, jika a = 0
1, others
Einstein Sum
+
SES (a, b) = 1+
Algebraic Sum
SAS (a, b) = a + b ab
Zadeh Standard
S (a, b) = max (a, b)

Contoh:
x = {1, 2, 3, 4, 5}
A=
B=

0
1
0,5
0,3
0,2
+2+ 3 + 4 + 5
1
0
0,5
0,7
0,2
0,4
+ 2 + 3 + 4 + 5
1

, [ 0, ]

11
Drastic Sum
SDS (x) =
Algebraic Sum
SAS (x) =
=

0
1

+2+3+4+5

0+0 (00)
1+0,5 (10,5)
0,5+0,7 (0,50,7)
0,3+0,2 (0,30,2)
0,2+0,4 (0,20,4)
+
+
+
+
1
2
3
4
5
0
1
0,85
0,44
0,52
+2+ 3 + 4 + 5
1

Pertemuan 4 (26 September 2012)


Untuk sembarang S-norm, berlaku:
max (a, b) S (a, b) SDS (a, b)
Pembuktian:
1. Max (a, b) S (a, b)
Menurut aksioma 1 dan 3
S (a, b) S (a, 0) = a
Juga
S (a, b) = S (b, a) S (b, 0) = b
Dari (1) dan (2) diperoleh: S (a, b) max (a, b)
Atau max (a, b) S (a, b)
2. Drastic Sum menyatakan a jika b = 0, b jika a = 0, 1 untuk yang lain.
S (a, b) SDS (a, b)
Di matematika, dikenal dengan pembuktian berdasarkan kasus:
o Jika b = 0, S(a, b) = S (a, 0) = a, sehingga S(a, b) = SDS (a, b) = a
o Jika a = 0, S(a, b) = S (0, b) = b, sehingga S(a, b) = SDS (a, b) = b
o Jika a 0, b 0, sehingga SDS (a, b) = 1 S (a, b)
Dari ketiga kondisi di atas, diperoleh S (a, b) SDS (a, b)
Fuzzy Intersection (T-Norm)
t : [ 0, 1 ] x [ 0, 1 ]

[ 0, 1 ]
Pemetaan fungsi keanggotaan fuzzy A dan B ke fungsi keanggotaan himpunan fuzzy A B
t (A (x), B (x))
= AB (x)
Yang sudah dikenal sebelumnya (standard Zadeh)
AB (x) = min (A (x), B (x))
Aksioma-aksioma pada t-norm
1. t(0, 0) = 0, t(1, a) = t(a, 1) = a
2. t(a, b) = t(b, a)
3. Jika a a dan b b maka t(a, b) t(a, b)
4. t(t(a, b), c) = t(a, t(b, c))

(boundary condition)
(comutative condition)
(non decreasing condition)
(assosiative condition)

12
Beberapa fungsi yang memenuhi t-norm
1. Dombi Class
1
t(a, b) =
, [ 0, ]
1
1+

1
1
1 + 1

2. Dubois-Prade Class
.
t(a, b) =

max
(,,)

pembuktian pake pendekatan limit

, [ 0, 1]

3. Yager Class
Tw (a, b) = 1 1, 1

+ 1

1/

, [ 0, ]
4. Drastic Product
a, jika b = 1
tDS (a, b) = b, jika a = 1
0, others
5. Einstein Product
.
tEP (a, b) = 2(+ )
6. Algebraic Product
tAP (a, b) = a.b
7. Zadeh Standard
t (a, b) = min (a, b)
Untuk sembarang t-norm, berlaku:
tDP (a, b) t (a, b) min (a, b)
Bukti:
1. tDP (a, b) t (a, b)
Jika b = 1, t (a, b) = t (a, 1) = a sehingga t (a, b) = tDP (a, b) = a
Jika a = 1, t (a, b) = t (1, b) = b sehingga t (a, b) = tDP (a, b) = b
Jika a 1, b 1 sehingga tDS (a, b) = 0 t (a, b)
2. t (a, b) min (a, b)
Menurut aksioma 1 dan 3
t (a, b) t (a, 1) = a
(1)
Juga
t (a, b) = t (b, a) t (b, 1) = b (2)
Dari (1) dan (2) diperoleh: t (a, b) min (a, b)
Atau min (a, b) t (a, b)
Contoh:
x = {1, 2, 3, 4, 5}
A=
B=

0
1
0,5
0,3
0,2
+2+ 3 + 4 + 5
1
0
0,5
0,7
0,2
0,4
+ 2 + 3 + 4 + 5
1

13
Standard Zadeh
AB (x) =
=

min
(0,0)
min
(1,0.5)
min
(0.5,0.7)
min
(0.3,0.2)
min
(0.2,0.4)
+
+
+
+
1
2
3
4
5
0
0,5
0,5
0,2
0,2
+ + + +
1
2
3
4
5

Algebraic Product
AB (x) =
=

00
(10,5)
(0,50,7)
(0,30,2)
(0,20,4)
+ 2 + 3 + 4 + 5
1
0
0,5
0,35
0,06
0,08
+ 2 + 3 + 4 + 5
1

Drastic Product
AB (x) =

0
1

0,5
2

+3+4+5

Hukum de Morgan
=
Jika diterjemahkan dalam bentuk Fuzzy
, = ,
Contoh: Buatlah , dengan Yager Class dan Algebraic Sum/Product menggunakan C Standar
Yager Class : Sw (a, b) = 1, +
tw (a, b) = 1 1, 1
,

+ 1

1/

= ,
= 1 1, +

Algebraic Sum : SAS (a, b) = a + b ab


Product : tAP (a, b) = a.b
C(a) = 1 a
C(b) = 1 b
, = (1 a) (1 b) = 1 a b + ab
,
= 1 (a + b ab) = 1 a b + ab
Contoh:
Buatlah , = , dengan Algebraic Sum/Product menggunakan C Standard.
tAP (a, b) = a.b
, = 1 a.b
C(a) = 1 a
C(b) = 1 b
, = (1 a) + (1 b) (1 a) * (1 b)
= 2 a b (1 a b + ab)
= 1 ab

14
Relasi Fuzzy
Relasi : cara mengkawankan

Cartesian Product untuk dua himpunan A dan B


A x B = { (x, y) | x A, y B }
Pada keanggotaan biner, relasi dari A ke B = subset dari A x B
Misal: A = {1, 2}, B = {a, b}
A x B = { (1, a), (1, b), (2, a), (2, b) }
R = { (1, a), (2, b)
B x A = { (a, 1), (a, 2), (b, 1), (b, 2) }
S = { (a, 2), (b, 1)
2
A x A = A = { (1, 1), (1, 2), (2, 1), (2, 2)}
Jika A B maka A x B B x A
Syarat keanggotaan klasik R (x, y) { 0 , 1 }
Ditulis:
1 , (x, y) R
R (x, y) =
0 , (x, y) R
Misal:
A = {1, 2, 3},
B = {a, b, c}
R = { (1, b), (3, b), (2, c) }
=

1
(1,)

+ (3,) + (2,)

Dalam bentuk gambar:


1

Kalau di Fuzzy R (x, y) [ 0, 1 ]


Tidak hanya pada semesta yang diskrit, bisa juga didefinisikan pada semesta yang kontinu.
Sembarang relasi biner A ke A atau B ke B
UA = A x A (univers semesta pembicaraan)
IA = { (x, y) | x = y, x, y A } I : Identitas
Misal : A = {0, 1, 2}
UA = { (0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2) }
IA = { (0, 0), (1, 1), (2, 2) }

15
Misalkan suatu relasi : S = { (x, y) | y 2x, x, y R }
Semua sifat pada himpunan juga berlaku pada relasi.
Misalkan R dan S adalah relasi. Maka berlaku:
R S, R S, Rc, Sc

Sifat-sifat relasi:
Didefinisikan relasi R, S pada X, Y.
RXxY
(subset dari X x Y)
SXxY
(subset dari X x Y)
Maka:
R S RS (x, y) = S (R (x, y), S (x, y)) = max (R (x, y), S (x, y))
(standard zadeh)
R S RS (x, y) = t (R (x, y), S (x, y)) = min (R (x, y), S (x, y))
(standard zadeh)
c
R = , = C (R (x, y)) = 1 - R (x, y)
(standard zadeh)
Contoh:
A = {1, 2, 3}, B = {a, b, c}
R = { (1, b), (3, b), (2, c) }
S = { (1, a), (2, b), (1, b), (3, e) }
R S = { (1, a), (1, b), (2, b), (2, c), (3, b), (3, e) }
R S = { (1, b) }
= semua anggota semesta yang bukan relasi R. (Semesta = U = A x B)
Komposisi Relasi
1

Relasi langsung dari A ke C T = R S


Misalkan kita mempunyai R : relasi dari semesta X ke Y dan
S : relasi dari semesta Y ke Z
Maka relasi T yang merealisasikan dari X ke Z disebut komposisi relasi.
Contoh :
R

1
1

R = { (x1, y1), (x1, y3), (x2, y4) }


S = { (y1, z2), (y3, z2) }
Apa relasi T dari X ke Z ?
T=RS
Kita bisa menggunakan 2 buah metode:
1. Max-Min Komposisi relasi
2. Max Product komposisi relasi

16
Jika digambarkan secara membership function
1 2 3 4
1 2
1 0 1
1 1 0 1 0
2 0 0
R = 2 0 0
S=
0 1
3 0 1
3 0 0
0 0
4 0 0
T (x1, z1) = 1 , , , 1
= 1,0 , 0,0 , 1,0 , 0,0
= 0,0,0,0
=0
T (x1, z2) = 1 , , , 2
= 1,1 , 0,0 , 1,1 , 0,0
= 1,0,1,0
=1
Dan seterusnya, sehingga diperoleh:
1 2
1 0 1
T =2 0 0
3 0 0

17
Pertemuan 5 (3 Oktober 2012)
Pada logika Crisp
T=RS
T (x, z) = , ,
T (x, z) = , ,

max min
max product

Relasi Fuzzy
Relasi crisp tidak akan dapat merepresentasikan dengan baik untuk kasus sebagai berikut:
X = {SF, HK, TKY}
, Y = { Boston, HK }
R : x R sangat jauh (very var)
Misal :

0,9
0,3
1
0
R =
0,1
0,95
Kalau di crisp relasi adalah subset dari A x B
Kalau di fuzzy relasi adalah A x B itu sendiri
Relasi Fuzzy: Q = { ((u1, u2, ..., un), Q (u1, u2, ..., un)) | (u1, u2, ..., un) U1 x U2 x ... x Un }
Dimana Q (u1, u2, ..., un) [0, 1]
Misal: A : himpunan fuzzy pada semesta X
B : himpunan fuzzy pada semesta Y
Jadi R : A B adalah A x B maknanya A x B = R (X x Y), dengan R (x, y) = min (A (x), B (y))
Contoh:
X = {x1, x2, x3}, Y = {y1, y2}
0,2
0,5
1
A= + +
1

B=

0,3
1

R= 2
3

0,9
2

1
2
min
(0.2,0.3) min
(0.2,0.9)
min
(0.5,0.3) min
(0.5,0.9)
min( 1,0.3)
min
(1, 0.9)

1 2
1 0,2 0,2
= 2 0,3 0,5 Relasi Fuzzy
3 0,3 0,9
Komposisi Relasi Fuzzy
Misal: diberikan 2 relasi S (x, y) dan T (y, z) maka komposisi relasi dinyatakan S T adalah relasi pada X x
Z dengan fungsi keanggotaan ST (x, z) = max t (S (x, y), T (y, z)), dimana t = t-norm.
Contoh:
X = {x1, x2, x3}, Y = {y1, y2}, Z = { z1, z2 }
0,2
0,5
1
A= + +
1

B=

0,3
1

0,9
2

18

C=

1
1

0,5
2

R1 : A B
R2 : B C
1 2
1 0,2 0,2
R1 = 2 0,3 0,5
3 0,3 0,9
1 2
1 0,3 0,3
R2 =
2 0,9 0,5
R1R2 (x1, z1) = max (min (R1 (x1, y1), R2 (y1, z1) ), min (R1 (x1, y2), R2 (y2, z1) ))
0,2 0,2
0,3 0,3
R1 R2 = 0,3 0,5
0,9 0,5
0,3 0,9
max min 0.2,0.3 , min 0.2,0.9
= max min 0.3,0.3 , min 0.5,0.9
max min 0.3,0.3 , min 0.9,0.9

max min 0.2,0.3 , min 0.2,0.5


max min 0.3,0.3 , min 0.5,0.5
max min 0.3,0.3 , min 0.9,0.5

0,2 0,2
= 0,5 0,5
0,9 0,5
Diketahui:
R : A A Tentukan R R
A=

0,2
1

0,5
2

1
3

0,2 0,2 0,2


0,2 0,2 0,2
0,2 0,2 0,2
R R = 0,2 0,5 0,5 0,2 0,5 0,5 = 0,2 0,5 0,5 =
0,2 0,5 1
0,2 0,5 1
0,2 0,5 1
Contoh di Wang

P (very far) : U V

0,3
1
0,95

0,95
Q (very near) : V W
0,1

0,9
0
0,1

0,1
0,9

PQ=?
Max Min

0.3,0.95 , 0.9,0.1

1,0.95 , 0,0.1

0.95,0.95 , 0.1,0.1

0.3,0.1 , 0.9,0.9
1,0.1 , 0,0.9
0.95,0.1 , 0.1,0.9

19

0,3
= 0,95
0,95

0,9
0,1
0,1

Max Product

0.285,0.09
0.95,0

0.9025,0.01

0,285
= 0,95
0,9025

0.03,0.81
0.1,0
0.095,0.09

0,81
0,1
0,095

Sifat-Sifat Relasi pada Himpunan Crisp


Diberikan A : himpunan.
Didefinisikan Relasi R : A A (A2). Berikut sifat-sifat relasi:
1. Reflektif, x A, x R x
a
b
c
d
a
1
b
1
c
1
d
1
2. Simetris, x, y A, jika x R y maka y R x
a
b
c
d
a
1
1
1
b
1
c
1
1
d
1
1
3. Transitif, x, y, z A, jika x R y dan y R z maka x R z

Jika hanya memenuhi (a) refleksif dan (b) simetris maka disebut relasi tolerans, sedangkan jika
ditambahkan (c) transitif maka disebut relasi ekuivalensi.

20
Relasi tolerans bisa diekuivalensikan dengan melakukan komposisi relasi terhadap dirinya sendiri
maksimum (n-1) kali. R1(n-1) = R1 R1 ... R1 (sebanyak n-1 kali)
Contoh:
1 2 3 4 5
1 1 1 0
0 0
2 1 1 0
0 1
R1 = 3 0 0 1
0 0
4 0 0 0
1 0
5 0 1 0 0 1
Sifat: reflektif, simetris, tetapi tidak transitif
(x1, x2) R dan (x2, x5) R tetapi (x1, x5) R tidak transitif
1
1
R1 R1 = 0
0
0
1
1
= 0
0
1

1
1
0
0
1
1
1
0
0
1

0
0
1
0
0
0
0
1
0
0

0
0
0
1
0
0
0
0
1
0

0
1 1 0
0
1
1 1 0
0
0 0 0 1
0
0
0 0 0
1
1
0 1 0 0
1
1
2
0 = R1 ekuivalens.
0
1

0
1
0
0
1

Bagaimana pada relasi fuzzy?


Relasi fuzzy merupakan relasi ekuivalensi jika:
1. Reflektif : (xi, xi) R, R (xi, xi) = 1
2. Simetris : R (xi, xj) = R (xj, xi)
3. Transitif : R (xi, xj) = 1 dan R (xj, xk) = 2 maka R (xi, xk) = dengan min (1, 2)
Seperti pada relasi crisp, jika relasi fuzzy bersifat reflektif dan simetris (toleran), maka dapat dibawa ke
ekuivalensi :
R1(n-1) = R1 R1 ... R1
Contoh:
1 0,8 0 0,1 0,2
0,8 1 0,4 0 0,9
0
0
Diberikan R = 0 0,4 1
0,1 0
0
1 0,5
0,2 0,9 0 0,5 1
Refleksif & simetris tetapi tidak transitif.
R (x1, x2) = 0,8
R (x2, x5) = 0,5
R (x1, x5) = 0,2 min (0.8; 0.5) salah, tidak transitif.
1 0,8 0 0,1 0,2
1 0,8 0 0,1 0,2
0,8 1 0,4 0 0,9
0,8 1 0,4 0 0,9
0
0 0 0,4 1
0
0
R R = 0 0,4 1
0,1 0
0
1 0,5
0,1 0
0
1 0,5
0,2 0,9 0 0,5 1
0,2 0,9 0 0,5 1

21
1
0,8
= 0,4
0,2
0,8

0,8 0,4 0,2 0,8


1 0,4 0,5 0,9
0,4 1
0 0,4
0,5 0
1 0,5
0,9 0,4 0,5 1

R (x1, x2) = 0,8


R (x2, x4) = 0,5
R (x1, x4) = 0,2 min (0.8; 0.5) salah, tidak transitif.
1
0,8
R R = 0,4
0,2
0,8
1
0,8
= 0,4
0,5
0,8

0,8 0,4 0,2 0,8


1 0,8 0,4 0,2 0,8
1 0,4 0,5 0,9
0,8 1 0,4 0,5 0,9
0,4 1
0 0,4 0,4 0,4 1
0 0,4
0,5 0
1 0,5
0,2 0,5 0
1 0,5
0,9 0,4 0,5 1
0,8 0,9 0,4 0,5 1
0,8
1
0,4
0,5
0,9

0,4
0,4
1
0,4
0,4

0,5
0,5
0,4
1
0,5

0,8
0,9
0,4
0,5
1

R (x1, x2) = 0,8


R (x2, x3) = 0,4
R (x1, x3) = 0,4 min (0.8; 0.4) benar, transitif.

22
Pertemuan 6 (10 Oktober 2012)
VARIABEL LINGUISTIK DAN ATURAN FUZZY
Variabel Linguistik: variabel yang bisa dinyatakan dengan bahasa alami. Contoh: suhu, tekanan udara,
berat.
Variabel linguistik merupakan dasar representasi pengetahuan.
Zadeh : (X, T, U, M)
X : nama variabel linguistik
T : Himpunan Fuzzy linguistik
U : Domain variabel linguistik
M : Aturan bagi masing-masing fuzzy-nya (membership function untuk T)
Contoh:
X : kecepatan mobil
T : { lambat, sedang, cepat }
U : [ 0, Vmax] = [ 0, 120 ]
M : { lambat (x), sedang (x), cepat (x) }
y

lambat

sedang

cepat

lambat (x) =

60
20

0
0
40

60

120

sedang (x) =

, x 40 atau x 80
, 40 x 60
, 60 x 80

, x 60
, 60 x 80
, x 80

60
20

cepat (x) =

80

40
20
80
20

, x 40
, 40 x 60
, x 60

Istilah-istilah pada variabel linguistik:


- Primary term: lambat, sedang, cepat
- Combination term: lambat dan sedang, lambat dan tidak cepat, sedang atau cepat
- Hedges term (penyangatan): sangat (very), agak (rather)

Sangat/very (x)

Agak / rather
Ada juga yang mendefinisikan fungsi tersendiri untuk sangat dan agak.
y

lambat

cepat

Sangat
lambat
40

Sangat
cepat
60

80

120

23
Kombinasi:
- sangat lambat dan agak cepat
2

,
Tidak sangat cepat
1 -

Contoh:
U = { 1, 2, 3, 4, 5 }
0,8
0,6
0,4
0,2
+ 3 + 4 + 5
2
1
0,89
0,77
0,63
0,45
agak kecil (x) = 1 + 2 + 3 + 4 + 5
0
0,2
0,4
0,6
0,8
tidak kecil (x) = + + + +
1
2
3
4
5
0
0,04
0,16
0,36
0,64
sangat tidak kecil (x) = 1 + 2 + 3 + 4 + 5

kecil (x) =

1
1

Aturan Fuzzy
IF <proposisi fuzzy> THEN <proposisi fuzzy>
Proposisi fuzzy :
- Atomic : bisa dieksekusi secara langsung dengan atomic function
X is A
A (x) = ?
- Compound/majemuk :
Jika pake AND (intersection) gunakan membership function t-norm
Jika pake OR (union) gunakan membership function s-norm
Jika pake NOT gunakan fuzzy complement
Untuk proposisi fuzzy yang compound bisa berasal dari linguistik / domain yang berbeda.
Misal: kecepatan angin + kelembaban udara curah hujan.
Misalkan: x, y variabel linguistik pada V dan W
A, B himpunan fuzzy pada V dan W
AND : x is A and y is B A B
AB (x, y) = t (A (x), B (y))
OR : x is A or y is B
AB
AB (x, y) = S (A (x), B (y))
NOT :
, = 1 - A (x, y)
Contoh:

FP (x) = S

1 ,

, 1


FP (x) = S

1 ,

, 1

24

FP (x) = S

1 ,


FP (x) = S

1 ,

, 1

Interpretasi Sebuah Aturan Fuzzy IF-THEN


pq
pq

1

Beberapa interpretasi fuzzy IF THEN (Bentuk umum: IF <FP1> THEN <FP2>
1. Implikasi Dienes Rescher
, = 1 1 , 2
2. Implikasi Lukasiewicz
, = 1, 1 1 + 2
3. Implikasi Zadeh
, = 1 , 2 , 1 1
4. Implikasi Godel
1
, 1 2
, =
2 , yang lain
5. Implikasi Mamdani
Min
, = 1 , 2
Product
, = 1 2
Contoh:
U = {1, 2, 3, 4}
V = {1, 2, 3}
0
0,1
0,5
1
Large : 1 + 2 + 3 + 4 , pada U
1

0,4

0,2

Small : 1 + 2 + 3
, pada V
Rule : IF x is Large THEN y is agak not small
Tentukan Q (x, y) dengan metode Dienes Rescher dan Zadeh
Jawab:
0
0,6
0,8
Not Small : 1 + 2 + 3
0

0,77

0,89

Agak not small : 1 + 2 + 3


Metode Dienes Rescher
R:
Agak not
1
2
small
0
0,77
Large
1
0
1
1
2
0,1
0,9
0,9

3
0,89
1
0,9

25
3
4

0,5
1

QD (x, y) =

0,5
0
1
1,1

0,77
0,77
1
1,2

1
1,3

0,89
0,89
0,9
2,1

0,9
2,2

0,9
2,3

0,5
3,1

0,77
3,2

0,89
3,3

0
4,1

0,77
4,2

0,89
4,3

0,9
2,2

0,9
2,3

0,5
3,1

0,5
3,2

0,5
3,3

0
4,1

0,77
4,2

0,89
4,3

0,8
4,1

0,8
4,2

0,8
4,3

Metode Zadeh
R:
Agak not
small

Large

1
2
3
4

0
0,1
0,5
1

QD (x, y) =

1
1,1

1
0

2
0,77

3
0,89

1
0,9
0,5
0

1
0,9
0,5
0,77

1
0,9
0,5
0,89

1
1,2

1
1,3

0,9
2,1

Contoh 2:
U = {1, 2, 3, 4}
V = {1, 2, 3}
W = {1, 2, 3, 4}
0
0,1
0,5
1
Large : 1 + 2 + 3 + 4 , pada U
1

0,4
0,2
+ 3
2
0,2
0,8
0,8
: + +
1
2
3

Small : 1 +

, pada V
0,2

Middle
+ , pada W
4
Rule : IF x is large AND x is middle THEN y is tidak kecil.
Tentukan Q (x, y) dengan metode Dienes Rescher
Jawab:
Tahap penyelesaian: Selesaikan dulu FP1 compound
x is large AND x is middle t-Norm
Misalkan digunakan t-Norm standard Zadeh
min
(0,0.2)
min
(0.1,0.8)
min
(0.5,0.8)
min
(1,0.2) 0
0,1
0,5
0,2
FP1 :
+
+
+
=1+ 2 + 3 + 4
1
2
3
4
FP2 :

11
1

10,4
2

FP2

0
0,1
0,5
0,2

QD (x, y) =

10,2
3

1
0
1
0,9
0,5
0,8

FP1

1
2
3
4

1
1,1

=1+

0,6
2

2
0,6
1
0,9
0,6
0,8
1
1,2

1
1,3

Contoh untuk fungsi kontinu


Misalkan:
x1 : kecepatan
x2 : akselerasi

0,8
3

3
0,8
1
0,9
0,8
0,8
+

0,9
2,1

0,9
2,2

[0, 100]
[0, 30]

0,9
2,3

0,5
3,1

0,6
3,2

0,8
3,3

26
y : kekuatan akselerator [0, 3]
Rule: IF x1 is slow AND x2 is small THEN y is large
1

slow

35

55

1
slow (x1) =

large (y) =

x1

large

10

x2

, x1 35
, 35 x1 55
, x1 55

55 1
20

0
small (x2) =

small

10 2
10

, x2 10
, x2 10

0
1
1

,y1
,1y2
,y2

Tentukan Q (x1, x2, y), dimana intersection (AND) menggunakan aljabar product, dan IF-THEN
menggunakan Dienes-Rescher?
Jawab
FD1 = slowsmall (x1, x2) menggunakan algebraic product
x2

FD1 = slowsmall (x1, x2) =

10

0 , x1 55 or x2 10
55 1 10 2
10 , 35 x1 55 and x2 10
20
10 2
, x1
10

small
35

55

x1

slow

Implikasi Dienes Rescher


, = 1 1 , 2
1 , x1 55 or x2 10
1 1 , =

55 1 10 2
200
10

- 10 2 = 102 , x1

, 35 x1 55 and x2 10

35 and x2 10

35 and x2 10

27

y
3

1 1

1
1

1
x1 35
and
x2 10

1
2
10

(x1, x2)

, x1 55 or x2 10 or y 2

1
, =

x1 55 or
x2 10

35 x1
55 and
x2 10

55 1 10 2
200

, 35 x1 55 and x2 10 and y 1

, x1 35 and x2 10 and y 1

max 1
max

2
10

55 1 10 2
200

, 1

, 35 x1 55 and x2 10 and 1 y 2

, 1 , x1 35 and x2 10 and 1 y 2

28
Latihan Soal:
Untuk semua soal menggunakan operator = 1 , AB (x) = , ,
AB (x) = ,
1. Diketahui himpunan semesta U = {1, 2, 3} dan V = {a, b, c, d}
0,1
0,3
0,6
0,8
0,1
0
0,1
0,5
1
0,8
0,5
0,1
R1 = 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3,
R2 =

0,1
,1

0,8
,2

0,4
,3

0,2
,1

0
,2

0,4
,3

0,1
,1

0,3
,2

0,5
,3

0,6
,1

0,2
,2

0
,3

Dengan menggunakan max-product tuliskan himpunan:


a. R1 R2c
b. R2 R1c
Jawab:

0,9 0,7 0,4 0,2


1 0,1 0,3 0,6 0,8
R1 = 2 0,1 0 0,1 0,5
R1c = 0,9 1 0,9 0,5
0 0,2 0,5 0,9
3 1 0,8 0,5 0,1

R2 =

1
2
3
0,1 0,8 0,4
0,2 0 0,4
0,1 0,3 0,5
0,6 0,2 0

0,9 0,2 0,6


0,8 1 0,6
R2c =
0,9 0,7 0,5
0,4 0,8 1

Relasi Fuzzy menggunakan max-product


0,9 0,2 0,6
0,1 0,3 0,6 0,8
0,8 1 0,6
a. R1 R2c = 0,1 0 0,1 0,5
0,9 0,7 0,5
1 0,8 0,5 0,1
0,4 0,8 1
1
2
3
1 0,54 0,64 0,8
= 2 0,2
0,4 0,5
0,8 0,6
3 0,9
0,1 0,8 0,4
0,9 0,7 0,4 0,2
0,2 0 0,4
c
b. R2 R1 =
0,9 1 0,9 0,5
0,1 0,3 0,5
0 0,2 0,5 0,9
0,6 0,2 0

0,72 0,8 0,72 0,4


0,18 0,14 0,2 0,36
0,27 0,3 0,27 0,45
0,54 0,42 0,24 0,12

2. Sebuah variabel linguistik Kecepatan mempunyai fungsi keanggotaan sebagai berikut:


1

Slow (S)

Medium (M)

35

55

Fast (F)

75

Vmax

Tentukan fungsi keanggotaan dari proposisi


berikut serta gambarkan grafiknya!
a. P1 = (x is S or x is Not F) and x is M, dan
tentukan P1(70)
b. P2 = (x is M and x is not F) or x is S dan
tentukan P2 (42)

29

Jawab:
1

, x 35
, 35 x 55
, x 55

55
20

s (x) =

0
0

, x 35 or x 75
, 35 x 55

35
20
75
20

m (x) =

, 55 x 75

, x 55
, 55 x 75
, x 75

55
20

f (x) =

1
x is Not F
1

, x 55
, 55 x 75
, x 75

75
20

0
x is S or x is Not F
1

Slow (S)

Not F

35

55

75

Vmax

0,1 , x 35
=

55
,1
20
75
0,
20

1 , x 55
75
,
20

, 35 x 55

, 55 x 75
0,0 , x 75

55 x 75

0, x 75

(x is S or x is Not F) and x is M
1

35

55

75

55 x 75

P1 (70) =

Vmax

x is M and x is not F

, x 35 or x 75
35 x 55

35
,
20
75
,
20

7570
20

= 0,25

(x is M and x is not F) or x is S
1

35

55

75

Vmax

35

55

75

Vmax

35

55

75

Vmax

30
Menentukan titik potong 35 x 55
55 35
= 20 55 x = x 35
20
2x = 90
x = 45
1

P2 (42)

55
20
35
20
75
20

55
= 20

5542
20

0
13
= 20

, x 35
, 35 x 45
, 45 x 55
, 55 x 75
, x 75
= 0,65

3. Diberikan himpunan U = {1, 2, 3, 4}, V = {a, b, c} dan W = {#, *}. Untuk sembarang x U, y V, z W
diberikan aturan Fuzzy sebagai berikut:
Q = IF x is A and Y is not B THEN z is very C. Masing-masing himpunan fuzzy didefinisikan sebagai
0,3
0,5
0,7
1
1
0,4
0,1
0,75
0,25
berikut: A = 1 + 2 + 3 + 4, B = + + , dan C = # +
a. Tentukan QD (x, y, z) Implikasi Fuzzy Dienes-Rescher
b. Tentukan QZ (x, y, z) Implikasi Fuzzy Zadeh

Jawab:
FP1 = x is A and Y is not B t-Norm
0
0,6
0,9
Not B = + +
Y is not B

a
0
0
0
0
0

x is A

1
2
3
4

0,3
0,5
0,7
1

FD1 (x, y) =

0
1,

b
0,6
0,3
0,5
0,6
0,6

0,3
1,

FP2 = z is very C
C=

0,75
#

Very C =

0,3
1,

c
0,9
0,3
0,5
0,7
0,9
+

..... hedges

0,25

0,5625
#

0
2,

0,0625

Implikasi Fuzzy Dienes-Rescher


FP2
#
*
FP1
0,5625 0,0625
(1,a)
0
1
1
(1,b) 0,3
0,7
0,7
(1,c) 0,3
0,7
0,7
(2,a)
0
1
1

0,5
2,

0,5
2,

0
3,

0,6
3,

0,7
3,

0
4,

0,6
4,

0,9
4,

31
(2,b)
(2,c)
(3,a)
(3,b)
(3,c)
(4,a)
(4,b)
(4,c)

0,5
0,5
0
0,6
0,7
0
0,6
0,9

QD (x, y, z) =

0,5625
0,5625
1
0,5625
0,5625
1
0,5625
0,5625
1
1,,#

0,5
0,5
1
0,4
0,3
1
0,4
0,1
1
1,,

0,5
2,,

1
3,,#

0,5625
4,,#

0,1
4,,

0,7
1,,#

+
+

1
3,,

+
+

0,7
1,,

0,77
1,,#

0,7
1,,

1
2,,#

1
2,,

0,5625
2,,#

0,5
2,,

0,5625
2,,#

0,5625
3,,#

0,4
3,,

0,5625
3,,#

0,3
3,,

1
4,,#

1
4,,

0,5625
4,,#

0,4
4,,

0,7
1,,

0,7
1,,#

0,7
1,,

1
2,,#

1
2,,

0,5
2,,#

0,5
2,,

0,5
2,,#

0,5625
3,,#

0,4
3,,

0,5625
3,,#

0,3
3,,

1
4,,#

1
4,,

0,5625
4,,#

0,4
4,,

Implikasi Fuzzy Zadeh


FP2
#
*
FP1
0,5625 0,0625
(1,a)
0
1
1
(1,b) 0,3
0,7
0,7
(1,c) 0,3
0,7
0,7
(2,a)
0
1
1
(2,b) 0,5
0,5
0,5
(2,c) 0,5
0,5
0,5
(3,a)
0
1
1
(3,b) 0,6 0,5625
0,4
(3,c) 0,7 0,5625
0,3
(4,a)
0
1
1
(4,b) 0,6 0,5625
0,4
(4,c) 0,9 0,5625
0,1
QZ (x, y, z) =

1
1,,#

1
1,,

0,7
1,,#

1
3,,

0,5
2,,

1
3,,#

0,5625
4,,#

0,1
4,,

+
+

32
Pertemuan 8 (7/11/2012)
FORMULA LOGIKA (Logic Formula)
Logika: studi tentang metode/prinsip penalaran.
Penalaran: bisa menemukan proposisi baru dari proposisi-proposisi yang sudah ada.
Rule formula logika:
1. Nilai kebenaran [0, 1] adalah logic formula
2. Jika p = proposisi, maka p dan logic formula
3. Jika p, q = proposisi, maka dan juga logic formula.
4. Logic formula hanya dinyatakan dengan 1, 2, atau 3.
Inferensi hakikatnya menggunakan bentuk-bentuk tautologi (selalu benar).
Contoh-contoh tautologi:
1.
2.
Semua bentuk tautologi, dapat digunakan untuk inferensi deduktif biasa dikenal: inference rule.
Ada tiga aturan yang sering dikenal:
1. Modus Ponens (MP)

Dapat ditulis:
Premis 1 : x is A
Premis 2 : IF x is A THEN y is B
Conclusion : y is B
2. Modus Tollens (MT)
Dapat ditulis:
Premis 1 : y is not B
Premis 2 : IF x is A THEN y is B
Conclusion : x is not B
3. Hypothetical Syllogism (HS)

Dapat ditulis:
Premis 1 : IF x is A THEN y is B
Premis 2 : IF y is B THEN z is C
Conclusion : IF x is A THEN z is C
Prinsip dasar inferensi pada logika Fuzzy
Dikenal: GMP (Generalized Modus Ponens)
GMT (Generalized Modus Tollens)
GHS (Generalized Hypothetical Syllogism)
1. GMP
Premis 1 : x is A
Premis 2 : IF x is A THEN y is B
Conclusion : y is B

33
Kriteria
P1
P2
P3
P4
P5
P6
P7

x is A (premis 1)
x is A
x is very A
x is very A
x is agak A
x is agak A
x is not A
x is not A

y is B (conclusion)
y is B
y is very B
y is B
y is agak B
y is B
Tidak tahu / unknown
y is not B

2. GMT
Premis 1 : y is B
Premis 2 : IF x is A THEN y is B
Conclusion : x is A
Kriteria
t1
t2
t3
t4
t5

y is B (premis 1)
y is not B
y is not very B
y is not more or less B
y is B
y is B

x is A (conclusion)
y is not A
y is not very A
x is not more or less A
Tidak tahu / unknown
x is A

3. GHS
Premis 1 : IF x is A THEN y is B
Premis 2 : IF y is B THEN z is C
Conclusion : IF x is A THEN y is C

GMP
Diberikan himpunan fuzzy A dalam U (untuk x is A)
Aturan fuzzy
: IF x is A THEN y is B
Relasi fuzzy A B dalam U x V
Suatu himpunan Fuzzy B dalam V didefinisikan:

=
, ,

,
t

: sembarang interpretasi fuzzy IF-THEN


: sembarang t-Norm

Contoh: U = {x1, x2, x3), V = {y1, y2}


Didefinisikan aturan fuzzy: IF x is A THEN y is B
Dengan: A = 0.5/x1 + 1/x2 + 0.6/x3 dan
B = 1/y1 + 0.4/y2
Diberikan fakta: 0.6/x1 + 0.9/x2 + 0.7/x3
Tentukan: B
a. Implikasi Dienes Rescher dan t min

34
, = 1 ,
y1
1
x1 = 0.5
1
x2 = 1.0
1
x3 = 0.6
1

y2
0.4
0.5
0.4
0.4

Untuk y1 B (y1) = Sup (min(0.6; 1), min(0.9;1), min(0.7;1))


= Sup (0.6; 0.9; 0.7)
= 0.9
Untuk y2 B (y2) = Sup (min(0.6; 0.5), min(0.9;0.4), min(0.7;0.4))
= Sup (0.5; 0.4; 0.4)
= 0.5
B = 0.9/y1 + 0.5/y2
b. Implikasi Mamdani Product dan t Aljabar Product
, = 1 2
y1
y2
1
0.4
x1 = 0.5
0.5
0.2
x2 = 1.0
1.0
0.4
x3 = 0.6
0.6
0.24
Untuk y1 B (y1) = Sup (0.6 0.5, 0.9 1, 0.7 0.6)
= Sup (0.3; 0.9; 0.42)
= 0.9
Untuk y2 B (y2) = Sup (0.6 0.2, 0.9 0.4, 0.7 0.24)
= Sup (0.12; 0.36; 0.168)
= 0.36
B = 0.9/y1 + 0.36/y2
Misal diberikan fakta :
1. A= A
2. A = Sangat A
3. A = Agak A
Dicoba dengan :
a. Implikasi Zadeh dan t Einstein Product
b. Implikasi Mamdani min dan Drastic Product
Jawab.
1. A = A
Implikasi Zadeh dan t Einstein Product
QZ (x, y) = 1 , 2 , 1 1
y1
y2
1
0.4
x1 = 0.5
0.5
0.5
x2 = 1.0
1.0
0.4
x3 = 0.6
0.6
0.4
.

tEP (a, b) = 2 +

Untuk y1 B (y1) = 0.5; 0.5 , 1.0; 1.0 , 0.6; 0.6

35
= 0.2; 1; 0.31
= 1.0
Untuk y2 B (y2) = 0.5; 0.5 , 1.0; 0.4 , 0.6; 0.4
= 0.25; 0.4; 0.19
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)
Implikasi Mamdani min dan t - Drastic Product
QM (x, y) = 1 , 2
y1
1
x1 = 0.5
0.5
x2 = 1.0
1.0
x3 = 0.6
0.6

tDP (a, b) =

y2
0.4
0.4
0.4
0.4

a, jika b = 1
b, jika a = 1
0, others

Untuk y1 B (y1) = 0.5; 0.5 , 1.0; 1.0 , 0.6; 0.6


= 0; 1; 0
= 1.0
Untuk y2 B (y2) = 0.5; 0.4 , 1.0; 0.4 , 0.6; 0.4
= 0; 0.4; 0
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)
2. A = sangat A = 0.25/x1 + 1/x2 + 0.36/x3
Implikasi Zadeh dan t Einstein Product
Untuk y1 B (y1) = 0.25; 0.5 , 1.0; 1.0 , 0.36; 0.6
= 0.09; 1; 0.17
= 1.0
Untuk y2 B (y2) = 0.25; 0.5 , 1.0; 0.4 , 0.36; 0.4
= 0.09; 0.4; 0.10
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)
Implikasi Mamdani min dan t - Drastic Product
Untuk y1 B (y1) = 0.25; 0.5 , 1.0; 1.0 , 0.36; 0.6
= 0; 1; 0
= 1.0
Untuk y2 B (y2) = 0.25; 0.4 , 1.0; 0.4 , 0.36; 0.4
= 0; 0.4; 0
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)
3. A = agak A = 0.71/x1 + 1/x2 + 0.77/x3
Implikasi Zadeh dan t Einstein Product
Untuk y1 B (y1) = 0.71; 0.5 , 1.0; 1.0 , 0.77; 0.6
= 0.31; 1; 0.42
= 1.0

36
Untuk y2 B (y2) = 0.71; 0.5 , 1.0; 0.4 , 0.77; 0.4
= 0.31; 0.4; 0.27
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)
Implikasi Mamdani min dan t - Drastic Product
Untuk y1 B (y1) = 0.71; 0.5 , 1.0; 1.0 , 0.77; 0.6
= 0; 1; 0
= 1.0
Untuk y2 B (y2) = 0.71; 0.4 , 1.0; 0.4 , 0.77; 0.4
= 0; 0.4; 0
= 0.4
B = 1.0/y1 + 0.4/y2 (sama dengan B)

37
Pertemuan 9 (14/11/2012)
GMT
Didefinisikan himpunan fuzzy B (untuk y is B) dan relasi A B dalam U x V (untuk representasi)
Aturan fuzzy
: IF x is A THEN y is B
Maka himpunan fuzzy A dalam U didefinisikan:

=
, ,

Sembarang tautologi bisa digunakan untuk inferensi deduktif.


Contoh:
U ={x1, x2, x3}, V = {y1, y2}
Fuzzy IF-THEN
IF x is A THEN y is Bi
Dengan A = 0.5/x1 + 1/x2 + 0.1/x3
B = 1/y1 + 0.4/y2
Jika faktanya diberikan:
B = 0.1/y1 + 0.7/y2
Tentukan A = ?
Gunakan:
a. t Norm standard dan implikasi Dienes Rescher
y1
1
x1 = 0.5
1
x2 = 1.0
1
x3 = 0.1
1

1 ,
,

1 1
= 0.1, 1 , 0.7, 0.5
= Sup (0.1, 0.5)
= 0.5

A (x1) =

1 ,
,

2 1
= 0.1, 1 , 0.7, 0.4
= Sup (0.1, 0.4)
= 0.4

A (x3) =
1 ,
,

3 1
= 0.1, 1 , 0.7, 0.9
= Sup (0.1, 0.7)
= 0.7
A = 0.5/x1 + 0.4/x2 + 0.7/x3
A (x2) =

y2
0.4
0.5
0.4
0.9
, 2 ,

,
1 2

, 2 ,

,
2 2

, 2 ,

,
3 2

b. t Norm Algebra Product dan implikasi Mamdani - Min


y1
y2
1
0.4
x1 = 0.5
0.5
0.4
x2 = 1.0
1
0.4
x3 = 0.1
0.1
0.1

38
A (x1) = 0.1 0.5 , 0.7 0.4
= Sup (0.05, 0.28)
= 0.28
A (x1) = 0.1 1 , 0.7 0.4
= Sup (0.1, 0.28)
= 0.28
A (x1) = 0.1 0.1 , 0.7 0.1
= Sup (0.01, 0.07)
= 0.07
A = 0.28/x1 + 0.28/x2 + 0.07/x3
GHS
Diberikan relasi fuzzy A B (IF x is A THEN y is B)
dalam U x V
Dan relasi fuzzy
B C (IF y is B THEN z is C)
dalam V x W
Didefinisikan:

, =
, , ,

Contoh:
Diberikan U = {x1, x2, x3}, V = {y1, y2}, W = {z1, z2, z3}
Diketahui himpunan fuzzy A pada U dengan:
A = 0.2/x1 + 0.5/x2 + 0.8/x3
Didefinisikan himpunan fuzzy B pada V dengan:
B = 0.9/y1 + 0.4/y2
Dan C pada W dengan:
C = 0.9/z1 + 0.6/z2 + 0.3/z3
Jika diketahui fakta B = 0.8/y1 + 0.5/y2
Tentukan: , !
Aturan: t standard Zadeh dan implikasi Dienes Rescher
y1
y2
AB
0.9
0.4
x1 = 0.2
0.9
0.8
x2 = 0.5
0.9
0.5
x3 = 0.8
0.9
0.4
B C
y1 = 0.8
y2 = 0.5
AC (x1, z1) =
AC (x2, z1) =
AC (x3, z1) =
AC (x1, z2) =
AC (x2, z2) =
AC (x3, z2) =
AC (x1, z3) =
AC (x2, z3) =
AC (x3, z3) =

z1
0.9
0.9
0.9

0.9, 0.9
0.9, 0.9
0.9, 0.9
0.9, 0.6
0.9, 0.6
0.9, 0.6
0.9, 0.3
0.9, 0.3
0.9, 0.3

z2
0.6
0.6
0.6
,
,
,
,
,
,
,
,
,

0.8, 0.9
0.5, 0.9
0.4, 0.9
0.8, 0.6
0.5, 0.6
0.4, 0.6
0.8, 0.5
0.5, 0.5
0.4, 0.5

z3
0.3
0.3
0.5
= Sup (0.9, 0.8) = 0.9
= Sup (0.9, 0.5) = 0.9
= Sup (0.9, 0.4) = 0.9
= Sup (0.6, 0.6) = 0.6
= Sup (0.6, 0.5) = 0.6
= Sup (0.6, 0.4) = 0.6
= Sup (0.3, 0.5) = 0.5
= Sup (0.3, 0.5) = 0.5
= Sup (0.3, 0.4) = 0.4

39

A C
x1 = 0.2
x2 = 0.5
x3 = 0.8

z1
0.9
0.9
0.9
0.9

z2
0.6
0.6
0.6
0.6

z3
0.3
0.5
0.5
0.4

Jika A = Sangat A, tentukan C (z) !


A = 0.2/x1 + 0.5/x2 + 0.8/x3
Sangat A = 0.04/x1 + 0.25/x2 + 0.64/x3

C (z1) =
0.04,0.9 , 0.25,0.9 , 0.64,0.9

= sup (0.04, 0.25, 0.64)


= 0.64

C (z2) =
0.04,0.6 , 0.25,0.6 , 0.64,0.6

= sup (0.04, 0.25, 0.6)


= 0.6

C (z3) =
0.04,0.5 , 0.25,0.5 , 0.64,0.4

= sup (0.04, 0.25, 0.4)


= 0.4
Jadi C = 0.64/z1 + 0.6/z2 + 0.4/z3
Kalo pake Modus Tollens, bisa ditanyakan:
Jika C = sangat C, tentukan A (x) !
C = 0.9/z1 + 0.6/z2 + 0.3/z3
Sangat C = 0.81/z1 + 0.36/z2 + 0.09/z3

0.81,0.9 , 0.36,0.9 , 0.09,0.9

= sup (0.81, 0.36, 0.09)


= 0.81

A (x2) =
0.81,0.6 , 0.36,0.6 , 0.09,0.6

= sup (0.6, 0.36, 0.09)


= 0.6

A (x3) =
0.81,0.5 , 0.36,0.5 , 0.09,0.4

= sup (0.5, 0.36, 0.09)


= 0.5
A = 0.81/x1 + 0.6/x2 + 0.5/x3
A (x1) =

Sifat-sifat Khusus
Akan dilihat nilai A(x), B(y), AC (x, z) dengan berbagai variasi A dan B.
1. GMP
Dipilih t-Norm : min dan implikasi: Mamdani Product

A : normal (ada nilai x yang membershift function = 1,


= 1)

Beberapa tipe A:
a. A = A (seperti pada konvensional)

B (y) =
,

= Sup (A (x), B(y))


karena
=1

40
= B (y)
b. A = very A

B (y) =

jika >
= Sup (A (x), B(y))
= B (y)

Contoh:
A = 0.5/x1 + 1/x2 + 0.4/x3
B = 1/y1 + 0.5/y2
A = A
AB
x1 = 0.5
x2 = 1.0
x3 = 0.4

y1
1.0
0.5
1.0
0.4

Untuk y1 B (y1) =
=
= 1.0
Untuk y2 B (y2) =
=
= 0.5
B = B = 1/y1 + 0.5/y2

y2
0.5
0.25
0.5
0.2
0.5,0.5 , 1.0,1.0 , 0.4,0.4
0.5,1.0,0.4
0.5,0.25 , 1.0,0.5 , 0.4,0.2
0.25,0.5,0.2

A = very A = 0.25/x1 + 1/x2 + 0.16/x3


Untuk y1 B (y1) = 0.25,0.5 , 1.0,1.0 , 0.16,0.4
= 0.25,1.0,0.16
= 1.0
Untuk y2 B (y2) = 0.25,0.25 , 1.0,0.5 , 0.16,0.2
= 0.25,0.5,0.16
= 0.5
B = B = 1/y1 + 0.5/y2
c. A = more or less A

B (y) =
,


Jadi:
B (y) = sup
= B (y)
d. A = not A = 0.5/x1+ 0/x2 + 0.6/x3
Untuk y1 B (y1) = 0.5,0.5 , 0,1.0 , 0.6,0.4
= 0.5,0.0,0.4
= 0.5
Untuk y2 B (y2) = 0.5,0.25 , 0,0.5 , 0.6,0.2
= 0.25,0,0.2
= 0.25

41
B = B = 0.5/y1 + 0.25/y2

terjadi apabial 1 - A (x) = A (x) . B (y)

A (x) . B (y) + A (x) = 1


A (x) (B (y) + 1) = 1
1
A (x) =
1
=


= +1

+1

(titik potong)

42
Pertemuan 10 (21/11/2012)
1. GMP
Syarat:
- T Norm = min
- AB (x, y) = mamdani product
Jika:
a. A = A
b. A = very A
c. A = more or less A

B (y) = B (y)
Harus fuzzy bukan crisp

Contoh: fungsi kontinu


Misal: kita punya rule: if x is A then y is B
Contoh: jika harga tinggi maka stock rendah.
1

Harga tinggi

25

50
50
25

A (x) =

75

100

Harga

, x 50
, 50 x 75

Stock rendah

15

1
B (y) =

, 75 x 100

10
15
10

20

,y5
, 5 y 15
, 15 y 20

Buat AB (x, y) dengan mamdani product.


100

75

mB(y)

mA(x)

mA(x)
.
mB(y)

50

15

20

, x 50 atau 15 y 20
, 50 x 75 dan y 5

0
AB (x, y) =

50
25
15
10
50
25

, 75 x 100 dan 5 y 15
15
10

1
Misalkan diberikan A sbb:

, 50 x 75 dan 5 y 15
, 75 x 100 dan y 5
0
A (x) =

25
50

1
25

50

75

100

Stock

, x 25
, 25 x 75
, 75 x 100

43

, ,

1. y 5 B (y) = , 0 , , , , 1
B (y) =

0 x 50

50 x 75

75 x 100

= 0, , 1
=1
2. 5 y 15
B (y) = , 0 , , .
x 50

50 x 75

, 1,
75 x 100

= 0, . ,
=
3. 15 y 20
B (y) = , 0 , , 0 , , 0
0 x 50
50 x 75
75 x 100
= 0, 0, 0
=0
1
,0y5
15
B (y) =
, 5 y 15
10

, 15 y 20

2. GMT
Fakta: IF x is A THEN y is B
y is B
x is A
Syarat:
- T Norm = min
- AB (x, y) = mamdani product
- Sup B (y) = 1

A (y) =
, ,

Misalkan: Diberikan B =

A (y) =
1 , .

Nilai
minimum terjadi di y0 V, dimana:

1 = .
. + = 1
+ 1 = 1
1
=
1 +
mA (x) = 1 - mB (y) = mA (x) . mB (y)
1
= mA (x) . 1+
mB (y) substitusi dari hasil yg diperoleh sebelumnya

= 1+

Contoh 2:
Misalkan: Diberikan B = B

A (x) =
, .

44

, .

=
.

= A(x)
=

B(y) maksimal bernilai 1 sesuai dengan asumsi

Contoh: fungsi kontinu di GMP


1. B = B
100

75

mB(y)

mA(x)

mA(x)
.
mB(y)

50

15

20

Diberikan B = B
Stock rendah

10

15

Stock

20

, ,

a. 0 x 50
A (x) = 1,0 , , 0 , 0,0
A (x) =

0y5

5 y 15

15 y 20

= 0, 0, 0
=0
b. 50 x 75
A (x) = 1, , , . , 0,0
0y5

5 y 15

= , . , 0
=
c. 75 x 100
A (x) = 1,1 , , , 0,0
0y5
= 1, , 0
=1

0
A (x) = A (x) =

50
25

5 y 15

, 0 x 50
, 50 x 75
, 75 x 100

15 y 20

15 y 20

45
2. B =
100

75

mB(y)

mA(x)

mA(x)
.
mB(y)

50

15

20

Diberikan B =
0
B (y) =

5
10

1
5

10

15

20

, ,

a. 0 x 50
A (x) = 0,0 , , 0 , 1,0
A (x) =

0y5

5 y 15

15 y 20

= 0, 0, 0
=0
b. 50 x 75
A (x) = 0, , , . , 1,0
0y5

= 0,
=

5 y 15

5 50
10

5 50
10

25

25

15
10

15 y 20

,0

15
10

50
25

Nilai SupyV min dicapai ketika:


= .
5
10

5=
25 5
15

50

15

25
10
50 15
25

= 50

25 (y 5) = (x 50) (15 y)
25y 125 = 15x 750 xy + 50y
-25y = 15x xy 625
xy 25y = 15x 625
y(x 25) = 15x 625
15625
y=
25
A (x) =
5
= 10
=

15625
5
25

10

156255+125
10 25

10500
25

= 10

10 50
25

= 10

Atau bisa juga menggunakan rumus [Wang, 1997, p.84]:

50
25

,0y5
, 5 y 15
, 15 y 20

46

mA (x) = 1+

50
25
50
1+
25

50
25
25+50
25

50

= 25

c. 75 x 100
A (x) = 0,1 , , , 1,0
0y5
5 y 15
15 y 20
= 0, , , 0
= ,
Sup minimum terjadi pada =
5 15
=
10
10

y 5 = 15 y
2y = 20
y = 10
105
5
A (x) = 10 = 10 = 10 = 0.5
0
, 0 x 50
50
A (x) = 25
, 50 x 75

, 75 x 100

0,5
3. B = not very B
100

75

mB(y)

mA(x)

mA(x)
.
mB(y)

50

15

20

Diberikan B = not very B


0

B (y) =

15 2
10

1
5

A (x) =

10

15

,0y5
, 5 y 15
, 15 y 20

20

, ,

a. 0 x 50
A (x) = 0,0 , , 0 , 1,0
0y5

5 y 15

15 y 20

= 0, 0, 0
=0
b. 50 x 75
A (x) = 0, , , . , 1,0
0y5

5 y 15

= 0, , . , 0
= , .

15 y 20

47
Nilai SupyV min dicapai ketika:
= .
Dengan menggunakan rumus [Wang, 1997, p.84]
A (x) = A(x) . B(y)
=
=

2 +4 2

2
50 2
50 2
+4
25
25

50
25

2
50 2

= 50
50

25

+4

1 50 2
2

25

c. 75 x 100
A (x) = 0,1 , , , 1,0
0y5
5 y 15
15 y 20
= 0, , , 0
Sup minimum terjadi pada =
15 2
15
= 10
10
100225+30 2
15010
= 100
100

y2 30y 10y + 150 + 125 = 0


y2 40y + 275 = 0

2 4
2
40 40 2 4.1.275
=
2.1
40 500
=
2
4022,36
=
2
66,36
y1 =
= 33,18 A (x)
2
17,64
y2 =
= 8,82 A (x)
2

y1,2 =

=
=

1533,18
= -1,818
10
158,82
= 0,618
10

, 0 x 50

0
A (x) =

50
50

0,618

50 2
25

+4

(tidak memenuhi karena negatif)

1 50 2
2

25

, 50 x 75
, 75 x 100

48
Pertemuan 11
(28/11/2012)
FUZZY RULE BASED DAN FUZZY INFERENCE ENGINE
Fuzzy rule Based System Fuzzy Fuzzy Inference Engine
Arsitektur Sistem Fuzzy secara umum:
Input
xU
(crisp)

Fuzzifier

Fuzzy set di U

Fuzzy Rule Based

Fuzzy
Inference Engine

Defuzzifier

Output
yV
(crisp)

Fuzzy set di V

Fuzzifikasi:
1. Fuzzy singleton Tsukamoto ketika x=1
2. Fuzzy Segitiga (triangular)
3. Fuzzy Norm.
Yang kompleks:
U-nya banyak, misal:
U = U1 x U2 x ... x Un Rn
x = (x1, x2, ..., xn) Rn , y R multiple input, single output.

Struktur Basis Aturan Fuzzy


Secara umum bentuknya:
Rul: IF x1 is 1 and x2 is 2 and ... and xn is THEN y is Bl
dengan: dan Bl suatu himpunan fuzzy dalam Ui R dan V R.
(x1, x2, ... , xn)T U = U1 U2 ... Un dan y V.
Misal:
- M : banyaknya aturan
- L = 1, 2, ..., M.
Aturan Fuzzy IF ... THEN dapat berbentuk:
a. Partial rules
IF x1 is 1 and ... and xm is THEN y is Bl, dimana m < n
Contoh:
Harga
Stok
Permintaan
Rendah
Banyak
Naik
Tinggi
Sedikit
Turun
Jika harga rendah dan stock banyak permintaan naik

49
Kalo parsial:
Jika harga tinggi maka permintaan turun.
b. Formula OR
IF (x1 is 1 and ... and xm is ) OR (xm+1 is +1 and ... and xn is ) THEN y is Bl
c. Pernyataan tunggal
y is Bl
d. Aturan Gradual
The smaller the x, the bigger the y
e. Aturan Non Fuzzy convensional production rules.
Properties Himpunan Rule
a. Completeness (lengkap)
Suatu himpunan Fuzzy IF THEN disebut lengkap jika ada paling sedikit 1 aturan dari basis
aturan dimana ( ) 0, untuk semua i = 1, 2, ..., n.
Contoh Komplet:
U1
U2
V
Harga
Stock
Permintaan
Rendah
Banyak
Naik
Rendah
Sedikit
Turun
Tinggi
Banyak
Naik
Tinggi
Sedikit
Turun
IF x1 is Rendah and x2 is Banyak THEN y is B1
IF x1 is Rendah and x2 is Sedikit THEN y is B2
IF x1 is Tinggi and x2 is Banyak THEN y is B3
IF x1 is Tinggi and x2 is Sedikit THEN y is B4
b. Consistent
Jika x-nya sama, maka y-nya tidak boleh beda.
FUZZY INFERENCE ENGINE
Rule based: himpunan m buah rule.
Prinsip: mengkombinasikan semua aturan/rule tersebut sehingga menjadi 1 rule dalam U V.
Yang perlu diketahui: intuitively antar rule bagaimana?
Misal:
IF X1 is A1 THEN y is B1
IF X2 is A2 THEN y is B2
IF X1 is A1 and X2 is A2 THEN y is B3

independen
saling bergantungan

Mamdani saling independen pakai S-Norm


Godel saling bergantung pakai t-Norm
Apa makna dari aturan-aturan tersebut (secara intuitif)
1. Aturan-aturan tersebut merupakan pernyataan kondisional yang independen.
union (s-norm) mamdani
2. Semua aturan merupakan satu kesatuan (saling memberi dampak pada kesimpulan)
interseksi (t-norm) godel

50
Misal: Rnl relasi fuzzy pada U x V sebagai representasi fuzzy IF ... THEN (rule).
Rnl = 1 2 Bl
U = U1 U2 ... Un
Didefinisikan:
1 , 2 , , = 1
1

Dimana merepresentasikan sebarang operator t-norm.


Untuk sudut pandang Union, diperoleh relasi fuzzy QM dalam U V adalah:

=
=1

Kombinasi ini dikenal sebagai Kombinasi Mamdani, ditulis:


, = 1 , + 2 , + + ,
Dengan + sebarang s-norm.
Untuk sudut pandang irisan, diperoleh relasi fuzzy QG dalam U V adalah:

=
=1

Kombinasi ini dikenal sebagai Kombinasi Godel, ditulis:


, = 1 , 2 , ,
Dengan + sebarang t-norm.
Misal: A sebarang himpunan fuzzy dalam U (sebagai input)
=

, ,

Union (Mamdani)

atau
=

, ,

Irisan (Godel)

Contoh: A = {x1, x2, x3}


B = {y1, y2}
Diberikan aturan:
IF x1 is A2 THEN y is B1
IF x2 is A1 THEN y is B2
Dengan : A1 = 0.6/x1 + 1/x2 + 0.4/x3
B1 = 1/y1 + 0.4/y2
A2 = 0.4/x1 + 0.8/x2 + 0.7/x3
B2 = 0.8/y1 + 0.5/y2
Jika A = 0.5/x1 + 0.9/x2 + 0.6/x3 tentukan B !
Misal, dipakai: mamdani min, t-norm min, s-norm max
Metode: komposisional dan individual
Jawab:
Individual rule based inference
2 1 ,
B1
R1

A2

x1 = 0.4
x2 = 0.8
x3 = 0.7

y1
1
0.4
0.8
0.7

y2
0.4
0.4
0.4
0.4

51
1 2 ,
B2
R2
x1 = 0.6
x2 = 1
x3 = 0.4

A1

y1
0.8
0.6
0.8
0.4

y2
0.5
0.5
0.5
0.4

Untuk individual masing-masing rule akan diberikan input terhadap A akan didapat B1 dan B2. B
tinggal dipandang sebagai minimum/intersection.

1 =
, 2 1 ,

1 1 =
0.5, 0.4 , 0.9, 0.8 , 0.6, 0.7 = 0.8

1 2 =
0.5, 0.4 , 0.9, 0.4 , 0.6, 0.4 = 0.4

1 = 0.8/y1 + 0.4/y2

, 1 2 ,

=
0.5, 0.6 , 0.9, 0.8 , 0.6, 0.4 = 0.8

=
0.5, 0.5 , 0.9, 0.5 , 0.6, 0.4 = 0.5

= 0.8/y1 + 0.5/y2
= 0.8/1 + 0.5/2
=?
= 0.8/1 + 0.4/2

2 =
2 1
2 2
2

Komposisional
, = 1 , + 2 ,

Mamdani

, = 1 , 2 ,

Godel

Mamdani
R
x1
x2
x3

y1

y2

0.6
0.8
0.7

0.5
0.5
0.4

0.5, 0.6 , 0.9, 0.8 , 0.6, 0.7 = 0.8

2 =
0.5, 0.5 , 0.9, 0.5 , 0.6, 0.4 = 0.5

= 0.8/1 + 0.5/2

1 =

Godel
R
x1
x2
x3
1 =

y1

y2

0.4
0.8
0.4

0.4
0.4
0.4

0.5, 0.4 , 0.9, 0.8 , 0.6, 0.4

= 0.8

52

0.5, 0.4 , 0.9, 0.4 , 0.6, 0.4

= 0.8/1 + 0.4/2

2 =

= 0.4

Hasilnya sama baik yang menggunakan metode individual maupun komposisional.


Beberapa fuzzy inference engine
1. Product Inference Engine
- Individual union
- Implikasi Mamdani product
- S-Norm max
- T-Norm algebraic product
2. Minimum Inference Engine
- Individual union
- Implikasi Mamdani min
- S-Norm max
- T-Norm min
3. Lukasiewicz Inference Engine
- Individual intersection
- Implikasi Lukasiewicz
- T-Norm min
4. Zadeh Inference Engine
- Individual intersection
- Implikasi Zadeh
- T-Norm min
5. Dienes-Rescher Inference Engine
- Individual intersection
- Implikasi Dienes-Rescher
- T-Norm min
Jika A adalah fungsi singleton, maka fuzzy inference engine diperoleh:
1. Product
= .
2. Min
= min ,
3. Lukasiewicz
= min 1, 1 +
4. Zadeh
= min , , 1
5. Dienes-Rescher
= max 1 ,
Catatan:
Fuzzy set A merupakan fuzzy singleton, apabila
1, jika x = x*
=
0, selain itu

53
Contoh: diberikan rule
IF x1 is A1 and x2 is A2 and ... and xn is An THEN y is B
1 - | y | , -1 y 1
Dimana B =
0, yang lain
Jika A merupakan fuzzy singleton, tentukan ?

Misal, diperoleh: A (x1, x2, ... , xn)

-1

= min 1 1 , 2 2 , ,
=

=
=1

Case 1 : 0,5

mAp(xp*)

mA(x*)
y

-1

Mamdani-Min

Mamdani-Product

mAp(xp*)
1-mAp(xp*)

1-mAp(xp*)
y

-1

y
-1

Lukasiewicz

Zadeh

1-mAp(xp*)
y
-1

Dienes-Rescher
Case 2 : < 0,5
1

mAp(xp*)

mAp(xp*)
mA(x*)
y

-1

Mamdani-Min

y
-1

Mamdani-Product

54

1-mAp(xp*)

1-mAp(xp*)

y
-1

-1

Lukasiewicz

Zadeh

1-mAp(xp*)

y
-1

Dienes-Rescher
Jika tidak singleton, maka pada product inference engine, rumusnya menjadi:

Bernilai 1 jika singleton


Pertemuan 12 (5/12/2012)
Pemetaan titik x* U (x* : bilangan real) ke suatu himpunan fuzzy A dalam U.
Beberapa yang dikenal:
1. Singleton Fuzzifier
Yaitu memetakan x* U ke himpunan fuzzy A dalam U dengan nilai keanggotaan 1 pada x*
dan 0 untuk yang lain.
1, x = x*
1
A (x) =
0, yang lain
x*

2. Gaussian Fuzzifier
Yaitu memetakan x* U ke himpunan fuzzy A dalam U dengan fungsi keanggotaan sebagai
berikut:
2


1 1

=

Dimana ai adalah parameter positif, dan t-norm biasanya menggunakan algebraic product
atau min.
1

3. Triangular Fuzzifier
Yaitu memetakan x* U ke himpunan fuzzy A dalam U dengan fungsi keanggotaan
triangular sebagai berikut:
1

1 1
1

, jika bi, i = 1, 2, ..., n

=
0, yang lain
Dimana bi adalah parameter positif, dan t-norm biasanya menggunakan algebraic product
atau min.

55
Defuzzifier
Memetakan dari suatu himpunan fuzzy di dalam U sebagai output dari fuzzy inference engine ke
dalam sebuah titik y* dalam V dimana y adalah crisp.
Ada 4 cara untuk melakukan defuzzifier, yaitu:
1. Center of gravity defuzzifier (centroid) : biasanya untuk fungsi yang kontinu.
y* adalah titik berat dari area yang dibatasi oleh fungsi-fungsi B.
=

2. Center average
=

=1 .

=1

3. Maximum membership principal terlalu kasar, optimistik


B (y*) B (y), untuk semua y V.
w1
*

y = w1

w2

y1

y2

4. Min-Max membership (middle of maxima)


w1

y* =

1 + 2
2

w2

y1

y2

56
Contoh: Suatu survey memberikan 3 buah B (output)

Tentukan z* ?
a. Center of average
2,5 . 0,3 + 5 . 0,5 + 6,5 .
y* =
0,3+0,5+1

9,75
1,8

= 5,42

b. Middle of maxima
6+7
13
y* = 2 = 2 = 6,5
c. Centroid
3
2

= 0,3 y = 3,6

5 = 0,5 y = 5,5

1
3,6
4 3
5,5
= 0 0,3. + 1 0,3. + 3,6 2 . + 4 0,5 .
6
7
8
5 . + 6 + 7 8 .
5,5
1
3,6
4
5,5
= 13.0,3 3 + 12.0,3 2
+ 16 3 34 2
+ 14 2
+ 13 3 52 2
0
1
4
3,6
8
1 2 7

+ 4 2 13 3
2
6
7

Pembilang =

+
6
5,5

= 0,1 + 1,794 + 0,611 + 3,5625 + 2,167 + 6,5 + 3,667


= 18,4005

1
3,6
= 0 0,3 + 1 0,3 +
7
8
+ 6 + 7 8
1
= 12.0,3 2 + 0,3 13,6 + 14 2
0
8
8 12 2
7

Penyebut =

4 3
3,6 2

3
2

4
3,6

+
+ 12

5,5
4

= 0,15 + 0,78 + 0,16 + 0,75 + 0,375 + 1 + 0,5


= 3,715
y*= 18,4005
=4,953
3,715

5,5
0,5
4

1
2

6
5,5

2 5

6
5,5

7
6

57
Contoh 2:
Diberikan sistem fuzzy 2 input 1 output. Didefinisikan aturan fuzzy:
IF x1 is A1 and x 2 is A2 THEN y is A1
IF x 1 is A2 and x 2 is A1 THEN y is A2
dengan A1 dan A2 = himpunan fuzzy dalam R dengan fungsi keanggotaan:
A1 (x) =

1 , 1 1
0
, yang lain

A2 (x) =

1 1 ,0 2
0
, yang lain

Inputan : 1 , 2 = (0.3, 0.6) dengan singleton fuzzifier.


Tentukan output sistem fuzzy, dengan: product inference engine dan center of average.
= .
= 1 1 . 2 2 . 1 , 2 1 . 1 2 . 2
= 1 0,3 . 2 0,6 . 1 , 2 0,3 . 1 0,6 . 2
= 0,7.0,6. 1 , 0,3.0,4. 2
= 0,42. 1 , 0,12. 2
1

1
0,42
0,12

-1

A1

-1

A2

Center of average
0,42.0+0,12.1 0,12
y* = 0,42+0,12 = 0,54 = 0,222
Khusus untuk fungsi semacam ini:
Center of average
2
y* = +
1

w1
w2

-1

Centroid
Penyebut = luas area = luas area 1 + luas area 2 + irisan
2
= w1 + w2 - 12 1+
1
2
. 0,12
= 0,42 + 0,12 - 12 0,42
0,42+0,12
= 0,4933
Pembilang =

0
1
1

1 + +

w1
w1+w2

1
1 + 2

3
1
1 + 2 2
1
0,42 3
0,42+0,12+16
6
0,42+0,12 2

= 1
+ 2 +16
6 1
=
= 0,0923
* 0,0923
y = 0,4933 = 0,1872

Bentuk-bentuk implementasi fuzzy logic


Inference engine yang sering dijumpai:
1. Mamdani min singleton fuzzifier
2. Sugeno (TSK)
3. Tsukamoto

1 1 +

1
1
1 + 2

2 +

2 2

58
Mamdani Min
- Singleton fuzzifier
- B(y) = min (A (x) . B (y))

Karena singleton=1
B(y) = B (y)

mA(x2)

mA(x1)

mA(x2)

mB(y)

x2

x1

Contoh:
Suatu perusahaan makanan kaleng akan memproduksi makanan jenis ABC. Dari data 1 bulan
terakhir, permintaan terbesar sehingga mencapai 5000 kemasan/hari, dan permintaan terkecil
sampai 1000 kemasan/hari. Persediaan barang di gudang terbanyak sampai 600 kemasan/hari, dan
terkecil pernah sampai 100 kemasan/hari. Dengan segala keterbatasannya, sampai saat ini,
perusahaan baru mampu memproduksi barang maksimum 7000 kemasan/hari, serta demi efisiensi
mesin dan SDM tiap hari diharapkan perusahaan memproduksi paling tidak 2000 kemasan. Apabila
proses perusahaan tersebut menggunakan 4 aturan fuzzy.
[R1] IF Permintaan TURUN and Persediaan BANYAK THEN Produksi BERKURANG.
[R2] IF Permintaan TURUN and Persediaan SEDIKIT THEN Produksi BERKURANG.
[R3] IF Permintaan NAIK and Persediaan BANYAK THEN Produksi BERTAMBAH.
[R4] IF Permintaan NAIK and Persediaan SEDIKIT THEN Produksi BERTAMBAH.
Berapa kemasan makanan jenis ABC yang harus diproduksi, jika jumlah permintaan sebanyak 4000
kemasan dan persediaan di gudang masih 300 kemasan?
Jawab:
Ada 3 variabel fuzzy yang akan dimodelkan: permintaan, persediaan dan produksi.

1
0,75

TURUN

NAIK

SEDIKIT

BANYAK

BERKURANG

BERTAMBAH

0,6
0,4

0,25
1000

4000 5000

100

300

600

2000

Permintaan
Persediaan
(kemasan/hari)
(kemasan/hari)
Input (x1*, x2*) = (permintaan, persediaan) = (4000, 300)

7000

Produksi Barang
(kemasan/hari)

[R1] IF Permintaan TURUN and Persediaan BANYAK THEN Produksi BERKURANG.


m(x)

m(y)
TURUN

m(z)
BANYAK

BERKURANG

1
0,25

0,4

0,25
1000

4000 5000

BERKURANG

100

300

600

2000

7000

2000

7000

59
[R2] IF Permintaan TURUN and Persediaan SEDIKIT THEN Produksi BERKURANG.
m(x)

m(y)

m(z)
SEDIKIT

TURUN

BERKURANG

BERKURANG

0,6
0,25
0,25
1000

4000 5000

100

300

600

2000

7000

2000

7000

[R3] IF Permintaan NAIK and Persediaan BANYAK THEN Produksi BERTAMBAH.


m(x)

m(y)

m(z)

NAIK

BERTAMBAH

BANYAK

1
0,75

1000

4000 5000

BERTAMBAH

0,4

0,4
100

300

600

2000

7000

2000

7000

[R4] IF Permintaan NAIK and Persediaan SEDIKIT THEN Produksi BERTAMBAH.


m(x)

m(y)
NAIK

m(z)
BERTAMBAH

SEDIKIT

1
0,75

1
0,6

BERTAMBAH

0,6

1000

4000 5000

100

300

600

2000

7000

2000

Komposisi antar aturan


m(z)
1
0,6
0,25

A2

A1
0

a1

A3
a2

(a1 2000)/5000 = 0,25 a1 = 3.250


(a2 2000)/5000 = 0,60 a2 = 5.000
Dengan demikian, fungsi keanggotaan untuk hasil komposisi ini adalah:
0,25
; z 3250
=
(z 2000) / 5000 ; 3250 z 5000
0,6
; z 5000
3250
M1 = 0
0,25 z dz = 0,125z 2 3250
= 1320312,5
0
M2 =
M3 =

5000 z2000
3250 5000

7000
5000

z dz =

5000
3250

0,6 z dz = 0,3z 2

0,0002z 2 0,4z dz = 0,000067z 3 0,2z 2


7000
5000

5000
3250

= 3187515,625

= 7200000

Luas setiap daerah:


A1 = 3250 * 0,25 = 812,5
A2 = (5000 3250) * (0,25 + 0,6) / 2 = 743,75
A3 = (7000 5000) * 0,6 = 1.200
Titik pusat dapat diperoleh
1320312 ,5+3187515 ,625+7200000
z* =
= 4247,74
812,5+743,75+1200
Jadi jumlah makanan kaleng jenis ABC yang harus diproduksi sebanyak 4248 kemasan.

7000

Anda mungkin juga menyukai