Fuzzy Logic
Properties & Operations
CE 415
ARTIFICIAL INTELLIGENCE
COMPUTER ENGINEERING DEPARTMENT
Contents
 Characteristics of Fuzzy Sets
 Operations
 Properties
 Fuzzy Rules
 Examples
3
Characteristics of Fuzzy Sets
 The classical set theory developed in the late 19th century by George
Cantor describes how crisp sets can interact. These interactions are
called operations.
 Also fuzzy sets have well defined properties.
 These properties and operations are the basis on which the fuzzy sets
are used to deal with uncertainty on the one hand and to represent
knowledge on the other.
 A fuzzy set A in X is characterized by a membership function μA (x)
which associates with each point in X a real number in the interval [0, 1],
with the values of μA (x) at x representing the grade of membership of x
in A.
 fuzzy set A = {x1, x2, x3, x4} in X characterized by the membership
function μA(x) which maps each point x in X to real values 0.5, 1, 0.75
and 0.5. A = {x,μA(x) | x ∈ X}
4
Characteristics of Fuzzy Sets
5
Note: Membership Functions
 For the sake of convenience, usually a fuzzy set is denoted
as:
A = A(xi)/xi + …………. + A(xn)/xn
where A(xi)/xi (a singleton) is a pair “grade of membership”
element, that belongs to a finite universe of discourse:
A = {x1, x2, .., xn}
6
7
Membership Functions
8
Membership function
 There is no strict rule for defining a membership function. . Most
widely used MFs in the fuzzy logic literature are triangular,
trapezoidal, Gaussian and bell-shaped functions.
 Triangle membership function:
 The parameters {a, b, c} with a < b < c determine the x coordinates
of the three corners of the underlying triangular MF. Triangular MFs
can be asymmetric, depending on the relations a ≤ b and b ≤ c.
9
Triangular Membership
function
10
Trapezoidal membership
function
 A trapezoidal MF is specified by four parameters {a, b, c, d}
 The parameters {a, b, c, d} with a < b < c < d determine the x
coordinates of the four corners of the underlying trapezoidal
MF. Trapezoidal MFs can be asymmetric, depending on the
relations a ≤ b and c ≤ d.
11
Trapezoidal membership
function
12
Gaussian MF
 A Gaussian MF is specified by two parameters {m, σ}
 The parameters m and σ represent the centre and width of the
Gaussian MF, respectively
13
Bell-shaped MF
 A bell-shaped MF is specified by three parameters {m, σ, a}
 The parameters m and σ represent the centre and width of the bell-
shaped MF, respectively. Parameter a, usually positive, controls the
slope of the MF
14
Sigmoidal MF
 Gaussian and bell-shaped MFs
are smooth and symmetric MFs.
A sigmoidal MF is asymmetric
and is either open left or right.
 The parameter a controls the
slope of the MF at the cross-
point x = c.
15
Operations of Fuzzy Sets
Intersection Union
Complement
Not A
A
Containment
A
A
B
B
A B
A
A B
16
Complement
 Crisp Sets: Who does not belong to the set?
 Fuzzy Sets: How much do elements not belong to the set?
 The complement of a set is an opposite of this set. For example, if
we have the set of tall men, its complement is the set of NOT tall
men. When we remove the tall men set from the universe of
discourse, we obtain the complement.
 If A is the fuzzy set, its complement can be found as follows:
17
Complement
18
19
Example
•Given a fuzzy set of tall men
Tall men = (0/180, 0.25/182.5, 0.5/185,
0.75/187.5, 1/190)
•Calculate the fuzzy set of NOT tall men
Solution:
NOT tall men( calculate)9
Containment
 Crisp Sets: Which sets belong to which other sets?
 Fuzzy Sets: Which sets belong to other sets?
 Similar to a Chinese box, a set can contain other sets. The smaller set is
called the subset. For example, the set of tall men contains all tall men;
very tall men is a subset of tall men. However, the tall men set is just a
subset of the set of men. In crisp sets, all elements of a subset entirely
belong to a larger set. In fuzzy sets, however, each element can belong
less to the subset than to the larger set. Elements of the fuzzy subset have
smaller memberships in it than in the larger set.
 Let A and B be two fuzzy sets with membership functions μA
 and μB, respectively. A is a subset of B (or A is contained in B), written
A B, if and only if
20
21
Example
•Given a fuzzy set of tall men
Tall men = (0/180, 0.25/182.5, 0.5/185, 0.75/187.5, 1/190)
Very tall men
(0/180, 0.06/182.5, 0.25/185, 0.56/187.5, 1/190)
Intersection
 Crisp Sets: Which element belongs to both sets?
 Fuzzy Sets: How much of the element is in both sets?
 In classical set theory, an intersection between two sets contains the elements
