False Statements.: The Fuzzy Logic Concept The Way That People Think Is Inherently Fuzzy

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

The Fuzzy Logic Concept: The way that people think is inherently fuzzy.

The way that we perceive the world is continually changing and cannot always be defined in true or
false statements.

Take for example the set of all the apples and all the apple cores in the world.

Now take one of those apples

it belongs to the set of all apples

Now take a bite out of that apple

it is still an apple right?

If so, it still belongs to the set of apples.

After several more bites have been taken and you are left with an apple core and it belongs to the set
of apple cores.

At what point did the apple cross over from being an apple to being an apple core?

What if you could get one more bite out of that apple core, does that move it into a different set?

The definition of the apple and apple core sets are too strictly defined when looking at the process of
eating an apple.

The area between the two sets is not clearly defined since the object cannot belong to the set of
apples and apple cores because, by definition, an apple core is NOT an apple.

The *sets defining apples and apple cores need to be redefined as fuzzy sets .

A fuzzy set allows for its members to have degrees of membership.

If the value of 1 is assigned to objects entirely within the set and a 0 is assigned to objects outside of
the set,

then any object partially in the set will have a value between 0 and 1.

The number assigned to the object is called its degree of membership in the set. So an apple with one
bite out of it may have a degree of membership of 0.9 in the set of apples.

This does not mean that it has to have a degree of membership of 0.1 in the set of
apple cores though.

However as the apple is eaten it looses its membership in the fuzzy set of apples and gains
membership in the fuzzy set of apple cores.

Application areas:

Automobile and other vehicle subsystems, such as automatic transmissions, ABS and cruise
control (e.g. Tokyo monorail)
Air conditioners
The Massive engine used in the Lord of the Rings films, which helped show huge scale armies
create random, yet orderly movements
Cameras
Digital image processing, such as edge detection
Rice cookers
Dishwashers
Elevators
Washing machines and other home appliances
Video game AI
Language filters on message boards and chat rooms for filtering out offensive text
Pattern recognition in Remote Sensing
Fuzzy logic has also been incorporated into some microcontrollers and microprocessors, for
instance, the Freescale 68HC12.

In mathematics a set, by definition, is a collection of things that belong to some definition.

Any item either belongs to that set or doesn't belong to that set.

Let us look at another example; the set of tall men. We shall say that people taller than or equal to 6
feet are tall. This set can be represented graphically as follows:

The function shown above describes the membership of the 'tall' set, you are either in it or you are not
in it.

This sharp edged membership functions works nicely for binary operations and mathematics,

but it doesn't work as nicely in describing the real world.

The membership function makes no distinction between somebody who is 6'1" and someone who is
7'1", they are both simply tall.

Clearly there's a significant difference between the two heights.

The other side of this lack of distinction is the difference between a 5'11" and 6' man.

This is only a difference of one inch, however this membership function just says one is tall and the
other is not tall.

The fuzzy set approach to the set of tall men provides a much better representation of the tallness of
a person. The set,shown below, is defined by a continuously inclining function.
The membership function defines the fuzzy set for the possible values underneath of it on the
horizontal axis.
The vertical axis, on a scale of 0 to 1, provides the membership value of the height in the fuzzy
set.

So for the two people shown above the first person has a membership of 0.3 or less so he is not very
tall. The second person has a membership of 0.95 or more so he is definitely tall.

He does not, however, belong to the set of tall men in the way that bivalent sets work; he has a high
degree of membership in the fuzzy set of tall men.

if taller than (180) he takes (1) in crisp (0) if smaller


If the Value of [x] belongs to [A] Then (1)

If the Value of [x] doesn't belong to [A] Then (0)


The value depends on the membership function mapping values from (1-0)

in crisp set:

a belongs to A
b doesn't belong to A

in fuzzy set:

a belongs to A
b doesn't belong to A
c partialy belongs to A
member ship function of (-2) is 0
member ship function of (-1) is 0.3
member ship function of (0) is 0.6
member ship function of (1) is 1
member ship function of (2) is 0.6
member ship function of (3) is 0.3
member ship function of (4) is 0

The func will be continuous


Union is the max
Intersect is the min
Complement is the difference

Fuzzy sets were first proposed by Lofti A. Zadeh in his 1965 paper entitled none other than: Fuzzy
Sets.

This paper laid the foundation for all fuzzy logic that followed by mathematically defining fuzzy sets
and their properties.

The definition of a fuzzy set then, from Zadeh's paper is:

Let X be a space of points,

with a generic element of X denoted by x.

