0% found this document useful (0 votes)
49 views

Fuzzylogic 180304090247

This document provides an introduction to fuzzy logic and fuzzy sets. It discusses how fuzzy logic allows for varying degrees of truth rather than assuming everything is entirely true or false. It defines key concepts such as fuzzy sets, membership functions, and applications of fuzzy logic systems. Examples are provided to illustrate fuzzy sets and membership functions for representing imprecise concepts like how full a tumbler is rather than binary true/false classifications.

Uploaded by

opwekki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Fuzzylogic 180304090247

This document provides an introduction to fuzzy logic and fuzzy sets. It discusses how fuzzy logic allows for varying degrees of truth rather than assuming everything is entirely true or false. It defines key concepts such as fuzzy sets, membership functions, and applications of fuzzy logic systems. Examples are provided to illustrate fuzzy sets and membership functions for representing imprecise concepts like how full a tumbler is rather than binary true/false classifications.

Uploaded by

opwekki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

INTRODUCTION TO FUZZY LOGIC

1
Syllabus
• Fuzzy sets and crisp sets
– Intersections of Fuzzy sets,
– Union of Fuzzy sets,
– The complement of Fuzzy sets.

2
Motivation
• The term “fuzzy logic” refers to a logic of
approximation.
• Boolean logic assumes that every fact is either
entirely true or false.
• Fuzzy logic allows for varying degrees of truth.
• Computers can apply this logic to represent vague
and imprecise ideas, such as “hot”, “tall” or
“balding”.
What is meant by fuzzy?

Fuzzy (technical meaning) is


• imprecise, uncertain or unreliable
knowledge,
• uncertain/noisy/incomplete Information,
• ambiguity (vague)
• or partial truth

4
Difference between imprecision and
uncertainty
Consider the following two situations :
1. John has at least two children and I am sure about it.
2. John has three children but I am not sure about it.

In case 1, the number of children is imprecise but


certain.
In case 2, the number of children is precise but
uncertain.

5
Uncertainty
• There is uncertainty that arises from ignorance,
from various classes of randomness, from the
inability to perform adequate measurements,
from lack of knowledge, or from vagueness.

6
Types of Uncertainty

1. Stochastic uncertainty: It is the uncertainty


towards the occurrence of a certain event.
2. Lexical uncertainty: It is the uncertainty lies in
human languages like hot days, stable
occurrence, a successful financial year and so
on.

7
Ambiguity (vague)
• Food is hot.
• Here hot may be ‘spicy’ or ‘warm’

8
Partial truth
???????????????

9
World of information

10
Introduction
Fuzzy Logic was initiated in 1965, by Dr. Lotfi A. Zadeh,
professor for computer science at the university of
California in Berkley.

Fuzzy logic is a mathematical tool for dealing with


uncertainty.

It provides a technique to deal with imprecision and


information granularity.

The fuzzy theory provides a mechanism for representing


linguistic constructs such as “many,” “low,” “medium,”
11
“often,” “few.”
Classical set
• Classical sets are also called crisp set or nonfuzzy
set.
• The traditional binary set theory describes crisp
events, events that either do or do not occur.
• The crisp sets are sets without ambiguity in their
membership.
• Example 1, for the set of integers, either an
integer is even or it is not (it is odd).
• Example 2, However, either you are in the USA or
you are not.
12
Example
Lists: A = {apples, oranges, cherries, mangoes}
A = {a1,a2,a3 }
A = {2, 4, 6, 8, …}
Formulas: A = {x | x is an even natural number}
A = {x | x = 2n, n is a natural number}
Membership or characteristic function

1 if x A
 ( x) 

A 0 if x A



13
Can they see each other?

14
Binary logic Vs. Fuzzy logic

15
Fuzzy sets
• It has an ability to classify elements into a continuous
set using the concept of degree of membership.
• Fuzzy set is defined as a set whose elements have
degrees of membership.
• The characteristics function or membership function
not only gives 0 or 1 but can also give values between 0
and 1.
• Value 0-> non-membership
• Value 1->complete membership
• Value between 0 and 1-> degree of membership

16
Example of tumblers

