Fuzzy Sets, Logic and Systems & Applications
Prof. Nishchal K. Verma
Department of Electrical Engineering
Indian Institute of Technology, Kanpur
Lecture – 03
Fuzzy Sets and Fuzzy Logic Toolbox in MATLAB
Welcome to lecture 3 of the course on Fuzzy Sets, Logic and Systems and Applications. So,
in today’s lecture we will discuss Fuzzy Sets and logic Fuzzy Logic Toolbox in MATLAB.
So, before we discuss fuzzy sets let me introduce classical sets just before going to fuzzy sets,
because we need to first understand what is a set, I mean conventional set. And, then we will
from the classical sets we will transition to the fuzzy sets and that this is needed for better
understanding. So, what is a classical set? Classical set normally is a collection of objects
from the universe of discourse.
(Refer Slide Time: 01:24)
So, if we take here classical set whose universe of discourse is X . So, let X be the universe of
discourse and x ∈ X. So, x, x is an element that belongs to the universe of discourse. Then a
classical set A can be defined as A is equal to the collection of all the x’s in the set and the
condition here is that the x should meet certain criteria or conditions. And, as I mentioned
that this x must be belonging to the universe of discourse.
So, any element which is not belonging to the universe of discourse should not be part of this
set. So, here we all know now that conventional set A is the collection of all the elements and
these elements are from, are drawn from the universe of discourse X . So, this kind of
collection is termed as a set.
(Refer Slide Time: 02:54)
If we take an example here, like if we write a set of positive integers less than 20 and more
than 15, so, and the universe of discourse of course, that is X is set of all positive integers that
is I +¿ ¿ . So, if we are writing a classical set A, so this classical set A will be containing all the
elements that satisfies this criteria. So, if we write set A; set A will be like this. So, A is equal
to the set the collection of all the elements that is x which is satisfying this criteria.
What is this criteria? A={x∨15< x<20 , x ∈ X } So, now, we can write this set as the A which
is the name of the set, the classical set as collection of all the elements in between 15 and 20.
So, in between 15 and 20 are coming out to be 16, 17, 18, 19 the part of this set and if we
look at the set here all the elements here, then we find that these all the elements are drawn
from the positive integers, the set of positive integers I +¿ ¿ .
So, this way we can say that A is a classical set. Now, here a very important point that we
should note is that’s the element that are present in the classical set are completely present.
What do I mean by completely means 16 is present with 100 percent, 17 is present with 100
percent, 18 is present with 100 percent, 19 is present with 100 percent. So, 16, 17, 18 are
completely present in the system. So, the classical set, in classical set if we have the element
that present in the classical set they all are present with 100 percent.
Now, if we look at the above classical set, it is clear that any of the elements A are either
completely belongs to A, means they are present with the with 100 percent or completely
does not belong to A. Means, the elements that are not present in the set, means they are not
present in the set with 100 percent, means their percentage is 0. So, any element which is not
present in the set, it indicates here, it means here that the element is present with 0 percent,
means element is not present.
(Refer Slide Time: 06:34)
So, for the same classical set A let us let me make this thing more clear, in other words we
make say that the membership value. So, a new term is coming over here is membership
value. So, when I was mentioning 100 percent, it means 100 percent is the membership value;
means here is that if we have classical set or conventional set, so, this classical set or
conventional set, the element that are present they are present with 100 percent membership
value.
So, the membership value here, the membership value of 16 is 100 percent; although it is not
written, membership value of 17 is 100 percent, membership value of 18 is 100 percent,
membership value of 19 is 100 percent. But, all these membership value are not written in the
classical set, because it is understood that they are completely present. So now, if we look at
this set again, what we see here the elements that do not belong to the classical set A have
their corresponding membership value zero.
Of course, because the conventional set is based on the Boolean logic. So, any element which
is present will have 100 percent presence or element or any element which is not present will
have 100 percent absence. So, if we have any element present in the classical set, we will say
that it is true and if the element is not present with 100 percent means the 0 percent it is
termed as false. So, there is no possible case in between any of the element.
So, this point is very important to be noted because in classical set either an element in the set
is present or it’s not present. But, if we talk of fuzzy logic, since fuzzy logic is based on the
multi-valued logic; so, the element can be present in the set in fuzzy set with varied
membership value. What does this, what does this mean here is, that any element may be
present with the membership value more than 0 and less than 1; the elements with this value
may be present, but not completely present. Any element which is present with 100 percent
membership value is completely present.
So, as I just mentioned that multivalued logic here, with the multivalued logic in fuzzy
system; so, here not only the true or false, the, so every element in a fuzzy logic A will be
assigned its membership value. So, let me make it very clear that any element, any element
which has the membership value more than 0 will be the part of a fuzzy set. And, also if the
element is not completely present means if the element has the membership value 0, the
element will not be part of the fuzzy set.
(Refer Slide Time: 10:48)
So, let us now move to fuzzy set from the classical set and in classical set we do not write any
membership value as I mentioned. Because, it is assumed that any element which is present
in the classical set it is, it is assumed, it is understood that the element that are in the
conventional set, or classical set, or traditional set which is based on the Boolean logic, the
elements are with 100 percent membership value.
So, that is why it is not written, but if we talk of fuzzy set here unlike the conventional,
traditional fuzzy logic, fuzzy logic, in fuzzy logic the elements that are present in the set they
these will have the membership values in between 0, in between 0 plus and 1. So, the
elements, these elements will be with the respective membership values. This is needed
because, otherwise we may not be knowing with what value, with what degree, with what
membership value these elements are present in the sets.
So, here like in the classical set that we have had just before we had 16, so, 16 was 100
percent present, 17 was 100 percent present, 18 was 100 percent present, 19 was 100 percent
present. And of course, all these elements were drawn from the universe of discourse. So,
here also we will have a universe of discourse and these elements must be from the universe
of discourse, some universe of discourse say X. Now, in classical sets these all were present
with 100 percent means completely present, but let us assume a case where this 16 is not
completely present, I would say partially present. And, if we say partially present means it is,
it has some value, it has some membership value less than 1.
So, if it has some membership value less than 1, say 0.6. So, this 0.6 is the membership value
of 16. So, this 16 and 0.6 these two are very important for together to be included in the in the
set. And, since this is not 100 percent present; so, we need to know with what degree it is
present. So, that is why the degree along with that element is needed and that’s why if we see
in a fuzzy set every element is with some degree. So, every element is paired with some
degree and that is how a fuzzy set is formed.
So, if we see here this fuzzy set A, now this is not a crisp set, it is a fuzzy set because the
element 16, 17, 18, 19 they all are having some degree associated with these element. So, 16
is with 0.6, 17 is with 0.9, 18 is with 0.2, 19 is with 1. So, if we see here that fuzzy set is the
ordered pair of all the elements and this pair is nothing, but the first element of the this pair is
the element and the second element of this pair is the membership value. So, 16, 0.6 means
that this 16 is present with 0.6 membership value, similarly 17 is present with 0.9
membership value, 18 is present with 0.2 membership value, 19 is present with 1.0
membership value means 100 percent. So, this 19 is completely present, 18 is partially
present, 17 is partially present and 16 is also partially present. So, this way fuzzy set is a set
which has all the elements with its membership values. So, we can also say the same thing as
it is written over here; a fuzzy set A can be written as a set of ordered pairs of the element
and its belongingness, and this belongingness is also called as membership. So, this way
fuzzy set can be written and this is a transition from the classical set.
In classical set we saw that 16 was 100 percent, 17 was 100 percent, 18 was 100 percent, 19
was 100 percent. So, that is why there was no need to include any membership value along
with these elements. So, that is why it was not needed, but here since the since fuzzy set
fuzzy logic fuzzy system is based on fuzzy logic which is of course, a multivalued logic and
because of that the no matter whether a element an element is present with 100 percent or not,
all the element from the universe of discourse must be included in the fuzzy set. So, that is
why any element which is present, even if it is not even if it is not present with 100 percent
all the element has been included here.
(Refer Slide Time: 17:23)
So, this is how we transition from the classical set to a fuzzy set. So, we clearly see there is a
need of writing, there is a need of including here the membership value with the elements
with element, without that it is difficult for us to write a fuzzy set. So, that is why we include
a membership value and the membership value here is represented as μ A , membership value
of any element is represented by μ A ( x). So, if we have any element x and the corresponding
membership value will be μ A and thisμ( x ) and this A is nothing, but the A signifies the
particular the name of the set. So, A is basically a particular set.
So, a fuzzy set in the fuzzy set representation we can write a fuzzy set either in discrete form
or in continuous form. So, in discrete form if we write a fuzzy set, this is the way we write
like, you see here that same fuzzy set; that we already discussed could be written as if we
have let’s say are already had fuzzy set A which was like this 16 with ok. I have I am taking
some other member membership values like let’s say 0.2 and then 17 with 0.1 and 18, 0.5 say
19, 1 like this. So, if we have this as a fuzzy set, this is a crude representation of the fuzzy set.
So, the same fuzzy set can be represented as you see first the membership value and then
corresponding membership corresponding element and then with plus sign we add, but,
please understand that there is there will not be any addition of this ah this values. So, 0.1, 17
and then 0.5, 18 plus 1, 19. So, the same fuzzy set which you see here can be written as
A={0.2/16 +0.1/ 17+0.5/ 18+1.0/ 19 }. So, we see that first we write the membership value
and then with oblique sign with line, a slanted line we write here the corresponding element.
So, if we have any discrete; so, let me first make it clear that a fuzzy set can be the discrete or
a fuzzy set can be continuous. So, if we are writing a discrete fuzzy set, we write the discrete
fuzzy set this way as I just mentioned. And, then we see here the, you know the
representation wise here the same thing can be written like this, like form in which we write a
fuzzy set. So, if we have a fuzzy set A fuzzy set A should be written as like
μ A ( x 1) μ A ( x 2)
A= + …. .
x1 x2
, if we have a x 1 , x 2 , x 3 all these the corresponding generic variable value values drawn from
the universe of discourse.
So, this plus sign is very important here because this plus sign this should be noted, it should
be noted that this plus sign this plus sign is not here for addition. So, please understand that
although we have plus signs here, all the elements are separated by plus sign, but this plus
sign is not here for addition. So, please do not add these values with this plus sign, if you add
these values together this will be, this will not be a fuzzy set. So, this will become this will be
wrong thing. So, please do not add this, these plus signs you leave as it is.
So, this is and please understand this is another way of writing the same thing, you can use
μA ( xi)
summation also. Like if we do not want to write it like this, ∑ ={( x i , μ i ( xi ) )∨ xi ∈ X }.
X xi
So, this way the discrete fuzzy set is written, then if we want to write, if we want to represent
a continuous fuzzy set. So, a continuous fuzzy set of course, this will be from the infinite
universe of discourse.
And, this fuzzy set will be written as you see a fuzzy set A is written as A is equal to we use
here instead of this summation sign we use the integration sign.
So, please understand here that this if we have continuous fuzzy set, we use the integration
sign. A=∫ μ A ( x i )/ x i
X
And, then with this slanted line we separate and then we write the corresponding generic
variable value.
Please understand this μ A ( xi ) will be continuous function, because if we are writing fuzzy set
in a continuous format of course ( x i ) will be a continuous function. So, this is this will be a
continuous, this corresponding the values here the generic variable values will be ( x i ). So,
this way we write continuous fuzzy set in a continuous, in a continuous format. And, as it is
written here that summation and integration signs indicate the collection of all the element in
the universe of discourse.
So, along with their associated membership values. So, please do not use this summation and
integration, so, summation for addition and do not integrate the function that is coming so,
but you just leave it leave as it is.
(Refer Slide Time: 26:16)
So, μ A ( x) as I mentioned μ A ( x) is nothing, but a membership value. So, μ A ( x) is termed as
the membership value for element x in fuzzy set A and this gives a single value for every
element contained in fuzzy set. So, membership value, values for every x can be found from
membership function. So, if we have a membership function let us μ A ( xi ), it should be ( x i )
here, it should ( x i ). And, then if it is a corresponding if this is the membership value,
membership function and if we want to have a corresponding membership value. If we have a
generic variable let us say ( x i ), ith value i of the in the universe of discourse, ithelement some
element ( x i ). So, corresponding that ( x i )we will have μ A ( xi ) and then this is a this will be a
single value. So, and one more thing that to be noted here is that this membership values will
be in between 0 and 1. So, the membership value which is written here, that membership
values lie between the interval 0 and 1 for a normal fuzzy sets. So, when we say a normal
fuzzy set, it means they it means there may be a fuzzy sets which are not normal.
So, we ah normally call those sets as subnormal fuzzy sets. So, so fuzzy set which has at least
one membership value equal to 1 is a normal fuzzy set. But, any fuzzy set which does not
have any of the values as equal to any of the membership values equal to 1, it is called
subnormal fuzzy sets. So, in other words you can say the subnormal fuzzy sets are those sets
whose which does not have any membership value up to 1. So, with this I would like to stop
here.
(Refer Slide Time: 29:01)
And, in the next lecture we will be discussing few examples on fuzzy sets and fuzzy logic
toolbox in MATLAB will also be discussed.