No Slide Title

Download Report

Transcript No Slide Title

Fuzzy sets and Fuzzy Logic
( Reference: Fuzzy Sets, Uncertainty and Information
– George J. Klir & Tina A. Folger, Prentice Hall )
 In mid 60’s Zadeh developed the concept of ‘fuzzy sets’ to
account for numerous concepts used in human reasoning
which are vague and imprecise e.g. tall, old etc.
 Later he developed ‘fuzzy logic’ to account for the
imprecision of natural language quantities e.g. (many) and
statements (e.g. not very likely).
 Fuzzy set is very convenient method for representing
some form of uncertainty.
 The main idea behind Fuzzy systems is that truth values
(in fuzzy logic) or membership values are indicated by a
value in the range 0-1 with 0 for absolute falsity and 1 for
absolute truth.
 Fuzzy sets are often incorrectly assumed to indicate some
form of probability.
 Despite the fact that they can take on similar values, it is
important to realize that membership grades are not
probabilities as probabilities on a finite universal set must
add to 1 while there is no such requirement for membership
grades.
 Fuzzy set theory differs from conventional set theory as it
allows each element of a given set to belong to that set to
some degree.
 In contrast to classical set theory according to which each
element either fully belongs to the set or is completely
excluded from the set.
 In other words, classical set theory represents a limited
case of the more general fuzzy set theory.
 Elements in a fuzzy set X posses membership values
between 0 and 1.
 The degree to which an element belongs to given set is
called Grade of Membership.
Example: Represent “Helen is old” using probability
theory and fuzzy set. Assume that Helen’s age is 75
Probability approach:
We may assign the statement “Helen is old” the truth value
of 0.95.
Interpretation: There is 95% chance that Helen is old.
Fuzzy logic approach:
The statement could be translated into fuzzy set
terminology as follows:
 Helen is a member of the set of old people. It could be
expressed in symbolic notation of fuzzy set as OLD (Helen)
= 0.95 i.e., Helen’s degree of membership within the set of
old people = 0.95
Important distinction between fuzzy systems and
probability
 Although these two statements seem similar but they
actually carry different meanings.
First view: There are 5% chances that Helen may not be
old
Second view: There is no chance of Helen being young
and she is more or less old.
 Here OLD is a membership function operating on the
fuzzy set of old people (denoted by OLD) which return a
value between 0 and 1.
 Membership function OLD for the fuzzy set OLD is
represented by the following S-shaped graph
• Membership function for conventional set older than 50
years is represented as:
• Function for analytical approximation of a fuzzy
membership function is called S – function and is defined
as:
S(x, a, b, c) =
0,
for x  a
2[(x-a)2 / (c-a)2],
for a  x  b
1- 2[(x-a)2 / (c-a)2],
for b < x  c
1,
for x > c
where a, b, c are the parameters of the curve and b is mid
point.
• It can be used to represent the membership
function of fuzzy sets like OLD, TALL, RICH,
STRONG etc.
• If X (Universal set) is a collection (set) of objects
denoted by x, then a fuzzy set F in X is a set of
ordered pairs
F = { (x, F(x) ) | x  X}
where F(x) is the membership function of x
in F which maps x to the membership space [0,1].
• Grade of membership 1 is assigned to those
objects that fully and completely belong to F and 0
to those who do not belong to F at all.
Various Types of Membership Functions
• S-shaped function
• Trapezoidal membership function
• Gaussian membership function
• Exponential - like function
• Triangular membership function
•  membership function
Trapezoidal membership function
A(x) =
0
if x  a
(x - a) / (m - a)
if x  [a, m]
1
if x  [m, n]
(b - x) / (b - n)
if x  [n, b]
0
if x > b
Gaussian membership function
A(x) = e -k(x-m)2, where k > 0
Exponential - like function
A(x) = 1 / [1 + k(x - m)2], k > 1
or
A(x) = k(x - m)2 / {1 + k(x - m)2}
Triangular membership functions
0
if x  a
(x - a) / (m - a)
if x  [a, m]
(b - x) / (b - m)
if x  [m, b]
0
if x  b
A(x) =
 membership function
A(x)
0
if x  a
1 - e -k(x-a)2
if x > a
=
OR
A(x)
0
if x  a
k(x - a)2 / {1 + k(x - a)2}
if x > a
=
π function
 However, in order to represent the statement “x is close to
x0, where x0 is any fixed value of x”, we can build vicinity
function using S function as follows:
S(x, x0 – b, x – b/2, x0 ), for x  x0
V(x, b, x0 ) =
1-S(x, x0, x + b/2, x0 + b), for x  x0
 This is also called π function. Here ‘b’ is called
bandwidth.
 Total width of the function between two zero points is
