Fuzzy Logic Toolbox    

Foundations of Fuzzy Logic

Everything is vague to a degree you do not realize till you have tried to make it precise. -- Bertrand Russell

Fuzzy Sets

Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp, clearly defined boundary. It can contain elements with only a partial degree of membership.

To understand what a fuzzy set is, first consider what is meant by what we might call a classical set. A classical set is a container that wholly includes or wholly excludes any given element. For example, the set of days of the week unquestionably includes Monday, Thursday, and Saturday. It just as unquestionably excludes butter, liberty, and dorsal fins, and so on.

We call this set a classical set because it's been around for such a long time. It was Aristotle who first formulated the Law of the Excluded Middle, which says X must either be in set A or in set not-A. Another version runs like this.

Of any subject, one thing must be either asserted or denied.

Here is a restatement of the law with annotations: "Of any subject (say Monday), one thing (being a day of the week) must be either asserted or denied (I assert that Monday is a day of the week)." This law demands that opposites, the two categories A and not-A, should between them contain the entire universe. Everything falls into either one group or the other. There is no thing that is both a day of the week and not a day of the week.

Now consider the set of days comprising a weekend. The diagram below is one attempt at classifying the weekend days.

Most would agree that Saturday and Sunday belong, but what about Friday? It "feels" like a part of the weekend, but somehow it seems like it should be technically excluded. So in the diagram above Friday tries its best to sit on the fence. Classical or "normal" sets wouldn't tolerate this kind of thing. Either you're in or you're out. Human experience suggests something different, though: fence sitting is a part of life.

Of course we're on tricky ground here, because we're starting to take individual perceptions and cultural background into account when we define what constitutes the weekend. But this is exactly the point. Even the dictionary is imprecise, defining the weekend as "the period from Friday night or Saturday to Monday morning." We're entering the realm where sharp edged yes-no logic stops being helpful. Fuzzy reasoning becomes valuable exactly when we're talking about how people really perceive the concept "weekend" as opposed to a simple-minded classification useful for accounting purposes only. More than anything else, the following statement lays the foundations for fuzzy logic.

In fuzzy logic, the truth of any statement becomes a matter of degree.

Any statement can be fuzzy. The tool that fuzzy reasoning gives is the ability to reply to a yes-no question with a not-quite-yes-or-no answer. This is the kind of thing that humans do all the time (think how rarely you get a straight answer to a seemingly simple question) but it's a rather new trick for computers.

How does it work? Reasoning in fuzzy logic is just a matter of generalizing the familiar yes-no (Boolean) logic. If we give "true" the numerical value of 1 and "false" the numerical value of 0, we're saying that fuzzy logic also permits in-between values like 0.2 and 0.7453. For instance,

Below on the left is a plot that shows the truth values for "weekend-ness" if we are forced to respond with an absolute yes or no response. On the right is a plot that shows the truth value for weekend-ness if we are allowed to respond with fuzzy in-between values.

Technically, the representation on the right is from the domain of multivalued logic (or multivalent logic). If I ask the question "Is X a member of set A?" the answer might be yes, no, or any one of a thousand intermediate values in between. In other words, X might have partial membership in A. Multivalued logic stands in direct contrast to the more familiar concept of two-valued (or bivalent yes-no) logic. Two-valued logic has played a central role in the history of science since Aristotle first codified it, but the time has come for it to share the stage.

To return to our example, now consider a continuous scale time plot of weekend-ness shown below.

By making the plot continuous, we're defining the degree to which any given instant belongs in the weekend rather than an entire day. In the plot on the left, notice that at midnight on Friday, just as the second hand sweeps past 12, the weekend-ness truth value jumps discontinuously from 0 to 1. This is one way to define the weekend, and while it may be useful to an accountant, it doesn't really connect with our real-world experience of weekend-ness.

The plot on the right shows a smoothly varying curve that accounts for the fact that all of Friday, and, to a small degree, parts of Thursday, partake of the quality of weekend-ness and thus deserve partial membership in the fuzzy set of weekend moments. The curve that defines the weekend-ness of any instant in time is a function that maps the input space (time of the week) to the output space (weekend-ness). Specifically it is known as a membership function. We'll discuss this in greater detail in the next section.

As another example of fuzzy sets, consider the question of seasons. What season is it right now? In the northern hemisphere, summer officially begins at the exact moment in the earth's orbit when the North Pole is pointed most directly toward the sun. It occurs exactly once a year, in late June. Using the astronomical definitions for the season, we get sharp boundaries as shown on the left in the figure that follows. But what we experience as the seasons vary more or less continuously as shown on the right below (in temperate northern hemisphere climates).


  Tutorial Membership Functions