0% found this document useful (0 votes)
188 views43 pages

Fuzzy Set

The document discusses fuzzy logic and fuzzy sets. It provides an outline of topics to be covered, including an overview of fuzzy logic and its applications, membership functions, fuzzy sets compared to classical sets, fuzzy set operations, and fuzzy inference systems. Example membership functions are shown, including triangular, trapezoidal, and Gaussian functions, which define the degree of membership in fuzzy sets.

Uploaded by

noor ali
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)
188 views43 pages

Fuzzy Set

The document discusses fuzzy logic and fuzzy sets. It provides an outline of topics to be covered, including an overview of fuzzy logic and its applications, membership functions, fuzzy sets compared to classical sets, fuzzy set operations, and fuzzy inference systems. Example membership functions are shown, including triangular, trapezoidal, and Gaussian functions, which define the degree of membership in fuzzy sets.

Uploaded by

noor ali
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/ 43

Soft Computing

Lecture 2: Fuzzy Logic

ahmed Mohammed basheer


Systems & Control Engineering Department,
College of Electronics Engineering, Ninevah University.
Fuzzy Logic Outlines
Fuzzy Logic (FL):
1. Overview of FL and its applications.
2. Fuzzy Logic and Boolean Logic.
3. Membership function.
4. Fuzzy sets (classical Set vs. Fuzzy Set).
5. Fuzzy Set Operations.
6. Fuzzy Relations.

Fuzzy Systems:
1. Fuzzy Inference Engine.
2. Fuzzification & Defuzzification.
3. Crisp input and output.
4. Fuzzy Rules.
5. Reasoning with Fuzzy Rules.

Tutorial: solve example application problems using FL.


Outlines
Fuzzy Logic (FL):
1. Overview of FL and its applications.
2. Fuzzy Logic and Boolean Logic.
3. Membership function.
4. Fuzzy sets (classical Set vs. Fuzzy Set).
5. Fuzzy Set Operations.
6. Fuzzy Relations.
Fuzzy Logic (FL) Introduction
• In real world, there exist much fuzzy knowledge (i.e. vague,
uncertain inexact etc).
• Human thinking and reasoning (analysis, logic,
interpretation) frequently involved fuzzy information.
• Human can give satisfactory answers, which are probably
true.
• Our systems are unable to answer many question because
the systems are designed based upon classical set theory
(Unreliable and incomplete).
• We want, our system should be able to cope with
unreliable and incomplete information.
• Fuzzy system have been provide solution.
Fuzzy Logic (FL) Introduction

• “Fuzzy” word means “vagueness (ambiguity)” ‫غموض او‬


‫الضبابية‬.
• Fuzzy sets theory is an extension of classical notation set
and invented in 1965 by Lotfi Zadeh.
• Fuzziness occurs when the boundary of a piece of
information is not clear-cut.
• Classical set theory allows the membership of the elements
in the set in binary terms either member or not member.
• Fuzzy set theory permits membership function valued in
the interval [0,1].
Why we Need Fuzzy?
Fuzzy Logic Example
Words like young, tall, good or high are fuzzy.
• There is no single quantitative value which defines the term
young.
• For some people, age 25 is young, and for others, age 35 is
young.
• The concept young has no clear boundary.
• Age 35 has some possibility of being young and usually
depends on the context in which it is being considered.

Fuzzy set theory is an extension of classical set theory where


elements have degree of membership.
Crisp Values Vas Fuzzy Values
=
Boolean Logic Vas Fuzzy Logic
Yes! (1)
Is water Crisp
colorless?
No! (0)

Extremely Honest
(1)

Very Honest
(0.80)

Fuzzy Honest at time


Is Salim Honest?
(0.40)

Extremely dishonest
(0.0)
Fuzzy Logic Applications

Aerospace
Classical set theory
• A Set is any well defined collection of objects, (set= many
objects)
• An object in a set is called an element or member of that
set.
• Sets are defined by a simple statement,
• Describing whether a particular element having a certain
property belongs to that particular set.
A = {a1,a2,a3,……,an}
• If the elements ai (i = 1,2,3,….,n) of a set A are subset of
universal set X, then set A can be represented for all
elements x ϵ X by its characteristics function
µA (x) = 1 if x ϵ X otherwise 0
Operations on classical set theory
Union: the union of two sets A and B is given as
A U B = { x | x є A or x є B }

Intersection: the intersection of two sets A and B is given as