equal to ‘2b’.
x0 –b
x0
x0 + b
 Three most basic operations that reshape π function are:
1. Dilation (DIL) : It increases the degree of membership of all
members by spreading out the curve. For example, DIL(OLD) =
more or less OLD. Its membership function is defined as: (A
(x)) 0.5
2.
Concentration (CON): It decreases the degree of
membership of all members. For example CONS(OLD) = very
OLD. Its membership function is defined as: (A (x)) 2
3. Normalization (NORM) : It discriminates all membership
degree in the same order unless maximum value of any member
is 1. Its membership function is defined as: A(x) / max (A(x)),
xX
 A fuzzy set is called normalized when at least one of its
elements attains the maximum possible membership grade
i.e., 1.
Example: Define a possible membership function for
the fuzzy set of real numbers close to 0.
• Here we define member as follows that is special
case of vicinity function.
F(x) = 1 / (1 + 10x2)
• Using above function we can determine the
membership grade of each real number in this fuzzy set
which signifies the degree to which that number is
close to 0.
• One could also obtain a function representing the set
of real numbers very close to 0.F(x) = (1/(1 + 10x))2
• Generalize this function to a family of functions
representing the set of real numbers close to any given
number ‘a’ as F(x) = 1/(1 + 10(x-a))2
Various fuzzy set operations
Definition: The membership function C (x) of the set C =
A  B is defined as C (x) = min {A (x), B (x)}, x  X
Definition: The membership function C(x) of C = A  B
is defined as C(x) = max{A(x) , B(x)}, x  X
Definition: Membership function of the complement of a
fuzzy set A, A’(x) is defined as A’(x) = [1 - A(x) ], x  X
Example:
Let
X = { 1,2,3,4,5,6,7}
A = { (3, 0.7), (5, 1), (6, 0.8) }
B = {(3, 0.9), (4, 1), (6, 0.6) }
A  B = { (3, 0.7), (6, 0.6) }
A  B = { (3, 0.9), (4, 1), (5, 1), (6, 0.8) }
A’
= { (1, 1), (2, 1), (3, 0.3), (4, 1), (6, 0.2), (7, 1) }
Additional operations:
Equality: A = B, if A(x) = B(x), x  X
Not equal: A  B, if A(x)  B(x) for at least one x  X
Containment: A B if and only if A(x)  B(x), x  X
Proper subset: If A  B and A  B
Product: AB is defined as AB(x) = A(x) . B(x)
Power : AN is defined as: AN(x) = (A(x))N
Bold union : A  B is defined as:
A  B(x) = Min [1, A(x) + B(x)]
8. Bold intersection: A  B is defined as:
A  B(x) = Max [0, A(x) + B(x) - 1]
1.
2.
3.
4.
5.
6.
7.
Example:
Let
X = {5,10,20,30,40,50,60,70,80}
Old = { (20, 0.1), (30, 0.2), (40, 0.4), (50, 0.6),
(60, 0.8), (70, 1), (80, 1)}
Adult= { (20, 0.8), (30, 1), (40, 1), (50, 1), (60, 1),
(70, 1), (80, 1)}
Young = { (5, 1), (10, 1), (20, 0.8), (30, 0.5),
(40, 0.2), (50, 0.1)}
Here we see that ‘Old’ is proper subset of adult.
Multi-valued Logic
 The classical (two–valued) logic can be extended into
three–valued logic denoting truth, falsity and indeterminacy
represented by (1,0 and ½). The basic logic operations
(, V,  ) are defined as follows:
X
Y
X Y
XVY
XY
0
0
0
0
1
0
½
0
½
1
0
1
0
1
1
½
0
0
½
½
½
½
½
½
1
½
1
½
1
1
1
0
0
1
0
1
½
½
1
½
1
1
1
1
1
• 3 – valued logic can be generalized to n-valued logic.
• For any given n, the truth values in n-valued logic are
usually labeled by rational numbers in the unit interval [0,1].
• These values are obtained by evenly dividing the interval
between 0 and 1 exclusive. The set Tn of truth values of an nvalued logic is thus defined as
Tn = { 0/(n-1), 1/(n-1), 2/(n-1), …, (n-1)/(n-1) }
 These values can be interpreted as degrees of truth.
 The following equations defines the basic logic operations
(, V,  ) on n-valued logic.
1. X ’ = (1 – X)
2. X  Y
= Min (X, Y)
3. X V Y
= Max (X, Y)
4. X  Y
= Min (1, 1+Y-X)
• There is a natural correspondence between logic and set
theory.

V





0
 Fuzzy logic is a multivalued logic whereas classical logic
(prepositional / predicate) is a two–valued logic denoting
truth and falsity of as statement.
 Membership grade in fuzzy set can be interpreted as truth