shared by these sets. For example, the intersection of the set of tall men and
the set of fat men is the area where these sets overlap. In fuzzy sets, an
element may partly belong to both sets with different memberships.
 A fuzzy intersection is the lower membership in both sets of each element. The
fuzzy intersection of two fuzzy sets A and B on universe of discourse X:
AB(x) = min [A(x), B(x)] = A(x)  B(x),
where xX
22
Intersection
23
Union
 Crisp Sets: Which element belongs to either set?
 Fuzzy Sets: How much of the element is in either set?
 The union of two crisp sets consists of every element that falls into either set.
For example, the union of tall men and fat men contains all men who are tall
OR fat.
 In fuzzy sets, the union is the reverse of the intersection. That is, the union is the
largest membership value of the element in either set. The fuzzy operation for
forming the union of two fuzzy sets A and B on universe X can be given as:
AB(x) = max [A(x), B(x)] = A(x)  B(x),
where xX
24
Union
25
Operations of Fuzzy Sets
Complement
0
x
1
(x)
0
x
1
Containment
0
x
1
0
x
1
A B
Not A
A
Intersection
0
x
1
0
x
A B
Union
0
1
A B

A B

0
x
1
0
x
1
B
A
B
A
(x)
(x) (x)
26
27
Example
Properties of Fuzzy Sets
 Equality of two fuzzy sets
 Inclusion of one set into another fuzzy set
 Cardinality of a fuzzy set
 An empty fuzzy set
 -cuts (alpha-cuts)
28
Equality
 Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF (iff):
A(x) = B(x), xX
A = 0.3/1 + 0.5/2 + 1/3
B = 0.3/1 + 0.5/2 + 1/3
therefore A = B
29
Inclusion
 Inclusion of one fuzzy set into another fuzzy set. Fuzzy set A  X is
included in (is a subset of) another fuzzy set, B  X:
A(x)  B(x), xX
Consider X = {1, 2, 3} and sets A and B
A = 0.3/1 + 0.5/2 + 1/3;
B = 0.5/1 + 0.55/2 + 1/3
then A is a subset of B, or A  B
30
Cardinality
 Cardinality of a non-fuzzy set, Z, is the number of elements in Z. BUT the cardinality of
a fuzzy set A, the so-called SIGMA COUNT, is expressed as a SUM of the values of the
membership function of A, A(x):
cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n
Consider X = {1, 2, 3} and sets A and B
A = 0.3/1 + 0.5/2 + 1/3;
B = 0.5/1 + 0.55/2 + 1/3
cardA = 1.8
cardB = 2.05
31
Empty Fuzzy Set
 A fuzzy set A is empty, IF AND ONLY IF:
A(x) = 0, xX
Consider X = {1, 2, 3} and set A
A = 0/1 + 0/2 + 0/3
then A is empty
32
Alpha-cut
 The α-cut of a fuzzy set A, denoted Aα, is a subset of X consisting
of all the elements in X defined by A  X, such that:
 This means that the fuzzy set Aα contains all elements with a
membership of α [0
∈ , 1] and
 higher, called the α-cut of the membership function
33
34
Fuzzy Set Normality
 A fuzzy subset of X is called normal if there exists at least one element
xX such that A(x) = 1.
 A fuzzy subset that is not normal is called subnormal.
 All crisp subsets except for the null set are normal. In fuzzy set theory,
the concept of nullness essentially generalises to subnormality.
 The height of a fuzzy subset A is the large membership grade of an
element in A
height(A) = maxx(A(x))
35
Fuzzy Sets Core and Support
 Assume A is a fuzzy subset of X:
 the support of A is the crisp subset of X consisting of all elements
with membership grade:
supp(A) = {x A(x)  0 and xX}
 the core of A is the crisp subset of X consisting of all elements with
membership grade:
core(A) = {x A(x) = 1 and xX}
36
Singleton
 A fuzzy set whose support is a single point in X at which μA(x) = 1 is
called a singleton
37
Crossover Point
 A crossover point of a fuzzy set A is a point x ∈ X at which μA(x) = α with α
[0
∈ , 1]:
 The crossover point of the membership function A with B is at 0.5. In other words, it
is the overlap of two neighboring membership functions.
 A triangular MF has three features by which it can be parameterized: the peak, left
width
 and right width. These are the anchor points of the three corners of a triangular MF