A  B = { x | x є A and x є B }

Complement: It is denoted by à and is defined as


à = { x | x does not belongs A and x є X }
Fuzzy Sets
• Fuzzy sets theory is an extension of classical set theory.
• Elements have varying degree of membership. A logic based
on two truth values,
• True and False is sometimes insufficient when describing
human reasoning.
• Fuzzy Logic uses the whole interval between 0 (false) and 1
(true) to describe human reasoning.
• A Fuzzy Set is any set that allows its members to have
different degree of membership, called membership
function, having interval [0,1].
Fuzzy Sets
• Fuzzy Logic is derived from fuzzy set theory
• Many degree of membership (between 0 to 1) are allowed.
• Thus a membership function µA(x) is associated with a fuzzy
sets à such that the function maps every element of
universe of discourse X to the interval [0,1].
• The mapping is written as: µÃ(x): X  [0,1].

• Fuzzy Logic is capable of handing inherently imprecise


(vague or inexact or rough or inaccurate) concepts
Fuzzy Sets
• Fuzzy set is defined as follows:

• If X is an universe of discourse and x is a particular element


of X, then a fuzzy set A defined on X and can be written as a
collection of ordered pairs

A = {(x, µÃ(x)), x є X }
Fuzzy Sets (Continue)
Example
• Let X = {g1, g2, g3, g4, g5} be the reference set of students.
• Let à be the fuzzy set of “smart” students, where “smart” is
fuzzy term.
à = {(g1,0.4)(g2,0.5)(g3,1)(g4,0.9)(g5,0.8)}
Here à indicates that the smartness of g1 is 0.4 and so on
Classical Set vas Fuzzy Set Functions:
Classical Set vas Fuzzy Set Functions:

Thus, as the height increases, the membership grade within


the tall Set would increase whilst the membership grade
within the not-tall Set would decrease.
Classical Set vas Fuzzy Set
Classical set theory Fuzzy set theory
• Classes of objects with sharp • Classes of objects with un-
boundaries. sharp boundaries.

• A classical set is defined by • A fuzzy set is defined by its


crisp(exact) boundaries, i.e., ambiguous boundaries, i.e.,
there is no uncertainty about there exists uncertainty about
the location of the set the location of the set
boundaries. boundaries.

• Widely used in digital system • Used in fuzzy controllers.


design
Fuzzy Sets :Membership Function
Membership Function
• The membership function fully defines the fuzzy set
• A membership function provides a measure of the degree
of similarity of an element to a fuzzy set
Membership functions can
– either be chosen by the user arbitrarily, based on the
user’s experience (MF chosen by two users could be
different depending upon their experiences,
perspectives, etc.)
– Or be designed using machine learning methods (e.g.,
artificial neural networks, genetic algorithms, etc.)
FL Membership Function Types

There are different shapes of membership functions:


1. Triangular.
2. Trapezoidal.
3. Gaussian. etc
FL Membership Function Types
• Triangular membership function
A triangular membership function is specified by three parameters {a, b, c}
a, b and c represent the x coordinates of the three vertices of µA(x) in a
fuzzy set A (a: lower boundary and c: upper boundary where
membership degree is zero, b: the centre where membership degree is
1)

µA(x)
1
0 if x  a 
x a 
 if a  x  b 
 
 A ( x)   b  a 
c  x if b  x  c 
c  b 
0 if x  c  0 x
  a b c
FL Membership Function Types
• Trapezoid membership function
• A trapezoidal membership function is specified by four
parameters {a, b, c, d} as follows:

0 if x  a 
x a 
 if a  x  b
b  a 
 
 A ( x)  1 if b  x  c
d  x 
 if c  x  d
d c 

0 if d x 

FL Membership Function Types

• Gaussian membership function


 1 xc m

– c: centre  A ( x, c, s, m)  exp  
– s: width  2 s 
– m: fuzzification factor (e.g., m=2)

µA(x)
1

0.9

0.8

0.7
c=5
0.6

0.5 s=2
0.4

0.3

0.2
m=2
0.1

0
0 1 2 3 4 5 6 7 8 9 10
x
FL Membership Function Types
1

0.9

0.8

c=5 0.7

0.6

s=0.5 0.5

0.4

0.3

m=2 0.2

0.1

0
0 1 2 3 4 5 6 7 8 9 10

0.9

0.8

c=5 0.7

0.6

0.5

s=5 0.4

0.3

