بسم الله الرحمن الرحيم
Future University
Faculty Of Engineering
Application of Artificial
Intelligence
Fuzzy Logic
prepared By : Duaa Mohammed
• Fuzzy Logic (FL) is a method of reasoning that resembles human
reasoning. The approach of FL imitates the way of decision making in
humans that involves all intermediate possibilities between digital values
YES and NO.
• Fuzzy Logic Systems (FLS) produce acceptable but definite output in
response to incomplete, ambiguous, distorted, or inaccurate (fuzzy)
input.
• The conventional logic block that a computer can understand takes
precise input and produces a definite output as TRUE or FALSE, which is
equivalent to human’s YES or NO.
• The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers,
the human decision making includes a range of possibilities between YES
and
NO, such as −
CERTAINLY YES , POSSIBLY YES , CANNOT SAY ,POSSIBLY
NO ,AND CERTAINLY NO.
• The fuzzy logic works on the levels of possibilities of input to achieve the
definite output.
• It can be implemented in systems with various sizes and capabilities ranging
from small microcontrollers to large, networked, workstation based control
systems.
• It can be implemented in hardware, software, or a combination of both.
Fuzzy Logic Systems Architecture
• It has four main parts as shown −
1. Fuzzification Module − It transforms the system inputs, which are crisp
numbers, into fuzzy sets. It splits the input signal into five steps such as −
2. Knowledge Base − It stores IF-THEN rules provided by experts.
3. Inference Engine − It simulates the human reasoning process by making fuzzy
inference on the inputs and IFTHEN rules.
• Defuzzification Module − It transforms the fuzzy set obtained by the inference
engine into a crisp value.
Figure: fuzzy logic systems architecture
Membership Function
Membership functions allow you to quantify linguistic term and represent a
fuzzy set graphically. A membership function for a fuzzy set A on the universe of
discourse X is defined as μA:X → [0,1].
• Here, each element of X is mapped to a value between 0 and 1. It is called
membership value or degree of membership. It quantifies the degree of
membership of the element in X to the fuzzy set A.
– x axis represents the universe of discourse.
– y axis represents the degrees of membership in the [0, 1] interval.
• There can be multiple membership functions applicable to fuzzify a numerical
value.
• Simple membership functions are used as use of complex functions does not add
more precision in the output.
• All membership functions for LP, MP, S, MN, and LN are shown as below −
• The triangular membership function shapes are most common among various
other membership function shapes such as trapezoidal, singleton, and Gaussian.
• Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the
corresponding output also changes.
Example:
What is Set?
• A set is an unordered collection of different elements. It can be written
explicitly by listing its elements using the set bracket.
• If the order of the elements is changed or any element of a set is repeated, it
does not make any changes in the set.
• Example
– A set of all positive integers.
– A set of all the planets in the solar system.
– A set of all the states in India.
– A set of all the lowercase letters of the alphabet.
Sets can be represented in two ways −
• Roster or Tabular Form
– In this form, a set is represented by listing all the elements comprising it. The
elements are enclosed within braces and separated by commas.
– Following are the examples of set in Roster or Tabular Form −
o Set of vowels in English alphabet, A = {a,e,i,o,u}
o Set of odd numbers less than 10, B = {1,3,5,7,9}
• Fuzzy sets can be considered as an extension and gross oversimplification of
classical sets. It can be best understood in the context of set membership.
• Basically it allows partial membership which means that it contain elements that
have varying degrees of membership in the set.
• From this, we can understand the difference between classical set and fuzzy
set.
• Classical set contains elements that satisfy precise properties of membership
while fuzzy set contains elements that satisfy imprecise properties of
membership.
Representation Fuzzy Sets
• Let us now consider two cases of universe of information and understand how
a fuzzy set can be represented.
• Case 1
– When universe of information U is discrete and finite −
• Case 2
– When universe of information U is continuous and infinite −
• In the above representation, the summation symbol represents the collection
of each element.
Operations on Fuzzy Sets
• Having two fuzzy sets A˜ and B˜, the universe of information U and an element 𝑦 of the
universe, the following relations express the union, intersection and complement operation on
fuzzy sets.
• Union/Fuzzy ‘OR’
– Let us consider the following representation to understand how the Union/Fuzzy ‘OR’ relation
works −
Intersection/Fuzzy ‘AND’
•Let us consider the following representation to understand how the Intersection/Fuzzy ‘AND’
relation works −
• Here ∧ represents the ‘min’ operation.
Complement/Fuzzy ‘NOT’
• Let us consider the following representation to understand how the
Complement/Fuzzy ‘NOT’
relation works
Properties of Fuzzy Sets
• Let us discuss the different properties of fuzzy sets.
• Commutative Property
– Having two fuzzy sets A˜ and B˜, this property states −
• Distributive Property
– Having three fuzzy sets A˜, B˜ and C˜, this property states
• Idempotency Property
– For any fuzzy set A˜ , this property states −
• Identity Property
– For fuzzy set A˜ and universal set U, this
property states −
• Transitive Property
– Having three fuzzy sets A˜ , B˜ and C˜, this property states −
• Involution Property
– For any fuzzy set A˜ , this property states −
• De Morgan’s Law
– This law plays a crucial role in proving tautologies and contradiction.
– This law states −
Difference:
Difference:
Membership Function
• We already know that fuzzy logic is not logic that is fuzzy but logic that is used to describe
fuzziness.
• This fuzziness is best characterized by its membership function.
• In other words, we can say that membership function represents the degree of truth in fuzzy
logic.
• Following are a few important points relating to the membership function −
– Membership functions were first introduced in 1965 by Lofti A. Zadeh in his
first research paper “fuzzy sets”.
– Membership functions characterize fuzziness (i.e., all the information in fuzzy
set), whether the elements in fuzzy sets are discrete or continuous.
– Membership functions can be defined as a technique to solve practical
problems by experience rather than knowledge.
– Membership functions are represented by graphical forms.
– Rules for defining fuzziness are fuzzy too.
Features of Membership
Functions
• Core
– For any fuzzy set A˜, the core of a membership function is that region of
universe that is characterize by full membership in the set.
– Hence, core consists of all those elements y of the universe of information such that,
• Support
– For any fuzzy set A˜, the support of a membership function is the region of universe that is
characterize by a nonzero membership in the set.
– Hence core consists of all those elements y of the universe of information such that,
• Boundary
– For any fuzzy set A˜ , the boundary of a membership function is the region of
universe that is characterized by a nonzero but incomplete membership in the set.
– Hence, core consists of all those elements y of the universe of information such that,
Fuzzification
• It may be defined as the process of transforming a crisp set to a fuzzy set or a
fuzzy set to fuzzier set.
• Basically, this operation translates accurate crisp input values into linguistic
variables.
Support Fuzzification(s-
fuzzification) Method
• In this method, the fuzzified set can be expressed with the help of the following
relation −
• Here the fuzzy set Q(xi) is called as kernel of fuzzification.
• This method is implemented by keeping μi constant and xi being transformed to a
fuzzy set Q(xi).
Grade Fuzzification (g-
fuzzification)
• It is quite similar to the above method but the main difference is that it kept xi
constant and μi is expressed as a fuzzy set.
Defuzzification
• It may be defined as the process of reducing a fuzzy set into a crisp set or to
convert a fuzzy member into a crisp member.
• We have already studied that the fuzzification process involves conversion
from crisp quantities to fuzzy quantities.
• In a number of engineering applications, it is necessary to defuzzify the result
or rather “fuzzy
result” so that it must be converted to crisp result.
• Mathematically, the process of Defuzzification is also called “rounding it off”.
Max-Membership Method
• This method is limited to peak output functions and also known as height method.
Mathematically it can be represented as follows −
• Here, x∗ is the defuzzified output.
Centroid Method
• This method is also known as the center of area or the center of gravity method.
• Mathematically, the defuzzified output x∗ will be represented as −
Weighted Average Method
• In this method, each membership function is weighted by its maximum membership value.
• Mathematically, the defuzzified output x∗ will be represented as −
Mean-Max Membership
• This method is also known as the middle of the maxima. Mathematically, the defuzzified
output x∗ will be represented as −