17
Example
• There are following five tumblers, divided into
two classes: full and empty.
• It is obvious: tumbler 1 belongs to the class
full and tumbler 5 belongs to the class empty.
• Then tumblers 2, 3 and 4 belongs to which
class?
• These tumblers are neither 100% full nor
100% empty.
• In other word we can say that tumbler 2 is
75% full, or 25% empty.

18
Example
• Now we define two sets: F and E.
• F is the set of all tumblers that belong to the
class full.
• E is the set of all tumblers that belong to the
class empty.

19
Graphical representation of sets

20
Fuzzy sets

• The sets F and E have some elements, which


have not the full, but a partial membership.
Such kind of non-crisp sets are called fuzzy
sets.
• The set “all tumblers” that is here the basis of
the fuzzy sets F and E, is called the Base set or
universe of Discourse.

21
Fuzzy Logic
 Basically, Fuzzy Logic is a multivalued logic, that allows
intermediate values to be defined between
conventional evaluations like true/false, yes/no,
high/low, etc.
 Fuzzy Logic is a superset of conventional (Boolean)
logic that has been extended to handle the concept of
partial truth, i.e. truth values between “completely
true” and “completely false”.
 Fuzzy Logic provides a simple way to arrive at a definite
conclusion based upon vague, ambiguous, imprecise,
noisy, or missing input information.

22
Fuzzy Logic Systems

• A system becomes a fuzzy system when its


operations are entirely or partially governed
by fuzzy logic or are based on fuzzy sets.
• A fuzzy logic system which accepts imprecise
data and vague statements
such as low, medium, high and provides
decisions.

23
Fuzzy Logic Systems

24
Some Fuzzy Logic applications
MASSIVE

Created to help create the large-scale battle


scenes in the Lord of the Rings films, MASSIVE is
program for generating generating crowd-related
visual effects
Applications of Fuzzy Logic
Vehicle Control

A number of subway systems,


particularly in Japan and
Europe, are using fuzzy
systems to control braking
and speed. One example is
the Tokyo Monorail
Applications of Fuzzy Logic

Appliance control systems

Fuzzy logic is starting to be used to help control


appliances ranging from rice cookers to small-
scale microchips (such as the Freescale 68HC12)
Fuzzy Sets
A fuzzy set A in X is expressed as a set of ordered
pairs:
Where, x is an element in X.

28
Membership function
• The membership function is a graphical representation
of the magnitude of participation of each input.
• It associates a weighting with each of the inputs that
are processed, define functional overlap between
inputs, and ultimately determines an output response.
• The rules use the input membership values as
weighting factors to determine their influence on the
fuzzy output sets of the final output conclusion.
• Once the functions are inferred, scaled, and combined,
they are defuzzified into a crisp output which drives
the system.

29
Continued……..
There are different membership functions associated with
each input and output response. Some features to note
are:
• SHAPE - triangular is common, but bell, trapezoidal,
haversine and, exponential have been used. More complex
functions are possible but require greater computing
overhead to implement. HEIGHT or magnitude (usually
normalized to 1) WIDTH (of the base of function),
SHOULDERING (locks height at maximum if an outer
function. Shouldered functions evaluate as 1.0 past their
center) CENTER points (center of the member function
shape) OVERLAP (N&Z, Z&P, typically about 50% of width
but can be less).

30
Example
• For the tumbler example, fuzzy set can be
represented as
• Full={(1,1), (2,0.75), (3,0.5), (4,0.25), (5,0)}

31
Fuzzy Sets with Discrete Universes
• Fuzzy set C = “desirable city to live in”
X = {SF, Boston, LA} (discrete and nonordered)
C = {(SF, 0.9), (Boston, 0.8), (LA, 0.6)}
• Fuzzy set A = “sensible number of children”
X = {0, 1, 2, 3, 4, 5, 6} (discrete universe)
A = {(0, .1), (1, .3), (2, .7), (3, 1), (4, .6), (5, .2), (6, .1)}

32
Fuzzy Sets with Cont. Universes

• Fuzzy set B = “about 50 years old”


X = Set of positive real numbers (continuous)
B = {(x, mB(x)) | x in X}

33
Alternative Notation

• A fuzzy set A can be alternatively denoted


as follows:
X is discrete
A m
xi X
A ( xi ) / xi

X is continuous A   m A( x) / x
X

