Editor:
MULYANTO
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
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
p ^ p = 0
pvp=1
A Ac =
A Ac = X(S)
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) =
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
()
0,
x<a
ax<b
1,
xb
1,
x<a
ax<b
xb
A (x) =
0,
a
y = e-x2
0
0
A (x) = x + 1
1x
-1
, x <-1 atau x 1
, -1 x < 0
,0x<1
AB
AB
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
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
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
0,8
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
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
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
[ 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
(,,)
, [ 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, +
14
Relasi Fuzzy
Relasi : cara mengkawankan
1
(1,)
+ (3,) + (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
1
1
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
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
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
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
21
1
0,8
= 0,4
0,2
0,8
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
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
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
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
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
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
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
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
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
Slow (S)
Medium (M)
35
55
Fast (F)
75
Vmax
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
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,,
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
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
tEP (a, b) = 2 +
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
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:
=
, ,
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
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
C (z1) =
0.04,0.9 , 0.25,0.9 , 0.64,0.9
C (z2) =
0.04,0.6 , 0.25,0.6 , 0.64,0.6
C (z3) =
0.04,0.5 , 0.25,0.5 , 0.64,0.4
A (x2) =
0.81,0.6 , 0.36,0.6 , 0.09,0.6
A (x3) =
0.81,0.5 , 0.36,0.5 , 0.09,0.4
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
B (y) =
,
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
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
+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
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
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)
=
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
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
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
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
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
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
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.
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
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
=
=1
=
=1
, ,
Union (Mamdani)
atau
=
, ,
Irisan (Godel)
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
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.8
52
= 0.8/1 + 0.4/2
2 =
= 0.4
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 ?
-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:
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
=
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
y = w1
w2
y1
y2
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
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
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
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
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)
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
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
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
A2
A1
0
a1
A3
a2
5000 z2000
3250 5000
7000
5000
z dz =
5000
3250
0,6 z dz = 0,3z 2
5000
3250
= 3187515,625
= 7200000
7000