0% found this document useful (0 votes)
110 views13 pages

Artificial Intelligence - 2 PDF

This document discusses linguistic variables, fuzzy sets, and fuzzy logic. It defines linguistic variables as fuzzy variables that can take linguistic values like "tall" or "fast". It describes how linguistic variables have universes of discourse made up of fuzzy subsets. It also discusses hedges that modify fuzzy sets, and operations on fuzzy sets like complement, intersection, and union. The document provides examples of fuzzy rules and fuzzy reasoning using Mamdani-style inference.

Uploaded by

HavotAlbeyboni
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)
110 views13 pages

Artificial Intelligence - 2 PDF

This document discusses linguistic variables, fuzzy sets, and fuzzy logic. It defines linguistic variables as fuzzy variables that can take linguistic values like "tall" or "fast". It describes how linguistic variables have universes of discourse made up of fuzzy subsets. It also discusses hedges that modify fuzzy sets, and operations on fuzzy sets like complement, intersection, and union. The document provides examples of fuzzy rules and fuzzy reasoning using Mamdani-style inference.

Uploaded by

HavotAlbeyboni
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/ 13

Linguistic variables and hedges

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.

IF speed is slow
THEN stopping_distance is short

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 220km per hour and may include such fuzzy subsets as very
slow, slow, medium, fast, and very fast. Each fuzzy subset also represents a linguistic value
of the corresponding linguistic variable.
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.
 All-purpose modifiers, such as very, quite or extremely.
 Truth-values, such as quite true or mostly false.
 Probabilities, such as likely or not very likely.
 Quantifiers, such as most, several or few.
 Possibilities, such as almost impossible or quite possible.

Following figure shows an application of hedges. Consider, for example, a man who is
185cm tall. He is a member of the tall men set with a degree of membership of 0.5.
However, he is also a member of the set of very tall men with a degree of 0.15, which is
fairly reasonable.
Very: The operation of concentration (very) narrows a set down and thus reduces the degree
of membership of fuzzy elements.

Extremely: Extremely serves the same purpose as very, but does it to a greater extent. This

Very very: Very very is just an extension of concentration.

More or less: The operation of dilation (More or less) expands a set and thus increases the
degree of membership of fuzzy elements.

Indeed: The operation of intensification (Indeed) intensifies the meaning of the whole
sentence. It can be done by increasing the degree of membership above 0.5 and decreasing
those below 0.5.
Operations of fuzzy sets
Considering three fuzzy sets A, B, and C on universe of discourse X For a given element x of
the universe, four operations complement, containment, intersection and union are defined
as:

Complement
Crisp sets: Who does not belong to the set?
Fuzzy sets: How much do elements not belong to the set?

𝜇𝐴̅ (𝑥) = 1 − 𝜇𝐴 (𝑥)


Example:
tall men = (0/180,0.25/182.5,0.5/185,0.75/187.5,1/190)
NOT tall men = (1/180,0.75/182.5,0.5/185,0.25/187.5,0/190)

Containment
In crisp sets, all elements of a subset entirely belong to a larger set and their membership
values are equal to 1. 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.
𝐴 ⊂ 𝐵 ⇒ 𝜇𝐴 (𝑥) ≤ 𝜇𝐵 (𝑥)
𝐴 is a fuzzy subset of 𝐵

Example:
tall men = (0/180, 0.25/182.5, 0.50/185, 0.75/187.5, 1/190)
very tall men = (0/180, 0.06/182.5, 0.25/185, 0.56/187.5, 1/190)

Example: If 𝑋 = {1,2,3} and 𝐴, 𝐵, 𝑎𝑛𝑑 𝐶 are three fuzzy sets given by


0.1 0.5 1 0.1 0.4 0.9 0.1 0.6 1
𝐴={ },𝐵 = { },𝐶 = { }
1 2 3 1 2 3 1 2 3
𝑡ℎ𝑒𝑛 𝐵 ⊂ 𝐴, 𝐶 ⊄ 𝐴

Intersection
 Crisp sets: Which element belongs to both sets?
 Fuzzy sets: How much of the element is in both sets?