34
Characteristics of Fuzzy Sets
– Support(A) = {x  X | mA(x) > 0}
The support of fuzzy set, is the crisp set of all points in the
universe of discourse U such that membership function of A is
non zero.

– Crossover(A) = {x  X | mA(x) = 0.5}


The crossover point of fuzzy set , is the element in universe of
discourse U at which its membership function is 0.5.

– Normal (A) = {x  X | mA(x) = 1}


The fuzzy set is called normal if there is at least one element in
the U where the membership function is 1.

35
Characteristics of Fuzzy Sets
Cardinality
• 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, mA(x):
cardA = mA(x1) + mA(x2) + … mA(xn) = ΣmA(xi), for i=1..n

Example: 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

36
Characteristics of Fuzzy Sets
Empty Fuzzy Set
• A fuzzy set A is empty, IF AND ONLY IF:
mA(x) = 0, xX

• Example: Consider X = {1, 2, 3} and fuzzy set


A = 0/1 + 0/2 + 0/3,
then A is empty.

37
Characteristics of Fuzzy Sets
Alpha-Cut and Strong-alpha cut
• An -cut or -level set of a fuzzy set A  X is an ORDINARY SET A  X, such
that:
A={mA(x), xX}.

• Strong alpha cut is defined as,

A={mA(x)>, xX}.

• Example: Consider X = {1, 2, 3} and set A = 0.3/1 + 0.5/2 + 1/3


then: A0.5 = {2, 3}, A0.1 = {1, 2, 3}, A1 = {3}.

38
Characteristics of Fuzzy Sets
Fuzzy singleton

• Fuzzy set whose support is a single point in X


with µA(x) =1 is called fuzzy singleton.

39
Characteristics of Fuzzy Sets
Equality
• Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF:
mA(x) = mB(x), xX

• Example: A = 0.3/1 + 0.5/2 + 1/3, B = 0.3/1 + 0.5/2 + 1/3,


therefore A = B.

40
Characteristics of Fuzzy Sets

Height
• The height of a fuzzy set ˜A is the maximum
value of the membership function, i.e. max
{μ(x)}.

41
Example 1

• Let U is defined by X={1,2,3,4,5,6,7,8,9,10} &


fuzzy set A={(1,0), (2,0.1), (3,0.2), (4,0.5),
(5,0.3), (6,0.1),(7,0.0), (8,0.0), (9,0.0), (10,1)}
• Find the support, crossover and normal.

42
Solution 1

• Support={2,3,4,5,6,10}
• Crossover point x=4
• Normal point x=10

43
Logical Operations on Fuzzy set

• Fuzzy Intersection
• Fuzzy Union
• Complement

44
Logical Operations on Fuzzy set

 Union: The union the two sets A and B


(AB) can be defined by the membership
function mU(x)

m(x)=max(m(x),m(x)), x  X

45
Fuzzy Set Operations
Union
• Union of 2 sets is comprised of those elements that belong
to one or both sets.
mAB (X) = max (mA(x), mB(x))  x  X
• Example:
Tall = {0/5, 0.2/5.5, 0.5/6, 0.8/6.5, 1/7}
Short = {1/5, 0.8/5.5, 0.5/6, 0.2/6.5, 0/7}
mtall  short =

• Attains its highest vales at the limits and lowest at the


middle.
• Tall or short can mean not medium
Logical Operations on Fuzzy set

 Intersection: the intersection of two sets A


and B (AB) can be defined by the
membership function m(x)

m(x)=min(m(x),m(x)), x  X

47
Fuzzy Set Operations
Intersection
• In classical set theory, intersection of 2 sets contains
elements common to both.
• In fuzzy sets, an element may be partially in both sets.
mAB (X) = min (mA(x), mB(x))  x X
• Example:
Tall = {0/5, 0.2/5.5, 0.5/6, 0.8/6.5, 1/7}
Short = {1/5, 0.8/5.5, 0.5/6, 0.2/6.5, 0/7}
mtall  short =
Tall and short can mean medium
Highest at the middle and lowest at both end.
Logical Operations on Fuzzy set

 Complement: the complement of a fuzzy


set A can be defined by the membership
function mA(x)

mA(x) = 1 - mA(x)