38
DeMorgan Law
 Any fuzzy set A∼ defined on a universe x is a subset of that
universe. The membership value of any element x in the null set φ
is 0, and the membership value of any element x in the whole set
x is 1. This statement is given by
 De Morgan’s laws stated for classical sets also hold for fuzzy sets,
as denoted by these expressions.
39
Properties of Fuzzy Sets
40
Properties of Fuzzy Sets
41
Properties of Fuzzy Sets
42
Properties of Fuzzy Sets
43
Properties of Fuzzy Sets
44
45
46
47
48
49
50
Exercises
For
A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}
B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}
Then, calculate the following:
- Support, Core, Cardinality, and Complement for A and B
independently
- Union and Intersection of A and B
- the new set C, if C = A2
- the new set D, if D = 0.5B
- the new set E, for an alpha cut at A0.5
51
Solutions
A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}
B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}
Support
Supp(A) = {a, b, c, d}
Supp(B) = {b, c, d, e}
Core
Core(A) = {c}
Core(B) = {}
Cardinality
Card(A) = 0.2 + 0.4 + 1 + 0.8 + 0 = 2.4
Card(B) = 0 + 0.9 + 0.3 + 0.2 + 0.1 = 1.5
Complement
Comp(A) = {0.8/a, 0.6/b, 0/c, 0.2/d, 1/e}
Comp(B) = {1/a, 0.1/b, 0.7/c, 0.8/d, 0.9/e}
52
Solutions
A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}
B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}
Union
AB = {0.2/a, 0.9/b, 1/c, 0.8/d, 0.1/e}
Intersection
AB = {0/a, 0.4/b, 0.3/c, 0.2/d, 0/e}
C=A2
C = {0.04/a, 0.16/b, 1/c, 0.64/d, 0/e}
D = 0.5B
D = {0/a, 0.45/b, 0.15/c, 0.1/d, 0.05/e}
53
54
Example
 Consider a local area network (LAN) of
interconnected workstations that
communicate using Ethernet protocols at a
maximum rate of 10 Mbps (megabits per
second). Traffic rates on the network can be
expressed as the peak value of the total
bandwidth (BW) used, and two fuzzy sets,
“Quiet” and “Congested,” can be used to
describe the perceived.
 Data loading on the LAN. If the discrete
universal set X = {0, 1, 2, 5, 7, 9, 10}
represents BW usage, in Mbps, then the
membership functions of the fuzzy sets
Quiet (∼Q) and Congested (∼C) are shown
in Figure P2.7.
 For these fuzzy sets graphically find union,
intersection, complement of each and
difference.