m=2 0.2

0.1

0
0 1 2 3 4 5 6 7 8 9 10
FL Membership Function Types
1

0.9

c=5 0.8

0.7

s=2 0.6

0.5

m=0.2 0.4

0.3
0 1 2 3 4 5 6 7 8 9 10

0.9

0.8

c=5 0.7

0.6

s=5 0.5

0.4

0.3

m=5 0.2

0.1

0
0 1 2 3 4 5 6 7 8 9 10
Fuzzy Set Operation

Given X to be the universe of discourse and à and Ḃ to


be fuzzy sets with µA(x) and µB(x) are their respective
membership function, the fuzzy set operations are as
follows:
Union:
µA U B(x) = max (µA(x), µB(x))
Intersection:
µA  B(x) = min (µA(x), µB(x))
Complement:
µA (x) =1- µA(x)
Fuzzy Set Operation (Continue)

Example:
A = {(x1,0.5),(x2,0.7),(x3,0)} B = {(x1,0.8),(x2,0.2),(x3,1)}
Union:
A U B = {(x1,0.8),(x2,0.7),(x3,1)}
Because
µA U B(x1) = max (µA(x1), µB(x1))
= max(0.5,0.8)
= 0.8
µA U B(x2) = 0.7 and µA U B(x3) = 1
Fuzzy Set Operation (Continue)

Example:
A = {(x1,0.5),(x2,0.7),(x3,0)} B = {(x1,0.8),(x2,0.2),(x3,1)}
Intersection:
A  B = {(x1,0.5),(x2,0.2),(x3,0)}
Because
µA  B(x1) = min (µA(x1), µB(x1))
= max(0.5,0.8)
= 0.5
µA  B(x2) = 0.2 and µA  B(x3) = 0
Fuzzy Set Operation (Continue)

Example:
A = {(x1,0.5),(x2,0.7),(x3,0)}
Complement:
Ac = {(x1,0.5),(x2,0.3),(x3,1)}
Because
µA (x1) =1- µA(x1)
= 1 – 0.5
= 0.5
µA (x2) = 0.3 and µA (x3) = 1
Linguistic variable,linguistic term
• Linguistic variable: A linguistic variable is a
variable whose values are sentences in a
natural or artificial language.
• For example, the values of the fuzzy variable
height could be tall, very tall, very very tall,
somewhat tall, not very tall, tall but not very
tall, quite tall, more or less tall.
• Tall is a linguistic value or primary term
Linguistic Example:
• If age is a linguistic variable then its term set is
• T(age) = { young, not young, very young, not
very young,…… middle aged, not middle
aged,… old, not old, very old, more or less old,
not very old,…not very young and not very
old,…}.
Fuzzy Set Union Example:
Ex: Fuzzify the age for the sets below.

Fuzzify the
figure using
fuzzy sets:

A={ (10,1) (20, 0.95) (27,0.9) (30, 0.8) (40,0.25) (50,0.1) (60,0)}

B={ (10,0.95) (20, 0.9) (27,0.5) (30, 025) (40,0) (50,0) (60,0)}
Fuzzy Relations
Fuzzy Relations
Fuzzy Relations
Fuzzy Relations
Fuzzy Relations
Fuzzy Relations
Example : x ={1,2,3} y={1,2,3}
X€ X y € Y
1 x=y
µr (x , y)= 0.7 |x-y|=1 µr
0.2 |x-y|=2
y 2 3
x 1
1 x
2
3

y
Fuzzy Relations
Example : x ={1,2,3} y={1,2,3,4}
X€ X y € Y y 1 2 3 4
x
1
0.1 0 1 0
R= 0.2 0.5 0 .2
2
3
0 0.9 0.5 0.4

S= 0.3 1 0.4 0.2


Rꓴ S =?
0 0.8 1 0.9 Rꓴ S=?
0.3 0 0.7 0.2
R com =? S com=?
Fuzzy Relations
H.W
Hint: Converting an input value into these truth values [0 to 1]
for each set is called fuzzifying the input.

Fuzzify the oil prices.


(derive the fuzzy sets)

Fuzzify the
performance of
students.
H.W

Fuzzy set theory is the


process by which qualitative
reasoning can be simulated
on computers, thus allowing
generalized rules to be
formed for decision
support. How many sets are
there in the graph, and
derive the fuzzy set for the
three (6000, 8000, 10000)
for all Sets.

Fuzzify the
height.

You might also like