49
Fuzzy Set Operations
Complementation (Not)

• Find complement ~A by using the following operation:


m~A (x) = 1 - mA(x)
• Example:
Short = {1/5, 0.8/5.5, 0.5/6, 0.2/6.5, 0/7}
Not short = { /5, /5.5, /6, /6.5, /7}
Example 2
• Consider two fuzzy subsets of the set X,
X = {a, b, c, d, e }
referred to as A and B
A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
and
B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e}
Find out the Support, Cardinality, union,
intersection and complement.

51
Solution 2
• Support:
supp(A) = {a, b, c, d }
supp(B) = {a, b, c, d, e }
• Cardinality:
card(A) = 1+0.3+0.2+0.8+0 = 2.3
card(B) = 0.6+0.9+0.1+0.3+0.2 = 2.1
• Complement:
A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
A = {0/a, 0.7/b, 0.8/c 0.2/d, 1/e}
• Union:
A  B = {1/a, 0.9/b, 0.2/c, 0.8/d, 0.2/e}
• Intersection:
A  B = {0.6/a, 0.3/b, 0.1/c, 0.3/d, 0/e}

52
Example 3
Suppose we have the following (discrete) fuzzy sets:
A = 0.4/1+0.6/2+0.7/3+0.8/4
B = 0.3/1+0.65/2+0.4/3+0.1/4
a) Represent A and B fuzzy sets graphically
b) Calculate the of union of the set A and set B
c) Calculate the intersection of the set A and set B
d) Calculate the complement of the union of A and B

53
Solution (a)

1 1

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0 0
1 2 3 4 5 1 2 3 4 5

A B
Solution 3
(b) The union of the fuzzy sets A and B
= 0.4/1+0.65/2+0.7/3+0.8/4
(c) The intersection of the fuzzy sets A and B
= 0.3/1+0.6/2+0.4/3+0.1/4
(c) The complement of the fuzzy set A
= 0.6/1+0.4/2+0.3/3+0.2/4

55
Example 4
Given two fuzzy sets A and B

a. Represent A and B fuzzy sets graphically


b. Calculate the of union of the set A and set B
c. Calculate the intersection of the set A and set B
d. Calculate the complement of the union of A and B

A  0.0 / - 2  0.3 / -1  0.6 / 0 1.0 / 1  0.6 / 2  0.3 / 3  0.0 / 4

B  0.1/ - 2  0.4 / -1  0.7 / 0 1.0 / 1  0.5 / 2  0.2 / 3  0.0 / 4


Solution (a)
Solution 4
b
Union  max (A, B)  0.1 / - 2  0.4 / - 1  0.7 / 0  1.0 / 1  0.6 / 2  0.3 / 3  0.0 / 4

c
Intersection  min (A, B)  0.0 / - 2  0.3 / - 1  0.6 / 0  1.0 / 1  0.5 / 2  0.2 / 3  0.0 / 4

d
Complement of (b)  1 - max(A, B)  0.9 / - 2  0.6 / - 1  0.3 / 0  0.0 / 1  0.4 / 2  0.7 / 3  1.0 / 4
Math Operations on Fuzzy Set
• kA = {kmA(x), xX}
Let k =0.5, and
A = {0.5/a, 0.3/b, 0.2/c, 1/d}
then
kA = {0.25/a, 0.15/b, 0.1/c, 0.5/d}

• Am = {mA(x)m, xX}
Let m =2, and
A = {0.5/a, 0.3/b, 0.2/c, 1/d}
then
Am = {0.25/a, 0.09/b, 0.04/c, 1/d}
• …

59
Example 5
There are two fuzzy subsets of the set X = {a, b, c, d, e }:
A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e} and B = {0.6/a, 0.9/b, 0.1/c,
0.3/d, 0.2/e}.
Find the kA, Am and α-cut. K=0.5 and m=2

60
Solution 5
• kA:
for k=0.5
kA = {0.5/a, 0.15/b, 0.1/c, 0.4/d, 0/e}

• Am:
for m=2
Aa = {1/a, 0.09/b, 0.04/c, 0.64/d, 0/e}

• α-cut:
A0.2 = {a, b, c, d}
A0.3 = {a, b, d}
A0.8 = {a, d}
A1 = {a}