AI415-Lecture08-Fuzzy_Properties and Ops.pptx

  • 1.
  • 2.
  • 3.
    Contents  Characteristics ofFuzzy Sets  Operations  Properties  Fuzzy Rules  Examples 3
  • 4.
    Characteristics of FuzzySets  The classical set theory developed in the late 19th century by George Cantor describes how crisp sets can interact. These interactions are called operations.  Also fuzzy sets have well defined properties.  These properties and operations are the basis on which the fuzzy sets are used to deal with uncertainty on the one hand and to represent knowledge on the other.  A fuzzy set A in X is characterized by a membership function μA (x) which associates with each point in X a real number in the interval [0, 1], with the values of μA (x) at x representing the grade of membership of x in A.  fuzzy set A = {x1, x2, x3, x4} in X characterized by the membership function μA(x) which maps each point x in X to real values 0.5, 1, 0.75 and 0.5. A = {x,μA(x) | x ∈ X} 4
  • 5.
  • 6.
    Note: Membership Functions For the sake of convenience, usually a fuzzy set is denoted as: A = A(xi)/xi + …………. + A(xn)/xn where A(xi)/xi (a singleton) is a pair “grade of membership” element, that belongs to a finite universe of discourse: A = {x1, x2, .., xn} 6
  • 7.
  • 8.
  • 9.
    Membership function  Thereis no strict rule for defining a membership function. . Most widely used MFs in the fuzzy logic literature are triangular, trapezoidal, Gaussian and bell-shaped functions.  Triangle membership function:  The parameters {a, b, c} with a < b < c determine the x coordinates of the three corners of the underlying triangular MF. Triangular MFs can be asymmetric, depending on the relations a ≤ b and b ≤ c. 9
  • 10.
  • 11.
    Trapezoidal membership function  Atrapezoidal MF is specified by four parameters {a, b, c, d}  The parameters {a, b, c, d} with a < b < c < d determine the x coordinates of the four corners of the underlying trapezoidal MF. Trapezoidal MFs can be asymmetric, depending on the relations a ≤ b and c ≤ d. 11
  • 12.
  • 13.
    Gaussian MF  AGaussian MF is specified by two parameters {m, σ}  The parameters m and σ represent the centre and width of the Gaussian MF, respectively 13
  • 14.
    Bell-shaped MF  Abell-shaped MF is specified by three parameters {m, σ, a}  The parameters m and σ represent the centre and width of the bell- shaped MF, respectively. Parameter a, usually positive, controls the slope of the MF 14
  • 15.
    Sigmoidal MF  Gaussianand bell-shaped MFs are smooth and symmetric MFs. A sigmoidal MF is asymmetric and is either open left or right.  The parameter a controls the slope of the MF at the cross- point x = c. 15
  • 16.
    Operations of FuzzySets Intersection Union Complement Not A A Containment A A B B A B A A B 16
  • 17.
    Complement  Crisp Sets:Who does not belong to the set?  Fuzzy Sets: How much do elements not belong to the set?  The complement of a set is an opposite of this set. For example, if we have the set of tall men, its complement is the set of NOT tall men. When we remove the tall men set from the universe of discourse, we obtain the complement.  If A is the fuzzy set, its complement can be found as follows: 17
  • 18.
  • 19.
    19 Example •Given a fuzzyset of tall men Tall men = (0/180, 0.25/182.5, 0.5/185, 0.75/187.5, 1/190) •Calculate the fuzzy set of NOT tall men Solution: NOT tall men( calculate)9
  • 20.
    Containment  Crisp Sets:Which sets belong to which other sets?  Fuzzy Sets: Which sets belong to other sets?  Similar to a Chinese box, a set can contain other sets. The smaller set is called the subset. For example, the set of tall men contains all tall men; very tall men is a subset of tall men. However, the tall men set is just a subset of the set of men. In crisp sets, all elements of a subset entirely belong to a larger set. In fuzzy sets, however, each element can belong less to the subset than to the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set.  Let A and B be two fuzzy sets with membership functions μA  and μB, respectively. A is a subset of B (or A is contained in B), written A B, if and only if 20
  • 21.
    21 Example •Given a fuzzyset of tall men Tall men = (0/180, 0.25/182.5, 0.5/185, 0.75/187.5, 1/190) Very tall men (0/180, 0.06/182.5, 0.25/185, 0.56/187.5, 1/190)
  • 22.
    Intersection  Crisp Sets:Which element belongs to both sets?  Fuzzy Sets: How much of the element is in both sets?  In classical set theory, an intersection between two sets contains the elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships.  A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X: AB(x) = min [A(x), B(x)] = A(x)  B(x), where xX 22
  • 23.
  • 24.
    Union  Crisp Sets:Which element belongs to either set?  Fuzzy Sets: How much of the element is in either set?  The union of two crisp sets consists of every element that falls into either set. For example, the union of tall men and fat men contains all men who are tall OR fat.  In fuzzy sets, the union is the reverse of the intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as: AB(x) = max [A(x), B(x)] = A(x)  B(x), where xX 24
  • 25.
  • 26.
    Operations of FuzzySets Complement 0 x 1 (x) 0 x 1 Containment 0 x 1 0 x 1 A B Not A A Intersection 0 x 1 0 x A B Union 0 1 A B  A B  0 x 1 0 x 1 B A B A (x) (x) (x) 26
  • 27.
  • 28.
    Properties of FuzzySets  Equality of two fuzzy sets  Inclusion of one set into another fuzzy set  Cardinality of a fuzzy set  An empty fuzzy set  -cuts (alpha-cuts) 28
  • 29.
    Equality  Fuzzy setA is considered equal to a fuzzy set B, IF AND ONLY IF (iff): A(x) = B(x), xX A = 0.3/1 + 0.5/2 + 1/3 B = 0.3/1 + 0.5/2 + 1/3 therefore A = B 29
  • 30.
    Inclusion  Inclusion ofone fuzzy set into another fuzzy set. Fuzzy set A  X is included in (is a subset of) another fuzzy set, B  X: A(x)  B(x), xX Consider X = {1, 2, 3} and sets A and B A = 0.3/1 + 0.5/2 + 1/3; B = 0.5/1 + 0.55/2 + 1/3 then A is a subset of B, or A  B 30
  • 31.
    Cardinality  Cardinality ofa non-fuzzy set, Z, is the number of elements in Z. BUT the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is expressed as a SUM of the values of the membership function of A, A(x): cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n Consider X = {1, 2, 3} and sets A and B A = 0.3/1 + 0.5/2 + 1/3; B = 0.5/1 + 0.55/2 + 1/3 cardA = 1.8 cardB = 2.05 31
  • 32.
    Empty Fuzzy Set A fuzzy set A is empty, IF AND ONLY IF: A(x) = 0, xX Consider X = {1, 2, 3} and set A A = 0/1 + 0/2 + 0/3 then A is empty 32
  • 33.
    Alpha-cut  The α-cutof a fuzzy set A, denoted Aα, is a subset of X consisting of all the elements in X defined by A  X, such that:  This means that the fuzzy set Aα contains all elements with a membership of α [0 ∈ , 1] and  higher, called the α-cut of the membership function 33
  • 34.
  • 35.
    Fuzzy Set Normality A fuzzy subset of X is called normal if there exists at least one element xX such that A(x) = 1.  A fuzzy subset that is not normal is called subnormal.  All crisp subsets except for the null set are normal. In fuzzy set theory, the concept of nullness essentially generalises to subnormality.  The height of a fuzzy subset A is the large membership grade of an element in A height(A) = maxx(A(x)) 35
  • 36.
    Fuzzy Sets Coreand Support  Assume A is a fuzzy subset of X:  the support of A is the crisp subset of X consisting of all elements with membership grade: supp(A) = {x A(x)  0 and xX}  the core of A is the crisp subset of X consisting of all elements with membership grade: core(A) = {x A(x) = 1 and xX} 36
  • 37.
    Singleton  A fuzzyset whose support is a single point in X at which μA(x) = 1 is called a singleton 37
  • 38.
    Crossover Point  Acrossover point of a fuzzy set A is a point x ∈ X at which μA(x) = α with α [0 ∈ , 1]:  The crossover point of the membership function A with B is at 0.5. In other words, it is the overlap of two neighboring membership functions.  A triangular MF has three features by which it can be parameterized: the peak, left width  and right width. These are the anchor points of the three corners of a triangular MF 38
  • 39.
    DeMorgan Law  Anyfuzzy set A∼ defined on a universe x is a subset of that universe. The membership value of any element x in the null set φ is 0, and the membership value of any element x in the whole set x is 1. This statement is given by  De Morgan’s laws stated for classical sets also hold for fuzzy sets, as denoted by these expressions. 39
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
    Exercises For A = {0.2/a,0.4/b, 1/c, 0.8/d, 0/e} B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e} Then, calculate the following: - Support, Core, Cardinality, and Complement for A and B independently - Union and Intersection of A and B - the new set C, if C = A2 - the new set D, if D = 0.5B - the new set E, for an alpha cut at A0.5 51
  • 52.
    Solutions A = {0.2/a,0.4/b, 1/c, 0.8/d, 0/e} B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e} Support Supp(A) = {a, b, c, d} Supp(B) = {b, c, d, e} Core Core(A) = {c} Core(B) = {} Cardinality Card(A) = 0.2 + 0.4 + 1 + 0.8 + 0 = 2.4 Card(B) = 0 + 0.9 + 0.3 + 0.2 + 0.1 = 1.5 Complement Comp(A) = {0.8/a, 0.6/b, 0/c, 0.2/d, 1/e} Comp(B) = {1/a, 0.1/b, 0.7/c, 0.8/d, 0.9/e} 52
  • 53.
    Solutions A = {0.2/a,0.4/b, 1/c, 0.8/d, 0/e} B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e} Union AB = {0.2/a, 0.9/b, 1/c, 0.8/d, 0.1/e} Intersection AB = {0/a, 0.4/b, 0.3/c, 0.2/d, 0/e} C=A2 C = {0.04/a, 0.16/b, 1/c, 0.64/d, 0/e} D = 0.5B D = {0/a, 0.45/b, 0.15/c, 0.1/d, 0.05/e} 53
  • 54.
    54 Example  Consider alocal area network (LAN) of interconnected workstations that communicate using Ethernet protocols at a maximum rate of 10 Mbps (megabits per second). Traffic rates on the network can be expressed as the peak value of the total bandwidth (BW) used, and two fuzzy sets, “Quiet” and “Congested,” can be used to describe the perceived.  Data loading on the LAN. If the discrete universal set X = {0, 1, 2, 5, 7, 9, 10} represents BW usage, in Mbps, then the membership functions of the fuzzy sets Quiet (∼Q) and Congested (∼C) are shown in Figure P2.7.  For these fuzzy sets graphically find union, intersection, complement of each and difference.