Artificial Intelligence - 2 PDF
Artificial Intelligence - 2 PDF
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
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?
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)
Intersection
Crisp sets: Which element belongs to both sets?
Fuzzy sets: How much of the element is in both sets?
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)
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.
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.
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:
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.
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: