0% found this document useful (0 votes)
42 views72 pages

Fuzzy Intro and Properties

The document provides an introduction to fuzzy logic, including: - Definitions of fuzzy logic as a theory that accounts for vagueness and ambiguity by allowing partial membership in sets between 0 and 1. - A brief history noting Lotfi Zadeh's 1965 paper introducing fuzzy set theory as a formal system for representing natural language concepts. - Examples of fuzzy logic applications in areas like washing machines, train control systems, and more that use fuzzy rules to model expert knowledge. - Explanations of fuzzy sets, boundaries, and representation using membership functions between 0 and 1 to indicate degrees of belonging to a set rather than binary inclusion/exclusion.

Uploaded by

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

Fuzzy Intro and Properties

The document provides an introduction to fuzzy logic, including: - Definitions of fuzzy logic as a theory that accounts for vagueness and ambiguity by allowing partial membership in sets between 0 and 1. - A brief history noting Lotfi Zadeh's 1965 paper introducing fuzzy set theory as a formal system for representing natural language concepts. - Examples of fuzzy logic applications in areas like washing machines, train control systems, and more that use fuzzy rules to model expert knowledge. - Explanations of fuzzy sets, boundaries, and representation using membership functions between 0 and 1 to indicate degrees of belonging to a set rather than binary inclusion/exclusion.

Uploaded by

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

Lecture 13

Introduction to Fuzzy Logic


Contents

• Definitions
• Brief History
• Fuzzy Applications
• Fuzzy Sets
• Fuzzy Boundaries
• Fuzzy Representation
• Linguistic Variables and Hedges
2
Definition
• Experts rely on common sense when they solve problems.

• How can we represent expert knowledge that uses vague and


ambiguous terms in a computer?

• Fuzzy logic is not logic that is fuzzy, but logic that is used to describe
fuzziness. Fuzzy logic is the theory of fuzzy sets, sets that calibrate
vagueness.

• Fuzzy logic is based on the idea that all things admit of degrees.
Temperature, height, speed, distance, beauty – all come on a sliding scale.
• The motor is running really hot.
• Tom is a very tall guy.

3
Crisp logic Vs Fuzzy Logic
The concept of a set and set theory are powerful concepts in
mathematics. However, the principal notion underlying set theory,
that an element can (exclusively) either belong to set or not belong to a
set, makes it well nigh impossible to represent much of human
discourse. How is one to represent notions like:
large profit
high pressure
tall man
moderate temperature
 Ordinary set-theoretic representations will require the maintenance of
a crisp differentiation in a very artificial manner:
high
not quite high
very high … etc.
4
Bit of History

For example, the possibility that a man 181 cm tall is really tall
might be set to a value of 0.86. It is likely that the man is tall. This
work led to an inexact reasoning technique often called possibility
theory.

In 1965 Lotfi Zadeh, published his famous paper “Fuzzy sets”.
Zadeh extended the work on possibility theory into a formal system of
mathematical logic, and introduced a new concept for applying
natural language terms. This new logic for representing and
manipulating fuzzy terms was called fuzzy logic.

5
Why?

• Why fuzzy?

As Zadeh said, the term is concrete, immediate and descriptive; we all know
what it means. However, many people in the West were repelled by the
word fuzzy, because it is usually used in a negative sense.

• Why logic?

Fuzziness rests on fuzzy set theory, and fuzzy logic is just a small part of that
theory.

6
Fuzzy Applications

• Theory of fuzzy sets and fuzzy logic has been applied to problems in
a variety of fields:
• taxonomy; topology; linguistics; logic; automata theory; game theory;
pattern recognition; medicine; law; decision support; Information
retrieval; etc.

• And more recently fuzzy machines have been developed including:


• automatic train control; tunnel digging machinery; washing machines;
rice cookers; vacuum cleaners; air conditioners, etc.

7
Fuzzy Applications

Advertisement: …

• Extraklasse Washing Machine - 1200 rpm. The Extraklasse machine


has a number of features which will make life easier for you.
• Fuzzy Logic detects the type and amount of laundry in the drum and
allows only as much water to enter the machine as is really needed for
the loaded amount. And less water will heat up quicker - which means
less energy consumption.
• Foam detection
Too much foam is compensated by an additional rinse cycle: If Fuzzy
Logic detects the formation of too much foam in the rinsing spin cycle,
it simply activates an additional rinse cycle. Fantastic!
8
Fuzzy Applications

• Imbalance compensation
In the event of imbalance, Fuzzy Logic immediately calculates the
maximum possible speed, sets this speed and starts spinning. This
provides optimum utilization of the spinning time at full speed.
• Washing without wasting - with automatic water level
adjustment
• Fuzzy automatic water level adjustment adapts water and energy
consumption to the individual requirements of each wash
programme, depending on the amount of laundry and type of fabric.
9
More Definitions
Fuzzy logic is a set of mathematical principles for knowledge
representation based on degrees of membership.