value of the proposition “x is a member of set”
 Ultimate goal of fuzzy logic is to provide foundations for
approximate reasoning with imprecise propositions using
fuzzy set theory as the principle tool.
 Fuzzy reasoning is neither exact nor absolutely inexact
but only to certain degree of exact or inexact.
 Primary focus of Fuzzy logic is on natural language
where approximate reasoning with imprecise propositions
are rather typical.
 Fuzzy logic allows the use of.fuzzy predicates such as
{ old, expensive, young, rare, rich, dangerous etc}
1. Fuzzy quantifiers { many, few, almost all,
usually, several, frequently, seldom}
2. Fuzzy truth values { quite true, very true, more
or less, fairly true, true, mostly }
3. Fuzzy modifiers { likely, almost impossible
extremely unlikely etc.}
 In fuzzy logic, individual element can also be members
of different sets having different degrees simultaneously.
 Each simple fuzzy predicate statement such as “x is P” is
represented in fuzzy logic by a fuzzy set.
 Here for example, x stands for the age of a person and that P
has the meaning of young.
Example: Truth value of a proposition “x is P” is obtained by a
particular substitutions for x in the predicate such as “Tina is
young”
 Let A is a set of ‘Young’ people represented as:
Young = {(5, 1), (10, 1), (15, 1), (20, 0.95), (25, 0.87),
(30, 0.5), (35, 0.25), (40, 0.2), (50, 0.1) }
 Here pair denotes, a member and its belonging ness in the set
of young persons. So if age is 15 then its membership value is 1
and if age is 50 then its membership value is 0.1.
• Now the truth value of the proposition “Tina is young”
depends not only on the membership grade of Tina’s age in fuzzy
set but also depends upon the strength of truth (or falsity)
claimed.
• Possible truth claims are:
fairly true, true, very true, fairly false, false, very false
• Each of possible truth claims is represented by an appropriate
fuzzy set on the unit interval [0,1].
fairly true ={(0.25, 0.35) , (0.5, 0.7), (0.75, 0.85), (1, 1)}
true = {(0.25, 0.25), (0.5, 0.5), (0.75, 0.75), (1, 1)}
very true = {(0.25, 0.15) , (0.5, 0.3), (0.75, 0.5), (1, 1)}
•Similarly fuzzy sets for fairly false and very false could be
defined.
fairly false ={(0.25, 0.85) , (0.5, 0.7), (0.75, 0.35), (1, 0)}
false = {(0.25, 0.75) , (0.5, 0.5), (0.75, 0.25), (1, 0)}
very false ={(0.25, 0.5) , (0.5, 0.3), (0.75, 0.15), (1, 1)}
Example:
Tina’s
age
15
20
25
50
70
Membership
value in set
of young person
1
0.95
0.87
0.1
0
FT
True
VT
FF
False
VF
1
0.96
0.9
0.2
0
1
0.95
0.87
0.1
0
1
0.85
0.8
0.05
0
0
0.18
0.18
0.95
1
0
0.13
0.13
0.9
1
0
0.1
0.1
0.8
1
Case1: If age of Tina is 15, then A (15) = 1. We get the truth values of the
proposition “Tina is young” as very true
Case2: If age of Tina is 20, then A (20) = 0.95. We can infer that “Tina is young”
is true.
Case3: If age of Tina is 25, then A (25) = 0.87. We can infer that “Tina is young”
is fairly true.
Case4: If age of Tina is 50 years, then A (50) = 0.1. We get “Tina is young” is
fairly false.
Case5: If age of Tina is 70 years, then A (70) = 0. Here we get, “Tina is young” is
very false.
• We may operate on fuzzy sets representing predicates with
any of the basic fuzzy set operations such as
complementation, union or intersection.
• Further these sets can be modified by special operations
corresponding to linguistic terms such as very, extremely,
more or less, quite etc. These forms are called linguistic
hedges.
For example, for very young, we obtain a new fuzzy set
representing the concept of a very young person.
• Inference rule equivalent to modus ponen in conventional
logic would be useful / meaningful for deductive inferencing.
Premise
:
x is P1
Implication :
if x is P then y is Q
Conclusion :
y is Q1
Examples:
1.
i. This banana is very yellow.
ii. If a banana is yellow then the banana is ripe
Conclude:
This banana is very ripe.
2.
i. Old coins are usually rare collectibles.
ii. Rare collectibles are expensive.
Conclude:
Old coins are usually expensive.
3.
i. Premise
: x is little
ii. Implication: x and y are approximately equal.
Conclude:
y is more or less little.
Fuzzy propositions
 Fundamental difference between classical propositions and