𝜇𝐴∩𝐵 (𝑥) = 𝑚𝑖𝑛[𝜇𝐴 (𝑥), 𝜇𝐵 (𝑥)] = 𝜇𝐴 (𝑥) ∩ 𝜇𝐵 (𝑥), 𝑤ℎ𝑒𝑟𝑒 𝑥 ∈ 𝑋

Example, the fuzzy sets of tall and average men:


tall men = (0/165,0/175,0.0/180,0.25/182.5,0.5/185,1/190)
average men =(0/165,1/175,0.5/180,0.25/182.5,0.0/185,0/190)
tall men ∩ average men = (0/165,0/175,0/180,0.25/182.5,0/185,0/190)
or = (0/180,0.25/182.5,0/185)

Union
 Crisp sets: Which element belongs to either set?
 Fuzzy sets: How much of the element is in either set?
𝜇𝐴∪𝐵 (𝑥) = 𝑚𝑎𝑥[𝜇𝐴 (𝑥), 𝜇𝐵 (𝑥)] = 𝜇𝐴 (𝑥) ∪ 𝜇𝐵 (𝑥), 𝑤ℎ𝑒𝑟𝑒 𝑥 ∈ 𝑋

Example:
tall men = (0/165,0/175,0.0/180,0.25/182.5,0.5/185,1/190)
average men =(0/165,1/175,0.5/180,0.25/182.5,0.0/185,0/190)
tall men ∪ average men = (0/165,1/175,0.5/180,0.25/182.5,0.5/185,1/190)

Properties of fuzzy sets


Commutativity
𝐴∪𝐵 =𝐵∪𝐴
𝐴∩𝐵 =𝐵∩𝐴
Associativity
𝐴 ∪ (𝐵 ∪ 𝐶) = (𝐴 ∪ 𝐵) ∪ 𝐶
𝐴 ∩ (𝐵 ∩ 𝐶) = (𝐴 ∩ 𝐵) ∩ 𝐶
Distributivity
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
Idempotency
𝐴∪𝐴 =𝐴
𝐴∩𝐴 =𝐴
Identity
𝐴∪𝛷 =𝐴
𝐴∩𝑋 =𝐴
𝐴∩𝛷 =𝛷
𝐴∪𝑋=𝑋
Involution
𝐴̅ = 𝐴
Transitivity
𝑖𝑓 𝐴 ⊂ 𝐵 ⊂ 𝐶 𝑡ℎ𝑒𝑛 𝐴 ⊂ 𝐶

Fuzzy rules
A fuzzy rule can be defined as a conditional statement in the form:
IF x is A
THEN y is B
where x and y are linguistic variables; and A and B are linguistic values determined by fuzzy
sets on the universe of discourses X and Y, respectively.
Rule: 1
IF speed is fast
THEN stopping_distance is long
Rule: 2
IF speed is slow
THEN stopping_distance is short

The linguistic variable speed has the range (the universe of discourse) between 0 and 220
km/h, and this range includes fuzzy sets, such as slow, medium and fast. The universe of
discourse of the linguistic variable stopping_distance can be between 0 and 300m and may
include such fuzzy sets as short, medium and long. Thus fuzzy rules relate to fuzzy sets.

Fuzzy reasoning includes two distinct parts: evaluating the rule antecedent (the IF part of the
rule) and implication or applying the result to the consequent (the THEN part of the rule).
In classical rule-based systems, if the rule antecedent is true, then the consequent is also
true.
In fuzzy systems, where the antecedent is a fuzzy statement, all rules fire to some extent, or in
other words they fire partially. If the antecedent is true to some degree of membership, then
the consequent is also true to that same degree.

Example, two fuzzy sets, ‘tall men’ and ‘heavy men’ represented in the following figure:

IF height is tall
THEN weight is heavy
Following figure shows how various values of men’s weight are derived from different
values for men’s height. Here, monotonic selection method is used.

The antecedent a fuzzy rule with multiple parts