Unlike two-valued Boolean logic, fuzzy logic is multi-valued. It deals


with degrees of membership and degrees of truth.

Fuzzy logic uses the continuum of logical values between 0


(completely false) and 1 (completely true). Instead of just black and
white, it employs the spectrum of colours, accepting that things can
be partly true and partly false at the same time.

0 0 0 1 1 1 0 0 0.2 0.4 0.6 0.8 1 1


(a) Boolean Logic. (b) Multi-valued Logic.

10
Fuzzy Sets

• The concept of a set is fundamental to mathematics.

• However, our own language is also the supreme expression of sets. For
example, car indicates the set of cars. When we say a car, we mean one
out of the set of cars.

• The classical example in fuzzy sets is tall men. The elements of the fuzzy
set “tall men” are all men, but their degrees of membership depend on
their height. (see table on next page)
11
Fuzzy Sets
Degree of Membership
Name Height, cm Crisp Fuzzy
Chris 208 1 1.00
Mark 205 1 1.00
John 198 1 0.98
Tom 181 1 0.82
David 179 0 0.78
Mike 172 0 0.24
Bob 167 0 0.15
Steven 158 0 0.06
Bill 155 0 0.01
Peter 152 0 0.00
12
Degree of
Membership Crisp Sets
1.0
Crisp Vs Fuzzy
0.8
Tall Men
The x-axis represents the 0.6
Sets
universe of discourse – the 0.4

range of all possible values 0.2

applicable to a chosen variable. 0.0


150 160 170 180 190 200 210
In our case, the variable is the Height, cm
man height. According to this Degree of
Membership
Fuzzy Sets

representation, the universe of 1.0

men’s heights consists of all tall 0.8

men. 0.6

0.4
The y-axis represents the 0.2
membership value of the fuzzy 0.0
set. In our case, the fuzzy set of 150 160 170 180 190 200 210
Height, cm
“tall men” maps height values
into corresponding membership
13
values.
Crisp Set

• Let X be the universe of discourse and its elements be denoted as x. In the


classical set theory, crisp set A of X is defined as function fA(x) called the
characteristic function of A:

1, if x  A
f A ( x)  
0, if x  A
fA(x) : X  {0, 1}, where

This set maps universe X to a set of two elements. For any element x of
universe X, characteristic function fA(x) is equal to 1 if x is an element of
set A, and is equal to 0 if x is not an element of A. 14
A Fuzzy Set has Fuzzy Boundaries

• In the fuzzy theory, fuzzy set A of universe X is defined by function µ (x) called the membership
A
function of set A

µA(x) : X  {0, 1}, where µA(x) = 1 if x is totally in A;


µA(x) = 0 if x is not in A;
0 < µA(x) < 1 if x is partly in A.

This set allows a continuum of possible choices. For any element x of universe X, membership
function µA(x) equals the degree to which x is an element of set A. This degree, a value between 0
and 1, represents the degree of membership, also called membership value, of element x in set A.

15
Fuzzy Set Representation

• First, we determine the membership functions. In our “tall men”


example, we can obtain fuzzy sets of tall, short and average men.

• The universe of discourse – the men’s heights – consists of three


sets: short, average and tall men. As you will see, a man who is 184
cm tall is a member of the average men set with a degree of
membership of 0.1, and at the same time, he is also a member of
the tall men set with a degree of 0.4. (see graph on next page)

16
Fuzzy Set Representation
Degree of
Crisp Sets
Membership
1.0

0.8 Short Average Short


Tall
Tall Men
0.6
0.4

0.2

0.0
150 160 170 180 190 200 210
Height, cm
Degree of
Fuzzy Sets
Membership
1.0

0.8

0.6 Short Average Tall

0.4

0.2 Tall
17
0.0
150 160 170 180 190 200 210
Fuzzy Set Representation

 (x)
X Fuzzy Subset A
• Typical functions that can be used
1 to represent a fuzzy set are
sigmoid, gaussian and pi. However, these functions increase the
time of computation. Therefore, in practice, most applications use
linear fit functions.

0
Crisp Subset A Fuzziness Fuzziness x
18
Linguistic Variables and Hedges
At the root of fuzzy set theory lies the idea of linguistic variables.
A linguistic variable is a fuzzy variable. For example, the statement
“John is tall” implies that the linguistic variable John takes the linguistic
value tall.
In fuzzy expert systems, linguistic variables are used in fuzzy rules. For
example:
IF wind is strong
THEN sailing is good

IF project_duration is long
THEN completion_risk is high

IF speed is slow
THEN stopping_distance is short
19
Linguistic Variables and Hedges

• The range of possible values of a linguistic variable represents the