61
Example 6
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}

Draw the Fuzzy Graph of A and B

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

62
Solution 6
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}

63
Solution 6 cont....
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}

E = A0.5
E = {c, d}
64
Algebraic Operations on Fuzzy Set
Algebraic Product
• The product of two fuzzy sets in the same
universe of discourse is the new fuzzy set A.B
with a membership function that equal
product of the membership function of A and
the membership function of B.

mA.B(x) ={mA(x). mB(x)| xA, xB}

65
Algebraic Operations on Fuzzy Set
Multiplying a fuzzy set by a crisp number
• When a fuzzy set A is multiplied by a crisp number a,
then its membership function is given by
ma.A(x) =amA(x)

66
Algebraic Operations on Fuzzy Set
Cartesian product
• The Cartesian product of two fuzzy sets A & B is a
fuzzy set C denoted by A X B and defined as
C=A X B= mc(x)/(a,b) |a  A, b  B

mc(C)=min(mA(a) ,mB(b) )

67
Algebraic Operations on Fuzzy Set
Algebraic Sum
The Algebraic sum of two fuzzy sets A & B is a fuzzy
set C denoted by A + B and defined as

C=A + B= mc(x)=mA(x) + mB(x)-mA(x). mB(x)

68
Algebraic Operations on Fuzzy Set
Bounded Sum
• The bounded sum of two fuzzy sets A and B in
the universes X and Y with the membership
functions μA(x) and μB(x) respectively is
defined by

where the “+” sign is an arithmetic operator.


69
Algebraic Operations on Fuzzy Set
Bounded product
• The bounded product of two fuzzy sets A and
B in the universes X and Y with membership
functions μA(x) and μB(x) respectively is
defined as

70
Algebraic Operations on Fuzzy Set
Bounded difference
• The bounded of difference of two fuzzy sets A
and B is a fuzzy set C denoted by

71
Example 7
• Let us consider two fuzzy sets
A={(1,0.6),(2,1.0),(3,0.5),(4,0.3),(5,0.8)
B={(2,0.5),(3,0.7)}
Find out the Algebraic product, Cartesian
product, Algebraic sum, Bounded Sum,
Bounded difference.

72
Solution 7

73
Solution 7 cont…….

74
Solution 7 cont…….

75
Properties of Fuzzy sets
1. Associative Property
2. Commutative Property
3. Distributive Property
4. Idem Potency
5. Identity
6. Transitive
7. Involution
8. Demorgan’s Law

76
Properties of Fuzzy sets

Associative Property
A∪ (B ∪ C) = (A ∪ B) ∪C
or
max [μ A(X), max{μ B(Y), μ C(Z)}] = max[ {max {μ A(x), μ B(Y)}, μ C(Z)]

and A ∩ (B ∩ C) = (A ∩ B) ∩C
or
min [μ A(X), min{μ B(Y), μ C(Z)}] = min[ {min {μ A(x), μ B(Y)}, μ C(Z)]

77
Properties of Fuzzy sets

Commutative Property

78
Properties of Fuzzy sets

Distributive Property

79
Properties of Fuzzy sets

Idem Potency

80
Properties of Fuzzy sets

Identity

81
Properties of Fuzzy sets

Transitive

82
Properties of Fuzzy sets

Involution
A’’=A

83
Properties of Fuzzy sets

Demorgan’s Law

84
Prove

• Prove that the De Morgan’s Laws hold for


fuzzy sets that is

85
Solution

86
Solve

87
Solve

88
Solve
1. For the given fuzzy set

Prove the associative and the distributive


property for the above given sets.
89
Solution
• To prove associative property

90
Solution

• To prove distribute property

91
Solve

92
Solve

3. Consider two fuzzy sets A∼ and B∼ find


Complement, Union, Intersection, Difference,
and De Morgan’s law.

93
Solve

4. Given the classical sets,


A = {9, 5, 6, 8, 10} B = {1, 2, 3, 7, 9} C = {1, 0}
Prove the classical set properties associativity
and distributivity.

94
Solve

5. Consider, X = {a, b, c, d, e, f, g, h}. and the set


A is defined as {a, d, f}. So for this classical set
prove the identity property.

95
Solution

96
Solve

97
Solve

98

You might also like