Unit 1 Fuzzy Logic
Unit 1 Fuzzy Logic
Unit 1 Fuzzy Logic
Introduction – Fuzzy Logic – Fuzzy Sets, Fuzzy Membership Functions, Operations on Fuzzy Sets,
Fuzzy Relations, Operations on Fuzzy Relations, Fuzzy Rules and Fuzzy Reasoning, Fuzzy Inference
Systems
What is computing?
The computing in terms of computer technology is the process of accomplishing the particular task with
the help of a computer or a computing device.
Major types of computing:
There are two major classification of computing
1. Hard Computing
2. Soft computing
Hard Computing:
It is a conventional methodology which relies on principles of accuracy, certainty and inflexibility.
Soft computing:
Soft computing is a modern approach based on the idea of the approximation, uncertainty, and
flexibility.
Human-Like: Think and act and possess human-like expertise in a particular domain.
Adaptable: Adapt themselves and learn to do better in a changing environment.
Explanations: They explain how they make decisions or take actions.
It makes use of approximate calculations to provide imprecise but usable solutions to complex
problems.
Soft Computing is a collection of methodologies precise that aim to exploit the tolerance of imprecision
and uncertainty ( different results) to achieve traceable, robustance ( input, noise) and low solution
cost..
Neural Networks
Fuzzy Logic
Probabilistic Reasoning
Genetic Algorithms
Stimulated Annealing
Conventional AI
Introduction:
The classical set theory is built on the fundamental concept of “set” of which an individual
is either a member or not a member. A sharp, crisp, and unambiguous distinction exists between a
member and a nonmember for any well-defined “set” of entities in this theory, and there is a very
precise and clear boundary to indicate if an entity belongs to the set.
Namely, in the classical set theory, it is not allowed that an element is in a set and not in the
set at the same time. Thus, many real-world application problems cannot be described and handled
by the classical set theory, including all those involving elements with only partial membership of a
set. On the contrary, fuzzy set theory accepts partial memberships, and, therefore, in a sense
generalizes the classical set theory to some extent.
Fuzzy logic is an extension of Boolean logic by Lot Zadeh in 1965 based on the mathematical
theory of fuzzy sets, which is a generalization of the classical set theory. By introducing the notion of
degree in the verification of a condition, thus enabling a condition to be in a state other than true or
false, fuzzy logic provides a very valuable flexibility for reasoning, which makes it possible to take
into account inaccuracies and uncertainties. In order to introduce the concept of fuzzy sets, we first
review the elementary set theory of classical mathematics. It will be seen that the fuzzy set theory is
a very natural extension of the classical set theory, and is also a rigorous mathematical notion.
Fuzzy logic:
Fuzzy logic is defined as a Multivalued Logic with various degrees of values
for its member elements.
Fuzzy logic is based on "degrees of truth" than the (1 or 0) Boolean logic on which the
modern computer is based.
The word fuzzy refers to things which are not clear or are vague. Any event, process, or function
that is changing continuously cannot always be defined as either true or false, which means that
we need to define such activities in a Fuzzy manner.
In Boolean system truth value, 1.0 represents absolute truth value and 0.0 represents absolute
false value. But in the fuzzy system, there is no logic for absolute truth and absolute false value. But
in fuzzy logic, there is intermediate value too present which is partially true and partially false.
Figure 1 Example
In other words, we can say that fuzzy logic is not logic that is fuzzy, but logic that is
used to describe fuzziness. There can be numerous other examples like this with the help of
which we can understand the concept of fuzzy logic.
Fuzzy Logic was introduced in 1965 by Lofti A. Zadeh in his research paper “Fuzzy
Sets”. He is considered as the father of Fuzzy Logic.
Classical set:
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 4
UNIT-1 CCS 364 SOFT COMPUTING
Let A and B be two subsets on the universe X. Operations are shown below
Commutativity A𝖴B=B𝖴A
A ∩ B = B ∩ A. …….. (5)
Associativity A 𝖴 (B 𝖴 C) = (A 𝖴 B) 𝖴 C
A ∩ (B ∩ C) = (A ∩ B) ∩ C …….. (6)
Distributivity A 𝖴 (B ∩ C) = (A 𝖴 B) ∩ (A 𝖴 C)
A ∩ (B 𝖴 C) = (A ∩ B) 𝖴 (A ∩ C) …….. (7)
Idempotency A𝖴A=A
A∩A=A …….. (8)
Identity A𝖴Ø=A
A∩X=A
A ∩ Ø = Ø. …….. (9)
A 𝖴 X = X.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 5
UNIT-1 CCS 364 SOFT COMPUTING
Fuzzy sets:
A fuzzy set is a set with a smooth boundary. Fuzzy logic is based on the theory of fuzzy sets,
which is a generalization of the classical set theory. Saying that the theory of fuzzy sets is a
generalization of the classical set theory means that the latter is a special case of fuzzy sets theory.
To make a metaphor in set theory speaking, the classical set theory is a subset of the theory of fuzzy
sets,
Figure 2
"The classical set theory is a subset of the theory of fuzzy sets"
A fuzzy set, is defined as a set containing elements that have varying degrees ofmembership
values in the range of zero to one.
Fuzzy Set Operations
Union …. (15)
Intersection …. (16)
Complement …. (17)
Fuzzy logic is based on fuzzy set theory, which is a generalization of the classical set theory. The
classical sets are also called clear sets, classical logic is also known as Boolean logic or binary.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 6
UNIT-1 CCS 364 SOFT COMPUTING
The figure 3 shows the membership function chosen to characterize the subset of 'good' quality of
service. Definition 1. Let X be a set. A fuzzy subset A of X is characterized by a membership function.
fa : X ! [0; 1].
• Input 1: quality of service. Subsets: poor, good and excellent.
The shape of the membership function is chosen arbitrarily by following the advice of the
expert or by statistical studies: sigmoid, hyperbolic, tangent, exponential, Gaussian or any other form
can be used.
A fuzzy set is defined by a functions that maps objects in a domain of concern into their membership
value in a set.
A fuzzy set, then, is a set containing elements that have varying degrees of membership in the
set. This idea is in contrast with classical, or crisp, sets because members of a crisp set would not be
members unless their membership is full, or complete, in that set (i.e., their membership is assigned
a value of 1). Elements in a fuzzy set, because their membership need not becomplete, can also
be members of other fuzzy sets on the same universe.
Figure 4 Diagrams for (a) crisp set boundary and (b) fuzzy set boundary.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 7
UNIT-1 CCS 364 SOFT COMPUTING
Universe of discourse: Define a universe of discourse, X, as a collection of objects all having the
same characteristics.
Examples:
The total number of elements in a universe X is called its cardinal number, denoted nx, where x is a
label for individual elements in the universe.
Collections of elements within a universe are called sets, and collections of elements within sets are
called subsets. We define the null set, ∅, as the set containing no elements, and the whole set, X, as
the set of all elements in the universe.
Fuzzy Set:
A fuzzy set is prescribed by vague or ambiguous properties; hence its boundaries are
ambiguously specified.
Fuzzy set theory permits the gradual assessment of the membership of elements in a set, described
with the aid of a membership function valued in the real unit [0,1].
Examples:
There is no single quantitative value which defines the young term. For
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 8
UNIT-1 CCS 364 SOFT COMPUTING
Figure 4
Fuzzy set Theory:
Fuzzy set theory is an extension of classical set theory where elements have varying degrees of
membership. A logic is based on two truth values, TRUE and FALSE.Fuzzy logic uses the whole
interval between 0(TRUE) and 1(FALSE).
Fuzzy logic is derived from fuzzy set theory dealing with reasoning that is approximate rather than
precisely deduced from classical predicate logic.
Fuzzy set theory defines Fuzzy Operators on Fuzzy Sets. Fuzzy logic is capable of handling
inherently imprecise concepts.
Two special properties of set operations are known as the excluded middle axioms and De
Morgan’s principles. These properties are enumerated here for two sets A and B. The excluded
middle axioms are very important because these are the only set operations described here that are not
valid for both classical sets and fuzzy sets. There are two excluded middle axioms. The first, called
the axiom of the excluded middle, deals with the union of a set A and its complement; the second,
called the axiom of contradiction, represents the intersection of a set A and its complement.
All Properties of classical sets also hold for fuzzy sets, except for the excluded middleand
contradiction axioms.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 9
UNIT-1 CCS 364 SOFT COMPUTING
Fuzzy sets can overlap. A set and its complement can overlap. The excluded middle
axioms, extended for fuzzy sets, are expressed as
…. (18)
…. (19)
Venn diagrams comparing the excluded middle axioms for classical (crisp) sets and fuzzy
sets are shown in the below diagrams.
(a) Crisp set A and its complement; (b) Fuzzy ; and (c) crisp A ∩ ≠ Ø
Venn diagrams for these operations, extended to consider fuzzy sets, are shown in thediagrams.
The operations given in the equations are known as the standard fuzzy operations.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 10
UNIT-1 CCS 364 SOFT COMPUTING
All other operations on classical sets also hold for fuzzy sets, except for the excluded middle
axioms. These two axioms do not hold for fuzzy sets since they do not form part of the basic
axiomatic structure of fuzzy sets. Since fuzzy sets can overlap, a set and its complement can also
overlap. The excluded middle axioms, extended for fuzzy sets, are expressed as:
Crisp Vs Fuzzy
Crisp Fuzzy
It has strict boundary T or F Fuzzy boundary with a degree of membership
Some crisp time set can be fuzzy It can't be crisp
True/False {0,1} Membership values on [0,1]
In Crisp logic law of Excluded Middle and Non- In the fuzzy logic law of Excluded Middle and Non-
Contradiction may or may not hold Contradiction hold
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 11
UNIT-1 CCS 364 SOFT COMPUTING
Here μA˜(∙) = membership function of A˜; this assumes values in the range from 0 to 1, i.e.,
μA˜(∙)∈[0,1]. The membership function μA˜(∙) maps U to the membership space M.
The dot (∙) in the membership function described above, represents the element in a fuzzy set;
whether it is discrete or continuous.
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,
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 12
UNIT-1 CCS 364 SOFT COMPUTING
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.
Here the fuzzy set Q(xi) is called as kernel of fuzzification. This method is implemented by
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.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 13
UNIT-1 CCS 364 SOFT COMPUTING
Here, n is the number of fuzzy sets, N is the number of fuzzy variables, is the membership
function for the k-th fuzzy set.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 14
UNIT-1 CCS 364 SOFT COMPUTING
For discrete membership function, the defuzzified value denoted as using COG is defined as:
indicates the sample element, is the membership function, and n represents the number of
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 15
UNIT-1 CCS 364 SOFT COMPUTING
defined as :
Here ∑ denotes the algebraic summation and x is the element with maximum membership function.
Let A be a fuzzy set that tells about a student as shown in figure 3 and the elements with
corresponding maximum membership values are also given. A = {(P, 0.6), (F, 0.4),(G, 0.2),(VG,
0.2), (E, 0)}
Here, the linguistic variable P represents a Pass student, F stands for a Fair student, G represents
a Good student, VG represents a Very Good student and E for an Excellent student.
The defuzzified value for the fuzzy set A with weighted average method represents a Fair student.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 16
UNIT-1 CCS 364 SOFT COMPUTING
Maxima Methods
This method considers values with maximum membership.
There are different maxima methods with different conflict resolution strategies for multiple maxima.
▪ First of Maxima Method (FOM)
▪ Last of Maxima Method (LOM)
▪ Mean of Maxima Method (MOM)
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 17
UNIT-1 CCS 364 SOFT COMPUTING
Control systems abound in our everyday life; perhaps we do not see them as such, because
some of them are larger than what a single individual can deal with, but they are ubiquitous. For
example, economic systems are large, global systems that can be controlled; ecosystems are large,
amorphous, and long-term systems that can be controlled.
Control systems are sometimes divided into two classes. If the objective of the control
system is to maintain a physical variable at some constant value in the presence of disturbances, the
system is called a regulatory type of control, or a regulator. The second class of control systems is set
point tracking controllers. In this scheme of control, a physical variable is required to follow or track
some desired time function. An example of this type of system is an automatic aircraft landing
system, in which the aircraft follows a “ramp” to the desired touchdown point.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 18
UNIT-1 CCS 364 SOFT COMPUTING
A number of assumptions are implicit in a fuzzy control system design. Six basic assumptions
are commonly made whenever a fuzzy rule based control policy is selected.
The plant is observable and controllable: state, input, and output variables are usually available
for observation and measurement or computation. There exists a body of knowledge comprising a
set of linguistic rules, engineering common sense, intuition, or a set of input– output
measurements data from which rules can be extracted.
A solution exists. The control engineer is looking for a “good enough” solution, not necessarily
the optimum one. The controller will be designed within an acceptable range of precision. The
problems of stability and optimality are not addressed explicitly; such issues are still open problems
in fuzzy controller design.
Control system is a set of hardware component which regulates or alters or modifies the behaviour
of the system. Fuzzy control system uses approximation so that the nonlinearity, data or knowledge
incompleteness is reduced.
Assumptions in FLC a FLCS Design:
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 19
UNIT-1 CCS 364 SOFT COMPUTING
FUZZY RELATIONS
Fuzzy relations is used to map elements of one universe, say X, to those of another
universe, say Y, with the help of Cartesian product .The “strength” of the relation measured witha
membership function having “degrees” of strength of the relation on the unit interval [0,1].
Hence, a fuzzy relation is a mapping from the Cartesian space X × Y to the interval [0,1],
where the strength of the mapping is expressed by the membership function Cardinality of
Fuzzy Relations
Cardinality of fuzzy sets is infinity; the cardinality of a fuzzy relation between two or
more universes is also infinity.
Operations on Fuzzy Relations
Let and be fuzzy relations on the Cartesian space X × Y. Then the followingoperations
apply for the membership values for various set operations
Let R and S be fuzzy relations on the Cartesian space X × Y. Then the following operations
apply for the membership values for various set operations (these are similar to the same operations
on crisp sets
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 20
UNIT-1 CCS 364 SOFT COMPUTING
Just as for crisp relations, the properties of commutativity, associativity, distributivity, involution,
and idempotency all hold for fuzzy relations. Moreover, De Morgan’s principles hold for fuzzy
relations just as they do for crisp (classical) relations, and the null relation, O, and the complete
relation, E, are analogous to the null set and the whole set in set-theoretic form, respectively. Fuzzy
relations are not constrained, as is the case for fuzzy sets in general, by the excluded middle axioms.
Since a fuzzy relation R also a fuzzy set, there is overlap between a relation and its complement;
hence,
The excluded middle axioms for fuzzy relations do not result, in general, in the null relation, O, or
the complete relation, E.
...........(24)
..............(25)
From the above equations, the excluded middle axioms for fuzzy relations do not result,in
general, in the null relation, O, or the complete relation, E.
Let be a fuzzy set on universe X and be a fuzzy set on universe Y, then the
Cartesian product between fuzzy sets and will result in fuzzy relation , which is given as
...........(26)
........(27)
The Cartesian product defined by is implemented in the same way as the cross
product of two vectors. Cartesian product is not the same as the arithmetic product. Cartesian product
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 21
UNIT-1 CCS 364 SOFT COMPUTING
employs the idea of pairing of elements among sets. For example, for a fuzzy set
(vector) that has four elements, for a fuzzy set (vector) that has five elements, the
resulting fuzzy relation will be represented by a matrix of size 4 × 5, that is, will have four
rows and five columns.
Fuzzy composition can be defined as of crisp relations. Suppose is a fuzzy relation on the
Cartesian space X × Y, is a fuzzy relation on Y × Z, and is a fuzzy relation on X × Z, then
fuzzy max–min composition is defined in the following manner:
.........(28)
.........(29)
and fuzzy max–product composition is defined in terms of the membership function theoreticnotation
as
.........(30)
It should be noted out that neither crisp nor fuzzy compositions are commutative in general so
Different types of composition are (1) MAX-MIN (2) MAX –PRODUCT (3) MAX-MAX (4) MIN-
MIN (5) MIN-MAX etc., Compositions provides more information which reduces the impreciseness
present in the problem.
Fuzzification:
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 22
UNIT-1 CCS 364 SOFT COMPUTING
Types of Fuzzification
Inference
Intuition
Rank ordering
Using GA
Using ANN
Inductive reasoning
Meta rules
Fuzzy statistics
These are some methods used to generate membership values and there by used toconvert a
crisp value into fuzzy.
FUZZY RULES
In a FLS, a rule base is constructed to control the output variable. A fuzzy rule based system
consists of simple IF-THE with a condition and a conclusion. Sample fuzzy rule for an air
conditioner system is given below.
Table 1 shows the matrix representation of the fuzzy rules for the above said FLS. Row
contains the values that current room temperature can take, column is the values for target
temperature, and each cell is the resulting command. For instance, if temperature is cold and target is
warm then command is heat.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 23
UNIT-1 CCS 364 SOFT COMPUTING
IF x is A
THEN y is B
where x and y are linguistic variables; A and B are linguistic values determined by fuzzy sets
on the universe of discourse X and Y, respectively.
In the field of artificial intelligence (machine intelligence), there are various ways to represent
knowledge. Perhaps the most common way to represent human knowledge is to form it into natural
language expressions of the type IF premise (antecedent), THEN conclusion (consequent). The form
is commonly referred to as the IF–THEN rule-based form; this form is generally referred to as the
deductive form.
It typically expresses an inference such that if we know a fact (premise, hypothesis,
antecedent), then we can infer, or derive, another fact called a conclusion (consequent).This form of
knowledge representation, characterized as shallow knowledge, is quite appropriate in the context of
linguistics because it expresses human empirical and heuristic knowledge in our own language of
communication.
It does not, however, capture the deeper forms of knowledge usually associated with
intuition, structure, function, and behavior of the objects around us simply because these latter forms
of knowledge are not readily reduced to linguistic phrases or representations; this deeper form, is
referred to as inductive.
The fuzzy rule-based system is most useful in modeling some complex systems that can be
observed by humans because they make use of linguistic variables as their antecedents and
consequents; as described here these linguistic variables can be naturally represented by fuzzy sets
and logical connectives of these sets.
DEFUZZIFICATION:
Defuzzification is the process of producing a quantifiable value. Fuzzy values can’t be given
to machines since they understand only two valued logic. Hence these linguistic values have to be
converted into machine understandable two valued logic. Those techniques used to convert fuzzy
into classical values are known as Defuzzification methods. It is the process of conversion of a fuzzy
quantity into crisp quantity. Various Defuzzification methods are listed as:
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 24
UNIT-1 CCS 364 SOFT COMPUTING
Centroid method
Any of the above method can be used based on the level of intelligent control required.
Fuzzy Inference System is the key unit of a fuzzy logic system having decision making as its
primary work. It uses the “IF…THEN” rules along with connectors “OR” or “AND” for drawing
essential decision rules.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 25
UNIT-1 CCS 364 SOFT COMPUTING
Working of FIS
The working of the FIS consists of the following steps −
A fuzzification unit supports the application of numerous fuzzification methods, and converts
the crisp input into fuzzy input.
A knowledge base - collection of rule base and database is formed upon the conversion of crisp
input intofuzzy input.
The defuzzification unit fuzzy input is finally converted into crisp output.
Methods of FIS
Let us now discuss the different methods of FIS. Following are the two important methods of
FIS, having different consequent of fuzzy rules −
Mamdani Fuzzy Inference System
Takagi-Sugeno Fuzzy Model (TS Method)
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 26
UNIT-1 CCS 364 SOFT COMPUTING
Now, if anyone queries about the person who visited India and Japan in the year 99 and is the
citizen of US, then the output will show two entries having the name of John Smith. This is simple
query generating simple output.
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 27
UNIT-1 CCS 364 SOFT COMPUTING
But what if we want to know whether the person in the above query is young or not. According to
the above result, the age of the person is 35 years. But can we assume the person to be young or
not? Similarly, same thing can be applied on the other fields like days spent, year of visit, etc.
The solution of the above issues can be found with the help of Fuzzy Value sets as follows −
FV(Age){ very young, young, somewhat old, old }
FV(Days Spent){ barely few days, few days, quite a few days, many days }
FV(Year of Visit){distant past, recent past, recent }
Now if any query will have the fuzzy value then the result will also be fuzzy in nature.
Fuzzy Query System
A fuzzy query system is an interface to users to get information from the database using (quasi)
natural language sentences. Many fuzzy query implementations have been proposed, resulting in
slightly different languages.
Although there are some variations according to the particularities of different implementations,
the answer to a fuzzy query sentence is generally a list of records, ranked by the degree of
matching.
In the above examples, the quantifiers “Every” and “Many” are applied to the crisp restrictions
“students” as well as crisp scope “(person who)passed the exam” and “cars” as well as crisp scope
”sports”.
Now, from the standard probability theory, the above distribution gives a mean of expected price as
below −
100×0.3+85×0.5+60×0.2=84.5
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 28
UNIT-1 CCS 364 SOFT COMPUTING
And, from the standard probability theory, the above distribution gives a variance of expected price
as below −
(100−84.5)2×0.3+(85−84.5)2×0.5+(60−84.5)2×0.2=124.825
Suppose the degree of membership of 100 in this set is 0.7, that of 85 is 1, and the degree of
membership is 0.5 for the value 60. These can be reflected in the following fuzzy set −
Dr.V.KalaivazhiB.E.,M.Tech.,Ph.D Page 29