Uploaded by Zohaib Ahmed

AI-Lecture - 11-FL (2)

advertisement
1
2
Introduction to Fuzzy Sets
 In a crisp / classical set, an element from the
universal set is either absent or present.
 There is no in-between situation such as “partially present”.
 But, in a fuzzy set, every element from the
universe of discourse is present with a degree of
membership in the range [0.0, 1.0].
 The degree of membership is denoted by μ.
 If μ = 0.0, the element is said to be “absent”.
 If μ = 1.0, the element is said to be “completely present”.
 If 0.0 < μ < 1.0, the element is said to be “partially present”.
 The more the membership value, the more the
element belongs to the fuzzy set.
3
Definition of a Fuzzy Set
 A fuzzy set, A, defined on a universe of
discourse, Z, may be written as a collection of
ordered pairs:
A   z,  A ( z)  , z  Z 
where z is a particular element of Z and μA(z)
is its membership value.
 Note
 A crisp set can be considered as a special case of a fuzzy
set, in which μ is either 0 or 1.
4
Definition of a Fuzzy Set (contd.)
 Example
 Let Z = {g1, g2 , g3 , g4 , g5} be a fuzzy reference set of
students (i.e., universe of discourse)

It is understood that every element in a universe of discourse
has membership value of 1).
 On the universe of discourse Z, set A is a fuzzy set of
“smart” students, as:
A  ( g1 ,0.4),( g2 ,0.5),( g3 ,1.0),( g4 ,0.9),( g5 ,0.8)
5
Membership Function (MF)
 It is a curve that defines how each element, z,
in a fuzzy set is mapped to a membership
value, μ, in the range [0, 1].
 It defines a fuzzy set, completely.
 Example
 Consider a fuzzy set of “tall” people…
 We can have any shape of its membership function…

From sharp-edged (2-valued) to continuous (multi-valued).
6
Sharp Membership Function
7
Continuous Membership Function
 This curve defines the transition from “not tall” to
“tall”.
 Both people are considered tall
 …but one is considered significantly less tall than the other.
8
Another Example…
 Consider a fuzzy set of “weekend-ness”…
 Saturday and Sunday
 Definitely included in a weekend!
 What about Friday?
 Some people / nations think it partially included in it.
 Classical (2-valued) membership cannot facilitate this thinking…
 …but a fuzzy (multi-valued) membership can.
9
Empty Fuzzy Set
 A fuzzy set is empty, if its MF is identically
zero for all z belonging to the universe of
discourse (Z).
 Example
 A = {(z1,0), (z2, 0), (z3,0),…} = { }
10
Basic Fuzzy Set Operations
 The basic fuzzy set operations are:
 Union
 Intersection
 Complement
 Product
 Equality
 Product of Fuzzy Set with Crisp Number
 Power
 Difference
 Disjunctive Sum
11
Union of Fuzzy Sets
 The union of two fuzzy sets A and B on a
universe of discourse Z is a new fuzzy set C on
Z with a membership function defined as:
C ( z)   A B ( z)  max[  A ( z), B ( z)]
12
Example
 Z: Universe of discourse

Age of people
 A: Fuzzy set of young people in Z, as:

A = {(10, 1), (20, 1), (30, 0.5), (40, 0) , (50, 0), (60, 0)},
 B: Fuzzy set of middle-aged people in Z, as:

B = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 0.5), (60, 0)}
 Then, C = A U B in Z is:

C = {(10, 1), (20, 1), (30, 0.5), (40, 1), (50, 0.5), (60, 0)}
13
Intersection of Fuzzy Sets
 The intersection of two fuzzy sets A and B on a
universe of discourse Z is a new fuzzy set C on
Z with a membership function defined as:
C ( z)   AB ( z)  min[  A ( z), B ( z)]
14
Example
 Z: Universe of discourse

Age of people
 A: Fuzzy set of young people in Z, as:

A = {(10, 1.0), (20, 1), (30, 0.5), (40, 0) , (50, 0), (60, 0)},
 B: Fuzzy set of middle-aged people in Z, as:

B = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 0.5), (60, 0)}
 Then, C = A ∩ B in Z is:


C = {(10, 0), (20, 0), (30, 0.5), (40, 0), (50, 0), (60, 0)}
= {(30, 0.5)} (A singleton fuzzy set!)
15
Complement of a Fuzzy Set
 The complement of a fuzzy set A, denoted by Ā
or Ac, on a universe of discourse Z is a set, of
which membership function is μĀ (z) = 1 - μA(z)
for all z belonging to Z.
 Example:
 Z: Universe of discourse
 Age of people
 A: Fuzzy set of young people in Z, as:
 A = {(10, 1), (20, 1), (30, 0.5), (40, 0) , (50, 0), (60, 0)},
 Then, Ā is the fuzzy set of not-young people in Z, as:
 Ā = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 1), (60, 1)}