fuzzy propositions is in the range of their truth values.
Four types of simple fuzzy propositions
1. Unconditional and unqualified propositions
2. Unconditional and qualified propositions
3. Conditional and unqualified propositions
4. Conditional and qualified propositions
1. Unconditional and unqualified propositions:
• The canonical form of this type is “x is A”, where x  X
and A is a fuzzy set on X
• For example, temperature is high, tina is young, john is tall
etc.
• Answer to such statements i.e., degree of truth is obtained
as shown in earlier examples.
2. Unconditional and qualified propositions
• The canonical form of this type is “x is A is S “, where S
is a fuzzy truth qualifier
• For example, if age(tina) = 25, tina is young is very true,
tina is young is fairly false etc.
3. Conditional and unqualified propositions
• The canonical form of this type is “if x is A, then y is B”
where x  X, y  Y and A is fuzzy set on X, B is fuzzy set
on Y
• For example, If sun is bright, then day is hot.
4. Conditional and qualified propositions
• The canonical form of this type is “if x is A, then y is B
is S”
• For example, If sun is bright then day is cold is very
false.
Linguistic variable: It is a variable that assumes a value
consisting of words or sentences rather than numbers. For
example, the variable AGE is defined as:
AGE = [very young, young, middle age, old, very old].
• Formal definition of a linguistic variable is (x,T(x),U,G,.M)
where,
x
name of the variable (AGE)
T(x) terminal set of x (very young, young)
U
Universe
G
Syntactic rules which generates the
value of x.
M
semantic rules associated with each
value of x with its meaning M(x)
(a fuzzy subset )
Here
G
=
(Vn VT, P, S)
Vn – Nonterminal symbols,
VT – Terminal symbols
P - Production rules
S - Start symbol
•For example,
Vn = {A, B, C, D, E, S}
VT = {and, or, young, not, old, …}
P:
S  A, S  S or A,
A  A and B, A  B,
B  C, B  not C,
C  D, C  very C,
C  E, D  young, E  old
Generate string
“not young and not very old”
S  A  A and B  A and not C

A and not very C

A and not very E

A and not very old

B and not very old

not C and not very old

not young and not very old.
• The semantic rule M gives meaning to the values of AGE,
say for ‘old’
M = { ( x , old (x) | x [0, 110]}
where, old (x) can be defined using S-function.
 Canonical form of proposition P is ‘X is A’ (for example,
bob is old), where ‘A’ is a fuzzy predicate and ‘X’ is a
constrained variable.
 Generally, ‘A’ can express a set of fuzzy relations in the
domain of X and X can be a collection of constrained
variables.
 More complex propositions can be expressed in canonical
form ‘Q As are Bs’ (for example, most old men are not
very strong), where Q is fuzzy quantifier, As and Bs are
fuzzy predicates
Rule of inference for quantified propositions : (Fuzzy
syllogism – deductive system)
Rule1. If (Q1 As are Bs) and (Q2 Bs are Cs) then
infer (Q1  Q2) As are Cs
• Here (Q1 As are Bs) and (Q2 Bs are Cs) are called major
and minor premises respectively.
• (Q1  Q2) is bold union of two sets. Member function for
Q1  Q2 is defined as:
Q1  Q2 (x) = min (1, (Q1(x) + Q2(x)))
Example:
Given (all capitals have universities) and (all universities
have students) then we can infer (all capitals have students)
using above rule.
 Syllogisms are deductive constructs having two premise
and a conclusion.
 Classical example of syllogisms is categorical syllogisms
that use deduction like
1.
all As are Bs
2.
no As are Bs
3.
some As are Bs
4.
some As are not Bs
• Here As is called minor term and Bs is called major term.
• Categorical syllogisms are usually denoted by
1.
A for universal affirmation
2.
E for universal negative
3.
I for particular affirmation
4.
O for particular negative
• Further ‘all’ and ’no’ quantifiers belong to entire
class, called universal quantifiers and ‘some’ is called
particular quantifiers.
• Categorical statements can be classified according
to the moods of their syllogisms and according to the
pattern of their premise.
• For example,
1.
Mood AAA
if (all X is Z) and (all Y is X) then infer (all Y is Z)
2.
Mood AEE
if (all X is Z) and (no Y is X) then infer (no Y is Z)
Possible patterns of categorical statements are
Major premise X is Z Z is X X is Z Z is X
Minor premiseY is X Y is X X is Y X is Y
Conclusion Z is Y Z is Y Z is Y Z is Y
• Possible patterns of categorical statements are
Major premise
X is Z
Minor premise
Y is X
Conclusion
Z is Y
Major premise
Minor premise
Conclusion
Z is X
Y is X
Z is Y
Major premise
Minor premise
Conclusion
X is Z
X is Y
Z is Y
Major premise
Minor premise
Conclusion
Z is X
X is Y
Z is Y