Thus X = {x}

A fuzzy set A in X is characterized by a membership function fA(x) which associates with each point
in X a real number in the interval [0,1]

with the values of fA(x) at x representing the "grade of membership" of x in A

Thus, the nearer the value of fA(x) to unity, the higher the grade of membership of x in A.

This definition of a fuzzy set is like a superset of the definition of a set in the ordinary sense of the
term.

The grades of membership of 0 and 1 correspond to the two possibilities of truth and false in an
ordinary set.

The ordinary boolean operators that are used to combine sets will no longer apply;

we know that 1 AND 1 is 1, but what is 0.7 AND 0.3?

This will be covered in the fuzzy operations section.

Membership functions for fuzzy sets can be defined in any number of ways as long as they follow the
rules of the definition of a fuzzy set.

The Shape of the membership function used defines the fuzzy set and so the decision

on which type of membership function to use is dependant on the purpose.

The membership function choice is the subjective aspect of fuzzy logic, it allows the desired values to
be interpereted appropriatly.

The most common membership functions are shown below:


The things of the universe are not sliced off from one another with a hatchet, neither the hot from the
cold nor the cold from the hot.

-Anaxagoras-

Traditional Bivalent logic uses the boolean operators AND, OR, and NOT

to perform the intersect, union and complement operations.

These operators work well for bivalent sets and can be essentially defined using the following truth
table:

The truth table above works fine for bivalent logic but fuzzy logic does not have a finite set of
possibilities for each input.

This makes for an infinitely large truth table.

The operators need to be defined as functions for all possible fuzzy values, that is all real numbers
from 0 to 1 inclusive. Fuzzy logic is actually a superset of bivalent logic since it includes the bivalent
options (0,1)

as well as all reals in between, so a generalized form of these operators will be usefull.

The generalized form for these three operators are:

Using these definitions they can be applied to all of the bivalent combinations above as well as some
fuzzy number combinations. The truth table for this can be seen below:
Not always

Warning

The fuzzy set ∪ it's complement is not X(space of points)

0.2 ∪ 0.8 = 0.8 ≠ X

The fuzzy set ∩ it's complement is not ϕ

0.2 ∩ 0.8 = 0.2 ≠ ϕ


The Union is the bold line
In this image, cold, warm, and hot are functions mapping a temperature scale.

A point on that scale has three "truth values" — one for each of the three functions.

The vertical line in the image represents a particular temperature that the three arrows (truth values)
gauge.

Since the red arrow points to zero this temperature may be interpreted as not hot (at 0 not 1)
The orange arrow (pointing at 0.2) may describe it as slightly warm (away from 0)
blue arrow (pointing at 0.8) fairly cold (close to 1)

While variables in mathematics usually take numerical values,

in fuzzy logic applications, the non-numeric linguistic variables are often used to facilitate the
expression of rules and facts.

A linguistic variable such as age may have a value such as young or its opposite defined as old.

However, the great utility of linguistic variables is that they can be modified via linguistic operations on
the primary terms.

For instance, if young is associated with the value 0.7 then very young is automatically deduced as
having the value 0.7 0.7 = 0.49*

