Vous êtes sur la page 1sur 50

Fuzzy Logic

Dra. Masun Nabhan Homsi


mnabhan@ldc.usb.ve

Bivalent and Multivalent Logics


Bivalent logics:
true or false

Multivalent logic:
true, false, and undetermined.
0 to represent false, 1 to represent true, and to
use real numbers between 0 and 1 to represent
degrees of truth.

Linguistic Variables
A linguistic variable is a concept
height, which can have a value from a range of
fuzzy values including tall, short, and
medium.

Universe of discourse:
height : 2 feet up to 8 feet.
tall, short, and medium: subsets of this
universe of discourse

Fuzzy Sets
A crisp set can be defined by the values that
are contained within it.
the set of natural numbers is a crisp set: 1, 2, 3,
4,, are definitely members of the set of natural
numbers.
Mary is 22 years old
Dana is 3 years older than Mary.
Dana is (22 + 3) years old

Fuzzy Sets
set of tall people.
Bill is 7 feet tall=> belongs to set of tall people.
John is only 4 feet tall =>most would say that he is not
included in the set.
Jane, who is 5 feet 10 inches tall? Some would
certainly say she is tall, but others would say she is
not.

The fuzzy set of tall people contains Bill, and it


also contains Jane, and it even contains John.
Each is a member of the set to some degree and
is not a member of the set to some degree.

Fuzzy Sets

Fuzzy Sets

Fuzzy Set Membership Functions


A fuzzy set A is defined by its membership
function,MA.
we might define the membership functions for
the fuzzy sets B and C (baby and child) as
follows:

Fuzzy Set Membership Functions


To represent a fuzzy set: a list of pairs.
A = {(x1,MA(x1)), . . . , (xn,MA(xn))}
B = {(0, 1), (2, 0)}
C = {(1, 0), (7, 1), (8, 1), (14, 0)}

Fuzzy Set Operators


the set Not A is the same as A.
The intersection of A and B is the same as the
conjunction of A and B: A B.
The union of A and B is the same as the
disjunction of A and B: A B.
the set operators are commutative, associative,
and distributive. They obey DeMorgans laws.
(A B) = A B
(A B) = A B

Fuzzy Set Operators