16
Effect of Union, Complement, &
Intersection on Fuzzy Sets
17
Equality of Fuzzy Sets
 Two fuzzy sets A and B on a universe of
discourse Z are equal (i.e., A = B), if μA(z) =
μB(z) for all z belonging to Z.
 Example
 Let:
 A = {(z1, 0.2), (z2, 0.8)}
 B = {(z1, 0.6), (z2, 0.8)}
 C = {(z1, 0.2), (z2, 0.8)}
 D = {(z1, 0.2), (z2, 0.8), (z3, 0)}
 Then,
 A = C = D, A≠B.
18
Product of Fuzzy Sets
 Product of two fuzzy sets A and B on a universe
of discourse Z is a new fuzzy set C with the MF
defined as:
μC(z) = μA(z) . μB(z)
 Example
 Let


A = {(z1, 0.2), (z2, 0.8), (z3, 0.4)}
B = {(z1, 0.4), (z2, 0), (z3, 0.1)}
 Then,

C = A . B = {(z1, 0.08), (z2, 0), (z3, 0.04)}
19
Product of a Fuzzy Set with a Crisp
Number
 Multiplying a fuzzy set A on a universe of
discourse Z by a crisp number α results in a
fuzzy set B with the MF defined as:
μB(z) = α . μA(z)
 Example
 Let
 A = {(z1, 0.4), (z2, 0.6), (z3, 0.8)}
 α = 0.3
 Then,
 B = α. A = {(z1, 0.12), (z2, 0.18), (z3, 0.24)}
20
Power of a Fuzzy Set
 The power of a fuzzy set A on a universe of
discourse Z is a new fuzzy set B of which MF is
given by:
μB(z) = [μA(z)]α
 Raising a fuzzy set to its 2nd power is called
concentration (CON).
 Taking a square root (i.e., raising to ½ power)
of a fuzzy set is called dilation (DIL).
21
Difference of Fuzzy Sets
 The difference of two fuzzy sets A and B on a
universe of discourse Z is a new fuzzy set C,
defined as:
C = A – B = A ∩ Bc
 Example
 Let
 A = {(z1,0.2), (z2, 0.5), (z3, 0.6)}
 B = {(z1,0.1), (z2, 0.4), (z3, 0.5)}
 Then,
 Bc = {(z1,0.9), (z2, 0.6), (z3, 0.5)}, and
 C = A – B = A ∩ Bc = {(z1,0.2), (z2, 0.5), (z3, 0.5)}
22
Disjunctive Sum of Fuzzy Sets
 The disjunctive sum of two fuzzy sets A and B
on a universe of discourse Z is a new fuzzy set
C defined as:
C  A  B   Ac
B
c
A
B


 Exercise 10
 Let


A = {(z1, 0.4), (z2, 0.8), (z3, 0.6)},
B = {(z1, 0.2), (z2, 0.6), (z3, 0.9)}
 Determine the disjunctive sum of A and B.
23
Solution to Exercise 10
 We have:
A = {(z1, 0.4), (z2, 0.8), (z3, 0.6)},
B = {(z1, 0.2), (z2, 0.6), (z3, 0.9)}
 Then,
Ac = {(z1, 0.6), (z2, 0.2), (z3, 0.4)}
Bc = {(z1, 0.8), (z2, 0.4), (z3, 0.1)}
Ac ∩ B = {(z1, 0.2), (z2, 0.2), (z3, 0.4)}
A ∩ Bc = {(z1, 0.4), (z2, 0.4), (z3, 0.1)}
Therefore, the disjunctive sum of A and B is C, as:
C = (Ac ∩ B) U (A ∩ Bc) = {(z1, 0.4), (z2, 0.4), (z3, 0.4)}
24
Properties of Fuzzy Sets
 Any fuzzy set is a subset of a reference set
(universe of discourse) Z.
 The degree of membership of any element
belonging to null (empty) set is 0.
 The degree of membership of any element
belonging to reference set (universe of
discourse) is 1.
25
Properties of Fuzzy Sets (contd.)
 Commutativity:
 AUB=BUA
 A∩B=B∩A
 Associativity
 (A U B) U C = A U (B U C)
 (A ∩ B) ∩ C = A ∩ (B ∩ C)
 Distributivity
 A U (B ∩ C) = (A U B) ∩ (A U C)
 A ∩ (B U C) = (A ∩ B) U (A ∩ C)
26
Properties of Fuzzy Sets (contd.)
 Idempotence
 AUA=A
 A∩A=A
 Identity
 AUØ=A
 A∩Z=A
 Involution
 (Ac)c = A
 Transitivity
 If A  B and B  C , then A  C.
27
Example
 A∩Z=A
 Let Z= {q1,q2,q3}
 Z= {(q1,1),(q2,1),(q3,1)}
 A={(q1,0.5), (q1,0.2), (q1,1.0)}
 A ∩ Z = {(q1,0.5), (q1,0.2), (q1,1)} = A