And not very young gets the value (1 - 0.49 = 0.51

In this example, the operator very(X) was defined as X ∗ X

however in general these operators may be uniformly,but flexibly defined to fit the application,
resulting in a great deal of power for the expression of both rules and fuzzy facts.

While variables in mathematics usually take numerical values,

in fuzzy logic applications, the non-numeric linguistic variables are often used to facilitate the
expression of rules and facts.

A linguistic variable such as age may have a value such as young or its opposite defined as old.

However, the great utility of linguistic variables is that they can be modified via linguistic operations on
the primary terms.

For instance, if young is associated with the value 0.7 then very young is automatically deduced as
having the value 0.7 0.7 = 0.49*

And not very young gets the value (1 - 0.49 = 0.51

In this example, the operator very(X) was defined as X ∗ X

however in general these operators may be uniformly,but flexibly defined to fit the application,
resulting in a great deal of power for the expression of both rules and fuzzy facts.

Fuzzy Set Theory defines Fuzzy Operators on Fuzzy Sets.

The problem in applying this is that the appropriate Fuzzy Operator may not be known. For this
reason, Fuzzy logic usually uses IF/THEN rules or constructs that are equivalent, such as fuzzy
associative matrices.

Rules are usually expressed in the form:

IF variable IS set THEN action For example,

an extremely simple temperature regulator that uses a fan might look like this:

IF temperature IS very cold THEN stop fan


IF temperature IS cold THEN turn down fan
IF temperature IS normal THEN maintain level
IF temperature IS hot THEN speed up fan

Notice there is no ELSE.

All of the rules are evaluated, because the temperature might be "cold" and "normal" at the same time
to differing degrees.

The AND, OR, and NOT operators of boolean logic exist in fuzzy logic, usually defined as the minimum,
maximum, and complement;

when they are defined this way, they are called the Zadeh operators, because they were first defined
as such in Zadeh's original papers.

So for the fuzzy variables x and y:

NOT x = (1 - truth(x))
x AND y = minimum(truth(x), truth(y))
x OR y = maximum(truth(x), truth(y))

There are also other operators, more linguistic in nature, called hedges that can be applied.

These are generally adverbs such as "very", or "somewhat", which modify the meaning of a set using
a mathematical formula.

In application, the programming language Prolog is well geared to implementing fuzzy logic with its
facilities to set up a database of rules which are queried to deduct logic.

This sort of programming is known as logic programming. Once fuzzy relations are defined, it is
possible to develop fuzzy relational databases.

The first fuzzy relational database [FRDB], appeared in Maria Zemankova's dissertation.

After, some other models arose like:

Buckles-Petry model,
the Prade-Testemale Model
the Umano-Fukami model or the GEFRED model by J.M. Medina,
M.A. Vila et al.

In the context of fuzzy databases, some fuzzy querying languages have been defined, highlighting

the SQLf by P. Bosc et al.


the FSQL by J. Galindo et al.

These languages define some structures in order to include fuzzy aspects in the SQL statements,
like:

fuzzy conditions
fuzzy comparators
fuzzy constants
fuzzy constraints
fuzzy thresholds
linguistic labels and so on

If a man is 1.8 meters

consider him as tall:

IF male IS true AND height >= 1.8 THEN is_tall IS true; is_short IS false

The fuzzy rules don't make the sharp distinction between tall and short, that is not so realistic
there must be some flexibility:
IF height <= medium male THEN is_short IS agree

somewhat

IF height >= medium male THEN is_tall IS

agree somewhat

In the fuzzy case, there are no such heights like 1.83 meters, but there are fuzzy values, like the
following assignments:

dwarf male = [0, 1.3]m


short male = (1.3, 1.5]
medium male = (1.5, 1.8]
tall male = (1.8, 2.0]
giant male > 2.0 m

For the consequent, there are also not only two values, but five say:

agree not = 0
agree little = 1
agree somewhat = 2
agree a lot = 3
agree fully = 4

In the binary, or crisp case, a person of 1.79 meters of height is considered medium.

If another person is 1.8 meters or 2.25 meters, these persons are considered tall.

The crisp example differs deliberately from the fuzzy one.

We did not put in the antecedent

IF male >= agree somewhat AND ...

as gender is often considered as a binary information (male,female)

So, it is not so complex as being tall.

#CI

To date, fuzzy expert systems are the most common use of fuzzy logic. They are used in several
wide-ranging fields, including:

Linear and nonlinear control


Pattern recognition
Financial systems

and many others.

What is a Fuzzy Expert System?

Put as simply as possible, a fuzzy expert system is an expert system that uses fuzzy logic instead of
Boolean logic.

In other words, a fuzzy expert system is a collection of membership functions and rules that are used
to reason about data.

Unlike conventional expert systems, which are mainly symbolic reasoning engines, fuzzy expert
systems are oriented toward numerical processing.

The rules in a fuzzy expert system are usually of a form similar to the following:

if x is low and y is high then z = medium


where x and y are input variables (names for known data values)

z is an output variable (a name for a data value to be computed)

low is a membership function fuzzy subset defined on x


high is a membership function defined on y
medium is a membership function defined on z

The part of the rule between the "if" and "then"

is the rule's premise or antecedent.

This is a fuzzy logic expression that describes to what degree the rule is applicable

The part of the rule following the "then"

is the rule's conclusion or consequent.

This part of the rule assigns a membership function to each of one or more output variables.

Most tools for working with fuzzy expert systems allows more than one conclusion per rule.

A typical fuzzy expert system has more than one rule.

The entire group of rules is collectively known as a (rule base or a knowledge base)

The Inference Process

With the definition of the rules and membership functions in hand,

we now need to know how to apply this knowledge to specific values of the input variables to
compute the values of the output variables.

This process is referred to as inferencing.

In a fuzzy expert system, the inference process is a combination of four subprocesses:

fuzzification
inference
composition
defuzzification

The defuzzification subprocess is optional.

For the sake of example in the following discussion,

assume that the variables X, Y, and Z all take on values in the interval [ 0, 10 ]

and that we have the following membership functions and rules defined below

low(t) = 1 - t / 10 ; 0 <= t <= 10


high(t) = t / 10
fig: Membership functions for LOW and HIGH fuzzy sets.

rule 1: if X is low and Y is low then Z is high


rule 2: if X is low and Y is high then Z is low
rule 3: if X is high and Y is low then Z is low
rule 4: if X is high and Y is high then Z is high

Notice that instead of assigning a single value to the output variable Z, each rule assigns an entire
fuzzy subset

(low or high).

Notes:

1. In this example, low(t)+high(t)=1.0 for all t

This is not required, but it is fairly common.


2. The value of t at which low(t) is maximum is the same as the value of t at which high(t) is
minimum, and vice-versa

This is also not required, but fairly common.


3. The same membership functions are used for all variables

This isn't required, and is also not common.

Let: X = 0.0 and Y = 3.2

Find the fuzzy membership function of the output variable Z, and hence find its crisp value.

To solve this example, the following four steps should be done in sequence.

Step 1: Fuzzification

In the fuzzification subprocess, the membership functions defined on the input variables are applied
to their actual values, to determine the degree of truth for each rule premise. If a rule's premise has a
nonzero degree of truth (if the rule applies at all...) then the rule is said to fire.
Note that to compute µL(X) and µL(Y) we substitute in the equation {low(t) = 1 - t / 10} using values
of {t} equals 0.0 & 3.2 respectively

Similarly to compute µH (X) and µH (Y) we substitute in the equation {high(t) = t / 10} using the same
values of {t}.

Sometimes it is easier to have the membership functions in a tabulated form, and you just look-up
the given tables.

Step 2: Inference

In the inference subprocess, the truth value for the premise of each rule is computed, and applied to
the conclusion part of each rule.

This results in one fuzzy subset to be assigned to each output variable for each rule.

The table below shows that we get µH (Z) = 0.68 from rule 1, and µL(Z) = 0.32 from rule 2.

There are two [inference methods] or [inference rules]: [MIN] and [PRODUCT].

In MIN inferencing, the output membership function is clipped off at a height corresponding to
the rule premise's computed degree of truth.

This corresponds to the traditional interpretation of the fuzzy logic AND operation

In PRODUCT inferencing, the output membership function is scaled by the rule premise's
computed degree of truth.

For example, let's look at rule 1 for x = 0.0 and y = 3.2.

As shown in the table above, the premise degree of truth works out to 0.68

For this rule, MIN inferencing will assign z the fuzzy subset defined by the membership function (refer
also to Fig. 2):

Note: In most texts, the term inference method is used to

mean the combination of the things I'm referring to separately here as "inference" and "composition."

Therefore, you'll see terms such as "MAX-MIN inference" and "SUM-PRODUCT inference" in the
literature.
They mean the combination of MAX composition and MIN inference, or SUM composition and
PRODUCT inference respectively,

to use my terminology.

You'll also see the reverse terms "MIN-MAX" and "PRODUCT-SUM"

these mean the same things as the reverse order. I think it's clearer to describe the two processes
separately.

Using the MIN inferencing method, the components of µ(Z) obtained from both rule 1 and rule 2 are
shown in Fig.2.

Both rule 3 and rule 4 are not fired because their premises has a zero degree of truth, and hence
they will not add any component to µ(Z).

The following are the equations for the four components of the output membership function µ(Z).

Fig. 2: Membership function of the output Z using rule #1, #2 with MIN inference.

For the same conditions (rule 1: x = 0.0 and y = 3.2),

PRODUCT inferencing will assign Z the fuzzy subset defined by the membership function:

µ(Z) {from rule1} = 0.68 * high(Z);


and = 0.068 * Z

Step 3- Composition

In the composition subprocess, all of the fuzzy subsets assigned to each output variable are
combined together to form a single fuzzy subset for each output variable.

There are two common composition rules: MAX composition and SUM composition.
Note that the SUM composition can result in truth values greater than one! For this reason, SUM
composition is only used when it will be followed by a defuzzification method, such as the
CENTROID method,

that doesn't have a problem with this odd case.


Step 4- Defuzzification
The last line takes MIN∧ then MAX∨

Main diagonal allways equalls to 1.


The relation between the element & it self.
Calculate the distance & the angel between the robot & the obstacle

You might also like