IF project_duration is long
AND project_staffing is large
AND project_funding is inadequate
THEN risk is high
IF service is excellent
OR food is delicious
THEN tip is generous
The consequent of a fuzzy rule have multiple parts
IF temperature is hot
THEN hot_water is reduced;
cold_water is increased

Fuzzy inference
Fuzzy inference can be defined as a process of mapping from a given input to an output,
using the theory of fuzzy sets.
Mamdani-style inference
The most commonly used fuzzy inference technique is the so-called Mamdani method. In
1975, Professor Ebrahim Mamdani of London University built one of the first fuzzy systems
to control a steam engine and boiler combination. He applied a set of fuzzy rules supplied by
experienced human operators.
Fuzzy inference process
 fuzzification of the input variables
 rule evaluation
 aggregation of the rule outputs
 defuzzification.
Example: a simple two-input one output problem that includes three rules:

where x, y and z (project funding, project staffing and risk) are linguistic variables; A1, A2
and A3 (inadequate, marginal and adequate) are linguistic values determined by fuzzy sets on
universe of discourse X (project funding); B1 and B2 (small and large) are linguistic values
determined by fuzzy sets on universe of discourse Y (project staffing); C1, C2 and C3 (low,
normal and high) are linguistic values determined by fuzzy sets on universe of discourse Z
(risk). The basic structure of Mamdani-style fuzzy inference for our problem is shown in the
following figure.
Step 1: Fuzzification
Various fuzzy systems use a variety of different crisp inputs. While some of the inputs can
be measured directly (height, weight, speed, distance, temperature, pressure etc.), some of
them can be based only on expert estimate.
In this example, the ranges of the universe of discourses can be determined by expert
judgments. Values of x1 and y1 are limited to the universe of discourses X and Y,
respectively.
For instance, if we need to examine the risk involved in developing the ‘fuzzy’ project, we
can ask the expert to give numbers between 0 and 100 per cent that represent the project
funding and the project staffing, respectively.
The crisp input x1 (project funding rated by the expert as 35 per cent) corresponds to the
membership functions A1 and A2 (inadequate and marginal) to the degrees of 0.5 and 0.2,
respectively.
The crisp input y1 (project staffing rated as 60 per cent) maps the membership functions B1
and B2 (small and large) to the degrees of 0.1 and 0.7, respectively.

Step 2: Rule evaluation


Apply fuzzified inputs to the antecedents of the fuzzy rules.
If a given fuzzy rule has multiple antecedents, the fuzzy operator (AND or OR) is used to
obtain a single number that represents the result of the antecedent evaluation. This number
(the truth value) is then applied to the consequent membership function.
The MATLAB Fuzzy Logic Toolbox has two built-in OR methods: max and the
probabilistic OR method, probor.
Max method:

The probabilistic OR, also known as the algebraic sum, is calculated as:

The MATLAB Fuzzy Logic Toolbox has also two built-in AND methods: min and the
product, prod.
Min method:

The product, prod:


Different methods may lead to different results:

Then the result of the antecedent evaluation can be applied to the membership function of
the consequent. In other words, the consequent membership function is clipped or scaled to
the level of the truth value of the rule antecedent.

Clipping or correlation minimum: Simply cut the consequent membership function at the
level of the antecedent truth.
Scaling or correlation product: The original membership function of the rule consequent is
adjusted by multiplying all its membership degrees by the truth value of the rule antecedent.

Step 3: Aggregation of the rule outputs


Aggregation is the process of unification of the outputs of all rules. In other words, we take
the membership functions of all rule consequents previously clipped or scaled and combine
them into a single fuzzy set.
Step 4: Defuzzification
The input for the defuzzification process is the aggregate output fuzzy set and the output is a
single number.
Most popular defuzzification method is the centroid technique. It finds the point where a
vertical line would slice the aggregate set into two equal masses.
Mathematically this method is called centre of gravity (COG) and can be expressed as

In theory, the COG is calculated over a continuum of points in the aggregate output
membership function, but in practice, a reasonable estimate can be obtained by calculating it
over a sample of points:

For our problem COG calculated as

You might also like