universe of discourse of that variable. For example, the universe of
discourse of the linguistic variable speed might have the range
between 0 and 220 km/h and may include such fuzzy subsets as very
slow, slow, medium, fast, and very fast.

• A linguistic variable carries with it the concept of fuzzy set qualifiers,


called hedges.

• Hedges are terms that modify the shape of fuzzy sets. They include
adverbs such as very, somewhat, quite, more or less and slightly.

20
Linguistic Variables and Hedges
Degree of
Membership
1.0
Short Short
Tall
0.8
0.6 Average

0.4
Very Short Very
VeryTall
Tall
0.2 Tall

0.0
150 160 170 180 190 200 210
Height, cm
21
Linguistic Variables and Hedges
Mathematical
Hedge Expression Graphical Representation

A little [A ( x )]1.3

Slightly [A ( x )]1.7

Very [A ( x )]2

Extremely [A ( x )]3


22
Linguistic Variables and Hedges
Mathematical
Hedge Graphical Representation
Expression

Very very [A ( x )]4

More or less A ( x )

Somewhat A ( x )

2 [A ( x )]2
if 0  A  0.5
Indeed
1  2 [1  A ( x )]2
23
if 0.5 < A  1
Fuzzy Logic Properties
Contents

• Characteristics of Fuzzy Sets


• Operations
• Properties
• Fuzzy Rules
• Examples

25
Characteristics of Fuzzy Sets
• The classical set theory developed in the late 19th century by George
Cantor describes how crisp sets can interact. These interactions are
called operations.
• Also fuzzy sets have well defined properties.
• These properties and operations are the basis on which the fuzzy sets
are used to deal with uncertainty on the one hand and to represent
knowledge on the other.
• A fuzzy set A in X is characterized by a membership function μA (x)
which associates with each point in X a real number in the interval [0,
1], with the values of μA (x) at x representing the grade of
membership of x in A.
• fuzzy set A = {x1, x2, x3, x4} in X characterized by the membership
function μA(x) which maps each point x in X to real values 0.5, 1, 0.75
and 0.5. A = {x,μA(x) | x ∈ X}
26
Characteristics of Fuzzy Sets

27
Note: Membership Functions

• For the sake of convenience, usually a fuzzy set is denoted as:


A = A(xi)/xi + …………. + A(xn)/xn

where A(xi)/xi (a singleton) is a pair “grade of membership” element, that


belongs to a finite universe of discourse:
A = {x1, x2, .., xn}

28
Membership Functions

29
Membership function

There is no strict rule for defining a membership function. . Most widely


used MFs in the fuzzy logic literature are triangular, trapezoidal, Gaussian
and bell-shaped functions.
Triangle membership function:

The parameters {a, b, c} with a < b < c determine the x coordinates of the
three corners of the underlying triangular MF. Triangular MFs can be
asymmetric, depending on the relations a ≤ b and b ≤ c.

30
Triangular Membership function

31
Trapezoidal membership function

A trapezoidal MFis specified by four parameters {a, b, c, d}

The parameters {a, b, c, d} with a < b < c < d determine the x coordinates
of the four corners of the underlying trapezoidal MF. Trapezoidal MFs can
be asymmetric, depending on the relations a ≤ b and c ≤ d.

32
Trapezoidal membership function

33
Gaussian MF

A Gaussian MF is specified by two parameters {m, σ}


The parameters m and σ represent the centre and width of the Gaussian
MF, respectively

34
Bell-shaped MF

A bell-shaped MF is specified by three parameters {m, σ, a}

The parameters m and σ represent the centre and width of the bell-shaped MF,
respectively. Parameter a, usually positive, controls the slope of the MF

35
Sigmoidal MF

Gaussian and bell-shaped MFs are smooth and symmetric MFs. A


sigmoidal MF is asymmetric and is either open left or right.

The parameter a controls the slope of the MF at the cross-point x = c.

36
Operations of Fuzzy Sets

Not A
B

A AA

Complement Containment

A B AA B

Intersection Union

37
Complement
• Crisp Sets: Who does not belong to the set?
• Fuzzy Sets: How much do elements not belong to the set?
• The complement of a set is an opposite of this set. For example, if we
have the set of tall men, its complement is the set of NOT tall men.
When we remove the tall men set from the universe of discourse, we
obtain the complement.

• If A is the fuzzy set, its complement can be found as follows:

38
Complement

39
Complement

40
Containment
Crisp Sets: Which sets belong to which other sets?
Fuzzy Sets: Which sets belong to other sets?
Similar to a Chinese box, a set can contain other sets. The smaller
set is called the subset. For example, the set of tall men contains all
tall men; very tall men is a subset of tall men. However, the tall men
set is just a subset of the set of men. In crisp sets, all elements of a
subset entirely belong to a larger set. In fuzzy sets, however, each
element can belong less to the subset than to the larger set.
Elements of the fuzzy subset have smaller memberships in it than
in the larger set.
Let A and B be two fuzzy sets with membership functions μA
and μB, respectively. A is a subset of B (or A is contained in B),
written A B, if and only if
41
Intersection
Crisp Sets: Which element belongs to both sets?
Fuzzy Sets: How much of the element is in both sets?