28
Properties of Fuzzy Sets (contd.)
 Absorption by Z and Ø
 AUZ=Z
 A∩Ø=Ø
 De Morgan’s Laws
 (A U B)c = Ac ∩ Bc
 (A ∩ B)c = Ac U Bc
 Since fuzzy sets can overlap, the laws of
excluded middle do not hold good.
 A U Ac ≠ Z
 A ∩ Ac ≠ Ø
29
Exercise 11
 Suppose Is and Fs are two fuzzy sets defined on
the universe of discourse Z:
 Z = {(F, 1), (E, 1), (X, 1), (Y, 1), (I, 1), (T, 1)}
 Is = {(F, 0.4), (E, 0.3), (X, 0.1), (Y, 0.1), (I, 0.9), (T, 0.8)}
 Fs = {(F, 0.99), (E, 0.8), (X, 0.1), (Y, 0.2), (I, 0.5), (T, 0.5)}
 Verify that:
 Fs U Fs c ≠ Z
 Is ∩ Is c ≠ Ø
 (Is U Fs)c = Is c ∩ Fs c
30
Exercise 12
 Suppose the universe of discourse, Z, is defined
on the interval [0.0, 5.0].
 Let the MFs of two fuzzy sets A and B on Z be:
 μA(z) = z / (z+1), and μB(z) = 2-z
 Then, determine the MFs of the following fuzzy
sets and draw their graphs.
 Ac
 Bc
 AUB
 A∩B
 (A ∩ B)c
31
32
Cartesian Product
 The Cartesian product of two crisp sets A and
B denoted by A × B is the set of all ordered
pairs such that 1st element in the pair belongs
to A and 2nd element in the pair belongs to B.
 That is:
A  B  (a, b) | a  A, b  B
 If A ≠ B and A and B are non-empty, then:
A×B≠B×A
33
Cartesian Product (contd.)
 The Cartesian product can be extended to n
number of sets:
n
 Ai  (a1 , a2 , a3 ,..., an ) | ai  Ai for every i  1, 2,..., n
i 1
n
n
Cardinality of the Product =  Ai   Ai
i 1
i 1
34
Example
 Given:
 A1 = {a, b}
 A2 = {1, 2}
 A3 = {α}
 Then:
 A1 × A2 = {(a, 1), (a, 2), (b, 1), (b, 2)}
 | A1 × A2| = 4.
 Note: | A1 × A2| = |A1|.|A2|
 A1 × A2 × A3 = {(a, 1, α), (a, 2, α), (b, 1, α), (b, 2, α)}
 | A1 × A2 × A3| = 4.
 Note: | A1 × A2 × A3| = |A1|.|A2|.|A3|
35
n-ary Relation
 An n-ary relation denoted as R(X1, X2, …, Xn) among
crisp sets X1, X2, …, Xn is a subset of the Cartesian
product X1 × X2 ×… × Xn.
 It is an indicative of an association or relation among
the tuple elements.
 If n = 2
 The relation R(X1, X2) is called binary relation.
 If n = 3
 The relation R(X1, X2, X3) is called ternary relation.
 If n = 4
 The relation R(X1, X2, X3, X4) is called quarternary relation.
 If n = 5
 The relation R(X1, X2, X3, X4, X5) is called quinary relation.
36
n-ary Relation (contd.)
 If the universe of discourse or sets are finite,
the n-ary expression can be expressed as an ndimensional relation matrix.
 Thus, for a binary relation R(X, Y) where X =
{x1, x2, …, xn} and Y = {y1, y2, …, ym}:
 The relation matrix R is a 2-D matrix where X represents
the rows and Y the columns.
 R(i, j) = 1, if (xi, yi) belongs to R.
 R(i, j) = 0, if (xi, yi) does not belong to R.
37
Example
 Given X = {1, 2, 3, 4}, determine the
relation matrix, if the relation is
defined as: R  ( x, y) | y  x  1, x, y  X 
 Solution:
 X × X = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2,
2), (2, 3), (2, 4), (3, 1), (3, 2), (3, 3), (3, 4),
(4, 1), (4, 2), (4, 3), (4, 4)}
 R = {(1, 2), (2, 3), (3, 4)}.
 Therefore, considering 1st value as row and
2nd value as column, and 1 as presence of a R 
pair in the R set and 0 as its absence, we
have the relation matrix as:
1
1
2
3
4
0
0

0

0
2
3
4
1 0 0
0 1 0 
0 0 1

0 0 0
38
Fuzzy Logic Progress
 Introduction
 Crisp / Classical Set Theory
 Fuzzy Set Theory
 Crisp Relations
 Fuzzy Relations
 Crisp Logic
 Fuzzy Logic
 Fuzzy Inference System (FIS)
39
Download