# Fuzzy Logic

This page is best viewed with Netscape 7+ or IE or Firefox.

Fuzzy logic is a relatively new scientific field which is found within the intersection of mathematics, computer science, and engineering. The structures in fuzzy logic attempt to capture the "fuzziness," or imprecision of the real world, a feat which classical mathematics only touches on in the field of probability. Applications have included

• control of small devices (such as toasters and cameras);
• control of large systems (such as cement kilns, subways, and nuclear power plants);
• computer programs that learn;
• pattern recognition (such as speech and handwriting).

To understand fuzzy mathematics, first remember some of the rules of classical logic and set theory:

1. every statement is either true or false;
2. no statement is both true and false;
3. the union of a subset and its complement comprise the entire universal set;
4. a subset and its complement have empty intersection.
Classical sets are called crisp sets, and you can see from the above rules that both statements and sets have "crisp" boundaries: true or false, in or out.

Raise your hand if you are over six feet tall. Put your hand down. Now raise your hand if you ate meat or fish yesterday. You should have had no trouble with either of these questions: your hand was up or down. But consider the following -- raise your hand if

• you drive fast;
• you like jazz;
• replace "jazz" with classical, country, alternative, or ska.
At least some people will have trouble deciding whether to raise a hand for one or more of these questions. Did your hand ever go part way up? Classical mathematics takes two approaches with questions of this type. Usually, they are dismissed as not belonging to mathematics at all. We say the terms are not well-defined. But in probability and statistics, they are answered by saying "The probability of a person's liking jazz is 0.55," or "Results of a recent survey indicate that 55% of people like jazz." These are the issues that fuzzy logic meets head on.

In the age of computers and binary arithmetic, it is not a big leap to replace yes/no or true/false answers with 1/0 answers. Crisp subset membership can be described by a binary function on the universal set. For example, let X = {0,1,2,3,4,5} be the universal set. The crisp subset {0,1,2}, can be described by the function f : X → {0,1} defined by

A Crisp Subset:
x f(x)
0 1
1 1
2 1
3 0
4 0
5 0

Fuzzy logic allows for answers between 0 and 1. A fuzzy subset of X is defined as a function f : X → [0,1]. That is, answers and "degrees of set membership" can be fractions. Statements can be "sort of true" or "mostly false" and elements can be "partially in" a set. Modifying the above example, we can define a fuzzy subset of "small numbers" in X as a function like this:

A Fuzzy Subset:
x f(x)
0 1
1 0.7
2 0.3
3 0.05
4 0
5 0

Thus, 0 is definitely small, 1 is pretty small, 2 is sort of small, 3 is really not very small, and 4 and 5 are not at all small. Fuzzy logic allows us to use the "fuzzy" terminology that we find so useful in ordinary human discourse.

You may find it surprising that fuzzy logic could excite so many computer scientists and engineers. How can something so vague (even arbitrary?), make better toast? Should we trust our safety to a nuclear power plant run by a system that allows imprecision? Remember that in the everyday world, there is no such thing as complete precision. Everything is an approximation because of the limitations of our measuring tools. Before 1980 or so, the control of sophisticated machines, from robots to rockets, relied almost exclusively on numerical (approximate) solutions to differential equations. These solutions are time-consuming, even with super computers, and there is always a trade-off between the degree of accuracy desired and the time frame in which the solution is needed. In robotics, for example, many different kinds of motions are needed in quick succession; there is just not time to wait for computer-generated solutions to differential equations. It has been found that the mathematics of fuzzy logic allows much simpler and faster calculations with amazingly effective results.

During the summer of 2000 I taught fuzzy logic in the Summer Program for Women Undergraduates at Carleton and St. Olaf Colleges. The four-week course was an introduction to the mathematics of fuzzy sets and fuzzy arithmetic. I used the book Fuzzy Sets and Fuzzy Logic by George Klir and Bo Yuan. This could be a graduate text for computer scientists or engineers, but chapters 1, 2, and 4 seemed suitable for beginning math majors.