shodZ

Sunday, December 26, 2004

fuZZy

Fuzzy logic is a superset of boolean logic dealing with the concept of partial truth. Whereas classical logic holds that everything can be expressed in binary terms (0 or 1, black or white, yes or no), fuzzy logic replaces boolean truth values with degrees of truth which are very similar to probabilities, except they need not add up to 100%. This allows for values between 0 and 1, shades of gray, and the concept of "maybe". Specifically, it allows partial membership in a set. It is related to Fuzzy sets and possibility theory.
In logic, the principle of bivalence is that for any proposition P, either P is true or P is false. In classical logic and fuzzy logic, the principle of bivalence is equivalent to the result that there are no propositions that are neither true nor false. This follows because any statement has to have a truth value, such as true, false, or if neither of those hold, it has to have a third truth value (which is the fuzzy logic way out). In intuitionisitic logic, a conjecture is true if proved. It is false if shown to lead to a contradiction. One can say that it is either true or false if there is a method which is guaranteed to decide the question in a finite number of steps, even if it hasn't been decided yet. If none of those apply, one can't say anything at all about the truth/falsity. One then leaves it at that.
However, fuzzy logic is not any less precise than any other form of logic: it is an organized and mathematical method of handling inherently imprecise concepts. The concept of "coldness" cannot be expressed in an equation, because although temperature is a quantity, "coldness" is not. However, people have an idea of what "cold" is, and agree that something cannot be "cold" at N degrees but "not cold" at N+1 degrees — a concept classical logic cannot easily handle due to the principle of bivalence.
Another common misconception is that fuzzy logic is a new way of expressing probability. However, Bart Kosko has shown that probability is a subset of fuzzy logic, as probability only handles one kind of uncertainty. He also proved a theorem demonstrating that Bayes' theorem can be derived from the concept of fuzzy subsethood. This should not by any means suggest that all those who study probability accept or even understand fuzzy logic, however: to many, fuzzy logic is still a curiosity.
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, the 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.
References
Fuzzy sets are an extension of the classical set theory used in Fuzzy logic. A fuzzy set is characterized by a membership-degree function, which maps the members of the Universe into the unit interval [0,1]. The value 0 means that the member is not included in the given set, 1 describes a fully included member (this behaviour corresponds to the indicator function of classical sets). The values between 0 and 1 characterize fuzzy members. For the universe X and given the membership-degree function f : X?[0,1], the fuzzy set A is defined as A = {(x, f(x)) | x ? X}
Fuzzy associative matrix
Defuzzification is the process of producing a quantifiable result in fuzzy logic. Typically, a fuzzy system will have a number of rules that transform a number of variables into a "fuzzy" result, that is, the result is described in terms of membership in fuzzy sets. For example, rules designed to decide how much pressure to apply might result in "Decrease Pressure (15%), Maintain Pressure (34%), Increase Pressure (72%)". Defuzzification would transform this result into a single number indicating the change in pressure. The simplest but least useful defuzzification method is to choose the set with the highest membership, in this case, "Increase Pressure" since it has a 72% membership, and ignore the others, and convert this 72% to some number. The problem with this approach is that it loses information. The rules that called for decreasing or maintaining pressure might as well have not been there in this case. A useful defuzzification technique must first add the results of the rules together in some way. The most typical fuzzy set membership function has the graph of a triangle. Now, if this triangle were to be cut in a straight horizontal line somewhere between the top and the bottom, and the top portion were to be removed, the remaining portion forms a trapezoid. The first step of defuzzification typically "chops off" parts of the graphs to form trapezoids (or other shapes if the initial shapes were not triangles). For example, if the output has "Decrease Pressure (15%)", then this trangle will be cut 15% the way up from the bottom. In the most common technique, all of these trapezoids are then superimposed one upon another, forming a single geometric shape. Then, the centroid of this shape, called the fuzzy centroid, is calculated. The x coordinate of the centroid is the defuzzified value.
Fuzzy Control Languaage