The complement of fuzzy set A, whose
membership function is MA is defined as:
MA(x) = 1- MA(x)
we could define the set of not-babies, B, as
follows:
MB(x) = 1 - MB(x) => B = {(0, 0), (2, 1)

we can define C:
C = {{(1, 1), (7, 0), (8, 0), (14, 1)}

Fuzzy Set Operators


fuzzy intersection of two sets as being the
minimum of the fuzzy membership functions for
the sets.
MA B (x) = MIN (MA (x),MB (x))

B = {(0, 1), (1, 0.5), (2, 0), (7, 0), (8, 0), (14, 0)}
C = {(0, 0), (1, 0), (2, 0.166), (7, 1), (8, 1), (14, 0)}
B C = {(0, 0), (1, 0), (2, 0), (7, 0), (8, 0), (14, 0)}

Clearly we need to define the set using values


that will correctly define the ranges. In other
words, we can correctly define B C as follows:
B C = {(1, 0), (1.75, 0.125), (2, 0)}

Fuzzy Set Operators


the union of two fuzzy sets A and B as follows:
MA B (x) = MAX (MA (x),MB (x))
B C = {(0, 1), (1.75, 0.25), (7, 1), (8, 1), (14, 0)}

Fuzzy Set Operators


final fuzzy set operatorcontainment:
To see how fuzzy subsets work, let us consider a new fuzzy
set, P, which is the fuzzy set of pensioners. Let us suppose in
this case that we are considering the universe of people to
range over the ages between 0 and 100.
The intersection of A and P, A P, can be seen clearly from
this diagram to be P. Hence, P is a subset of A, or A P.
The definition of fuzzy containment is as follows:
B A iff x (MB (x) MA (x))

Fuzzy Sets- Hedges


A hedge is a fuzzy set qualifier, such as very,
quite, extremely, or somewhat.When
one of these qualifiers is applied to a fuzzy set,
such as tall people, we produce a new set.
For example, by applying the very hedge to
tall people, we produce a subset of tall
people called very tall people.
quite tall people or somewhat tall
people.

Hedges
Often a hedge is applied by raising the sets
membership function to an appropriate
power.
For example, it is common to consider the very
hedge to square the value of the membership
function.
if MA is the membership function for fuzzy set A of
tall people, then the membership function for VA,
the fuzzy set of very tall people is
MVA (x) = (MA (x))2

Fuzzy Sets- Hedges


we can define hedges such as quite, somewhat, and
extremely, as raising the membership function to
powers of 1.3, 0.5, and 4, respectively.
if Jane has a fuzzy membership value of the tall
people set of 0.6, then she has a membership value of
very tall people of 0.62 = 0.36;
A membership value of quite tall people of 0.61.3 =
0.515;
a membership value of somewhat tall people of
0.60.5 = 0.775;
a membership value of extremely tall people of 0.64
= 0.1296.

Fuzzy Logic
Each fuzzy variable can take a value from 0
(not at all true) to 1 (entirely true) but can also
take on real values in between. Hence, 0.5
might indicate somewhat true, or about as
true as it is false.
A B MAX (A, B)
A B MIN (A, B)
A 1 - A

Fuzzy Logic

Fuzzy Logic
fuzzy logical implication:
AB A B => AB MAX ((1 A), B)

0.5 0 = 0.5. This is somewhat counterintuitive because we


would expect 0.5 0 = 0. Also, we have the counterintuitive
statement that 0.5 0.5 = 0.5, whereas we would expect 0.5
0.5 = 1.

Fuzzy Logic
Gdel implication
AB (A B) B

Fuzzy Rules
A normal rule:
IF A THEN B

A fuzzy rule has the form:


IF A op x then B = y

IF temperature > 50 then fan speed = fast


IF height = tall then trouser length = long
IF study time = short then grades = poor

Fuzzy Inference
Mamdani inference allows a system to take in
a set of crisp input values and apply a set of
fuzzy rules to those values, in order to derive a
single, crisp, output value or action
recommendation.
Mamdani inference was invented by Professor
Ebrahim Mamdani in the 1970s and was used
by him to control a steam engine and boiler.

Fuzzy Inference
consider an imaginary medical system
designed to recommend a dose of quinine to a
patient or doctor based on the likelihood that
that patient might catch malaria while on
vacation.

Fuzzy Inference
1. Defining the Fuzzy Sets or linguistic variables
average temperature of destination (T)
average humidity of destination (H)
proximity to large bodies of water (P)
industrialization of destination (I)
Temperature, humidity, and industrialization
can be high (H) or low (L), and proximity to
water can be near (N) or far (F).

Fuzzy Inference
The crisp values that we will allow as inputs
will range :
from 0 to 100 for temperature, humidity, and
industrialization, and
from 0 to 50 for proximity to water.

Fuzzy Inference
membership functions
Input variables:

Fuzzy Inference

Fuzzy Inference

Fuzzy Inference

Fuzzy Inference
membership functions
Output variables: dose of quinine which can
take on one of three values:
very low dose (V)
low dose (L)
high dose (H)

Fuzzy Inference

Fuzzy Inference
2-Defining Fuzzy Rules

Fuzzy Inference
3-Relating Observations to Fuzzy Sets
five individuals, each of whom is traveling to a
country that is at risk from malaria.
The crisp data are as follows:
temperature = {80, 40, 30, 90, 85}
humidity = {10, 90, 40, 80, 75}
proximity to water = {15, 45, 20, 5, 45}
industrialization = {90, 10, 15, 20, 10}

Fuzzy
Inference

Fuzzy Inference
In a similar fashion, we can obtain membership values for the
other four travelers, which results in the following:

Fuzzy Inference
4-Evaluating Each Case for the Fuzzy Rules

Fuzzy Inference
0
0.1

Fuzzy Inference

to combine Rules 1 and 3, which each give values for the highdose fuzzy
set, we will take the maximum value, thus obtaining the following values
for high dose from these two rules:

Defuzzification
Obtaining a crisp dosage recommendation
for each traveler.
Traveler 1:

Defuzzification

Defuzzification

Defuzzification
Traveler 2:

Defuzzification

MEMBERSHIP FUNCTIONS

Triangular function

Trapezoidal function

Trapezoidal function
R-Function

Trapezoidal function
L-Function

Gaussian function

Vous aimerez peut-être aussi