In classical set theory, an intersection between two sets contains the
elements shared by these sets. For example, the intersection of the
set of tall men and the set of fat men is the area where these sets
overlap. In fuzzy sets, an element may partly belong to both sets
with different memberships.

A fuzzy intersection is the lower membership in both sets of each


element. The fuzzy intersection of two fuzzy sets A and B on universe
of discourse X:
AB(x) = min [A(x), B(x)] = A(x)  B(x),
42
where xX
Intersection

43
Union

Crisp Sets: Which element belongs to either set?


Fuzzy Sets: How much of the element is in either set?

The union of two crisp sets consists of every element that falls into either
set. For example, the union of tall men and fat men contains all men who
are tall OR fat.

In fuzzy sets, the union is the reverse of the intersection. That is, the union
is the largest membership value of the element in either set. The fuzzy
operation for forming the union of two fuzzy sets A and B on universe X can
be given as:
AB(x) = max [A(x), B(x)] = A(x)  B(x),
where xX
44
Union

45
Operations of Fuzzy Sets

( x ) ( x )
B
1 1 A
A
0 0
x x
B
1 1 A
Not A
0 0
Complement x Containment x

(x) ( x )

1 1
A B A B
0 0
x x
1 AB 1
AB
0 0
Intersection x Union x

46
Properties of Fuzzy Sets

• Equality of two fuzzy sets


• Inclusion of one set into another fuzzy set
• Cardinality of a fuzzy set
• An empty fuzzy set
• -cuts (alpha-cuts)

47
Equality

• Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF (iff):


A(x) = B(x), xX

A = 0.3/1 + 0.5/2 + 1/3


B = 0.3/1 + 0.5/2 + 1/3

therefore A = B
48
Inclusion

• Inclusion of one fuzzy set into another fuzzy set. Fuzzy set A  X is
included in (is a subset of) another fuzzy set, B  X:
A(x)  B(x), xX

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

then A is a subset of B, or A  B

49
Cardinality

Cardinality of a non-fuzzy set, Z, is the number of elements in Z. BUT


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,
A(x):
cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n

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
50
Empty Fuzzy Set

• A fuzzy set A is empty, IF AND ONLY IF:


A(x) = 0, xX

Consider X = {1, 2, 3} and set A

A = 0/1 + 0/2 + 0/3


then A is empty

51
Alpha-cut

The α-cut of a fuzzy set A, denoted Aα, is a subset of X consisting of


all the elements in X defined by A  X, such that:

This means that the fuzzy set Aα contains all elements with a
membership of α ∈ [0, 1] and
higher, called the α-cut of the membership function

52
Alpha-cut

53
Fuzzy Set Normality

• A fuzzy subset of X is called normal if there exists at least one element xX
such that A(x) = 1.

• A fuzzy subset that is not normal is called subnormal.

• All crisp subsets except for the null set are normal. In fuzzy set theory, the
concept of nullness essentially generalises to subnormality.

• The height of a fuzzy subset A is the large membership grade of an element in


A
height(A) = maxx(A(x))

54
Fuzzy Sets Core and Support
• Assume A is a fuzzy subset of X:
• the support of A is the crisp subset of X consisting of all elements
with membership grade:
supp(A) = {x A(x)  0 and xX}
• the core of A is the crisp subset of X consisting of all elements with
membership grade:
core(A) = {x A(x) = 1 and xX}

55
Singleton

A fuzzy set whose support is a single point in X at which


μA(x) = 1 is called a singleton

56
Crossover Point

A crossover point of a fuzzy set A is a point x ∈ X at which μA(x) = α with α


∈ [0, 1]:

The crossover point of the membership function A with B is at 0.5. In other


words, it is the overlap of two neighboring membership functions.
A triangular MF has three features by which it can be parameterized: the
peak, left width
and right width. These are the anchor points of the three corners of a
triangular MF

57
DeMorgan Law

• Any fuzzy set A∼ defined on a universe x is a subset of that universe. The


membership value of any element x in the null set φ is 0, and the
membership value of any element x in the whole set x is 1. This statement is
given by
• De Morgan’s laws stated for classical sets also hold for fuzzy sets, as
denoted by these expressions.

58
Properties of Fuzzy Sets

59
Properties of Fuzzy Sets

60
Properties of Fuzzy Sets

61
Properties of Fuzzy Sets

62
Properties of Fuzzy Sets

63
64
65
66
67
68
69
Exercises

For
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 70
Solutions

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}
71
Solutions
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} 72

You might also like