Shades Of Reality

 

Chapter Seven

Fuzzy Logic In The Real World

 

 

If this book were like most of the current books on fuzzy logic, we would now begin to show how the ideas developed in Part One can be applied to electrical engineering problems. In fact it is in the field of engineering that fuzzy logic has, to date, enjoyed its greatest development and application.

As a textbook example of the application of fuzzy logic to engineering, one could design a "fuzzy air-conditioner." Such a device would utilize a range of values for the speed of the compressor motor, instead of using just the two extreme speeds (either running full blast, or being totally off). An air-conditioner with a motor whose speeds are "shades of gray" between "on" and "off" would be able to maintain a constant room temperature better. Conventional air-conditioners must first wait for the room temperature to exceed the maximum thermostat setting, at which point they blast the room with cold air until the minimum setting on the thermostat is reached. This means that the temperature in the room must swing from a bit too hot to a bit too cold. A fuzzy air-conditioner on the other hand could keep it "just right."

The application of fuzzy logic to engineering is not just a theory or a hypothetical possibility of what it might someday be possible to do. Fuzzy logic is already in everyday use, particularly in Japan.

The Japanese city of Sendai has a subway system that is probably the most advanced in the world. The subway train moves so smoothly that standing passengers don't even need to hold on to poles or straps. A fish tank could travel the entire 8.4 mile route, stop at all 16 stations, and never even spill a drop of water. The subway is, of course, controlled by fuzzy logic.

Matsushita Electric Industrial Company (known in the United States as Panasonic, Quasar, and Technics) is the world's largest manufacturer of consumer electronics. In 1990 Masushita introduced a washing machine as the first major consumer appliance to incorporate fuzzy logic. The machine would sense the size of the load and the amount of dirt, and automatically adjust the wash cycle accordingly.

Matsushita (as well as Hitachi) also makes a fuzzy vacuum cleaner that uses an infrared sensor to measure the amount of dust on the floor. The machine then automatically sets the proper level of suction by adjusting the speed of the motor.

Matsushita and Sanyo also make fuzzy rice cookers. (No, they don't cook "fuzzy rice.") These rice cookers allow the user to select between four different kinds of cooked rice: hard, medium, soft, and sushi. Each type requires a different amount of water and a different steaming method. But by utilizing fuzzy logic, the user can simply fill the cooker to a single water level and the device automatically makes the adjustments.

Sanyo, Toshiba, and Sharp all make fuzzy microwave ovens, which sense temperature and humidity, and automatically adjust the cooking power and time. Normally, microwave ovens are either totally "on" (cooking) or totally "off" (not cooking) at any instant of time while they are in operation. (If you set the oven to less than full power and listen carefully, you can actually hear when it goes on and off.) By allowing for intermediate values of "on-ness" more uniform cooking can be achieved.

In what might be considered to be almost the supreme oxymoron, Canon has come out with something called "fuzzy focus!" Traditional self-focusing cameras would simply bounce an infrared (or ultrasound) signal off of whatever single object was at the dead center of the field of view and then use that information to determine the distance. But if there were two or more objects present, such auto-focusing cameras could get confused. Canon solved the problem by allowing the camera to consider multiple targets and, utilizing fuzzy logic, incorporates them all.

In 1990 Matsushita introduced a fuzzy camcorder that automatically reduces the amount of jitter caused by hand-held operation. (Several months later, Fortune named it a Product of the Year.) It is possible to eliminate the jitter by identifying the difference between motion inside the view (such as a person waving his hands) and motion of the view as a whole (where the entire frame shifts vertically or horizontally as a single unit). To distinguish between these two different types of motions, Matsushita used fuzzy logic to develop what it called a "digital image stabilizer." The stabilizer compares each pair of successive frames to see how much they have shifted, and then adjusts them accordingly.

Also in 1990, Fujitsu announced that it had developed a fuzzy electronic "eye" that could distinguish three-dimensional physical objects and even calculate their speeds of motion. The fuzzy eye has been successfully used in tests of automatically driven automobiles, and those vehicles were driven around corners and past obsticles without collisions.

Even elevators are becoming fuzzy. Companies such as Otis are working on the development of smart elevators -- devices that employ fuzzy logic to adjust to the level of traffic. By knowing how many passengers are currently in each elevator, which floors have passengers waiting to board, and the locations of all of the elevators currently in use, an optimum strategy of operation can be dynamically achieved.

Day by day, the concept of fuzzy logic is becoming more and more a part of modern engineering. In fact fuzzy logic is starting to become so commonly used in engineering that most engineers who utilize the fuzzy concept actually think that "fuzzy logic" pertains only to "electrical circuits!"

We can now venture into the relatively unexplored areas of how fuzzy logic can be applied to the non-electrical everyday world. Let's begin by examining the part of the world where the concepts of vagueness and contradiction have already been accepted for thousands of years.

 

Eastern Philosophy

Many concepts in Eastern philosophy arose in India and China, and have had little expression in the Western world.

Jainism is an ancient religion which, by some accounts, has origins dating as far back as 2500 B.C. Daniel McNeill and Paul Freiberger in their book, Fuzzy Logic write: "The Jains built a formal logic in which existence and nonexistence inhere in everything. Every statement is partly true and partly false. There is no certainty, at least none we can know."

Around 500 B.C. lived the philosopher Sakyamuni, better known as the Buddha. The philosophy of the Buddha closely resembled that of the Jains. The Buddha was one of the first philosophers to reject the black and white view of reality in favor of shades of gray. He saw the world filled with contradictions -- with things being both A and, at the same time, not A.

Daoism originated from the work of Lao Zi (the "Old Master"). It emphasises the wisdom of seeing the contradictory in the whole. Each opposite endpoint on a continuum requires the other endpoint. There is even a kind of imperfection to perfection. In short, wisdom lies in paradox, and the superior person accepts apparent contradictions.

Partial contradiction is expressed by the Chinese concept of yin and yang. Its most famous emblem, the tai ji tu, is shown in Figure 7.1. It is a circle divided into two equal areas of black and white with each part containing a circle of the opposite color. The small circles represent the Daoist idea that once anything reaches its extreme limit, it begins to create its opposite.

 

(Figure 7.1)

 

Buddhism has had a strong impact on Japanese culture. With this kind of upbringing, the Japanese have accepted vagueness as a way of life. As McNeill and Freiberger write:

"Their language reflects it. In fact, it is not inherently vaguer than any other tongue, but the Japanese deploy it in an extraordinary way.... For instance, the Japanese rely heavily on context. They omit the subject and object of a sentence wherever possible. The same noun can be either singular or plural, like you in English, and verbs provide no clue to their number. Verbs also lack the fairly precise indications of time found in Western languages."

It is therefore not surprising that the Japanese have come to accept fuzzy logic much more readily than have Americans. Japan has thousands of fuzzy specialists, most of them working on developing special-purpose industrial applications.

 

The Philosophy of Science

Unlike the philosophies of the East, Western science is based on a dogma of exactness and precision. There is no room for vagueness and ambiguity. Western scientists demand that theories and hypotheses be clearly and unambiguously defined. For example Western science would say that the gravitational force decreases inversely with the square of the distance between two objects. Fuzzy science might simply say that objects that are far apart experience less force of gravity between them than objects that are close together, without precisely indicating what the terms "close" and "far" mean.

This kind of scientific laxness has prompted much criticism of fuzzy logic, particularly when it was first introduced. In the words of Rudolf Kalman (1972), the inventor of the Kalman filter: " 'Fuzzification' is a kind of scientific permissiveness; it tends to result in socially appealing slogans unaccompanied by the dicipline of hard scientific work and patient observation. I must confess that I cannot conceive of 'fuzzification' as a viable alternative for the scientific method."

In 1975 the mathematician William Kahan stated: "What we need is more logical thinking, not less. The danger of fuzzy theory is that it will encourage the sort of imprecise thinking that has brought us into so much trouble."

A requirement of any scientific theory is not only that it can be verified by experiment, but that it can also be potentially disproved by experiment. If an experiment produces a result that contradicts the theory, then some kind of reformulation of the theory is required. As Kahan points out:

"But with fuzzy sets, the existence of contradictory sets doesn't cause things to malfunction. Contradictory information doesn't lead to a clash. You just keep computing.... Logic isn't following the rules of Aristotle blindly. It takes the kind of pain known to the runner. He knows he is doing something. When you are thinking about something hard, you'll feel a similar sort of pain. Fuzzy logic is marvelous. It insulates you from pain. It is the cocaine of science."

But the term "fuzzy" has two slightly different meanings. In addition to meaning "vague," fuzzy also means "shades of gray" (or having a range of values). And science certainly accepts that concept. Otherwise, the very idea of measurement would be meaningless.

 

Western Philosophy

As we have already indicated, much of western philosophy is based on the teachings of Aristotle and his black and white views of reality. Aristotle's philosophy could not accept apparent contradictions or vagueness. Something was either A, or else it wasn't A. (Because no middle ground was admissible, this concept is sometimes referred to as the law of excluded middle.) Something was either black, or else it was white. A person was either tall, or else they weren't.

In view of the Western world's propensity to shun fuzziness and vagueness, it is somewhat surprising that fast-food restaurants in this country generally offer soft drinks in vague sizes (e.g., "small," "medium," and "large") instead of specifying the amount in precise numerical terms (like ounces). But when it comes to paying for those drinks, there is absolutely no ambiguity in the price. It's specified right down to the exact penny!

It is fashionable to use cliches in our everyday speech. One popular cliche you sometimes hear is the phrase, "There are no absolutes, only shades of gray." These words are sometimes uttered in quasi-intellectual discussion groups when one of the speakers in the group begins expounding an extreme point of view. But then that same person will often contradict that very concept later by saying to somebody, "You don't know what you're talking about" (as if he has changed his mind about there being only shades of gray and now believes that "knowing" is an all-or-nothing state in which a person either totally does know what he is talking about, or else he totally doesn't!).

Clearly, the concept of shades of gray is not a difficult one. Even a baby can distinguish a dark gray toy from a light gray one. We look at a "black and white" photograph and see shades of gray virtually everywhere. We all can recognize gray as a color, and we are certainly intelligent enough to know how to extrapolate the shades-of-gray concept to non-color applications. So why do Americans have such a difficult time with fuzzy logic?

Most of the reason has to do with how we are brought up. From the time we were little children we were told to ignore the grays and to treat reality as if it had sharply defined boundary lines, just like the black and white line drawings in our coloring books. And when we filled in those coloring book pictures with our crayons, we always used one solid color for each object, and we were very careful to never color past the black boundary lines.

The athletic games we played also incorporated simple boundary lines: a baseball was hit either fair, or else it was foul. A football player either stepped out of bounds, or else he didn't. A basketball player either scored a basket, or else he didn't. Except in horseshoes, there were no partial points for being close. Everything was either all, or nothing.

With this kind of lifelong indoctrination it's not too surprising that we would grow up to view reality itself as nothing more than a black and white game: A person is either an adult or else is a minor, a person has either commited a crime, or else he hasn't. A fetus is either a human being, or else it isn't.

The Aristotelian mentality is a difficult one to discard, and I too have trouble with it occasionaly. Several years ago while on a driving trip through a remote part of Alaska, my motor home's engine started to overheat. Whenever the little red indicator light on my dashboard came on, I would become very worried. But after a few minutes it would go off, and I would breathe a sigh of relief now that everything was OK again!

Actually, most of us already accept the fundamental ideas of fuzzy logic, and we don't even realize it! For example are you aware that your automobile has many fuzzy devices on it? One of them is a gadget for precisely adjusting the direction of the vehicle's velocity vector. The device is called the steering wheel! It lets you choose the amount of "sharpness" of a turn. If the steering wheel had been designed as a non-fuzzy device (such as a pair of steering push buttons, one for turning left and one for turning right) then there would have been no shades of gray to turning -- the wheels of the car would have always turned either all the way to the left or else all the way to the right! (Remember, the term "fuzzy" simply means allowing for intermediate values between two extreme limits.)

Other fuzzy devices on your car include the gas peddle (to provide a range of accelerations), the brake peddle (to provide a range of decelerations), the volume control on the radio (to provide a range of loudness), and even the clock! (to indicate more than just "daytime" or "night time.")

And when you pull into a gas station, you don't pay one fixed "fill-up fee" regardless of how much gas you take. You pay only for what you get. A non-fuzzy approach might have been to have you pay zero dollars if you take less than 1 gallon, and $20 if you take more than 1 gallon. In other words you would either pay all (of the $20), or nothing.

You might want to say that these examples represent nothing but plain old common sense. You've got it! Fuzzy logic is merely the process of looking at reality realistically! Reality isn't a made-up game like football or baseball where we invent the rules. Reality has its own rules.

And even when we play games where we do invent the rules, there is no need to always insist that the outcomes of those games always be of an Aristotelian nature. For example let's once again consider the game of Pitching Pennies, which we disscussed in Chapter Three.

 

Pitching Pennies

Suppose you and I have agreed to play Pitching Pennies. Each of us will take turns tossing our pennies into the circle. When it's your turn to do the tossing, you will get to keep only those pennies that end up inside the circle, and I will get all the pennies that land outside the circle, and similarly for you when it's my turn to do the tossing.

Let's suppose that you have just finished tossing eight pennies and they ended up as shown in Figure 7.2.

 

(Figure 7.2)

 

Clearly pennies a, b, and c would belong to you, and pennies g and h would belong to me. But what about the pennies that landed "on the line"? Who would get pennies d, e, and f (the ones that landed partly inside the circle and partly outside)?

The "American" way (with its Aristotelian "you-gotta-draw-the-line-somewhere" mentality) of solving the problem would probably be to "round-off" the results by declaring a penney to be inside the circle if most of it is inside the circle (and to declare it as being outside the circle if most of it is outside). Therefore penney d would belong to you, and penney f would belong to me. And if we were to continue our game for a long time, the results of such a "rounding-off" approach would kind of "average out" into a wash. In the long run the number of "on the line" pennies that land more than half way inside the circle would about equal the number of pennies that land more than half way outside.

But who would get penney e, the one which landed exactly half way in, and half way out? Of course it's easy to simply dismiss the problem. After all, it's only a penny. So maybe you might decide to be magnanomous and concede the coin to me. And the next time it happens I might concede the penny to you.

But suppose that, instead of pennies, we were to use something substantially more valuable, such as silver dollars or gold coins. And instead of playing the game hundreds of times (where statistics can "average out" the results), let's play the game only once.

We each toss our one and only silver dollars into the circle. Mine lands completely inside the circle, and yours lands on the line -- 1/4 inside the circle, and 3/4 outside. What is the fairest and most realistic way to determine the winner of the money?

Since my toss landed completely inside the circle, I am clearly entitled to keep my silver dollar. But some parts of your dollar landed inside the circle, and some parts landed outside. Since we agreed that you would be entitled to keep whatever money you tossed that landed inside the circle, it wouldn't be fair for me to take all of your dollar just because most of it landed outside the circle. You have a legitimate claim to all of the silver atoms that did make it into the circle. Therefore the fairest solution to the problem would be for you to keep your silver dollar and to pay me 75 cents (since, in reality, I only have a 75 percent claim on your coin).

By using this kind of "shades of gray" approach for determining the winner, the reality of the actual outcome of each coin-toss is preserved. There is no need to "round off" this reality to some Aristotelian non-reality by always declaring only one person or the other to be the total winner. Both players win (but to different degrees) when the coin lands on the line.

This example illustrates an important feature of fuzzy logic: Fuzzy solutions to problems can be reality-preserving. (We will utilize this feature more fully in Chapter Nine when we discuss the concept of Realistic laws.)

 

Statistical Fuzziness

But what about those instances in which there simply aren't any shades of gray available? What do you do when the only choices available are two opposite extremes? What do you do when you simply "gotta draw the line" and make a choice between one of those extremes or the other?

For example, consider a gun. There aren't too many shades of gray about shooting -- either the bullet gets fired, or it doesn't. (Pulling the trigger only half-way doesn't make the bullet come out only half as fast!) It's an all-or-nothing result.

Now, imagine that you are standing in an open clearing in the jungle. Off in the distance is a ferocious tiger. As he slowly approaches, you raise your rifle to the ready position. You don't really want to shoot the poor beast unless you absolutely have to. After all, maybe he's only curious about you.

Maybe he'll turn around and go away if you just don't antagonize him. But still, he keeps coming closer ... and closer ....

How close should you let him come before you decide that you have to pull the trigger? At what distance do you "draw the line" between shooting him and not shooting him?

While this represents a valid example of sometimes having to "draw the line somewhere," it also illustrates another form of fuzziness, which I call statistical fuzziness.

Imagine that the above tiger encounter was not just a onetime event, but that it happened on hundreds of different occassions under virtually the same circumstances. Let's say that as long as each tiger remained at least 20 feet away, you felt reasonably "safe" and you always refrained from pulling the trigger. On the other hand, no tiger ever got closer than 10 feet from you without him having to pay the supreme penalty. (Assume all shots were fatal.) At intermediate distances (such as 13 or 14 feet), some of the tigers were allowed to survive, while others were shot as far away as 17 or 18 feet.

Therefore even though each individual tiger was shot at a different "crisp" distance (at which you "drew the line" for that particular encounter), the entire set of "don't-pull-the-trigger" distances that resulted from all of the encounters was a fuzzy set (a "statistically" fuzzy set). A given fixed distance, such as 15 feet, was both a member of that set and also a member of the complement set. (But for any particular encounter, its membership value in either the "pull-the-trigger" set or its complement was always crisp -- i.e., either 0 percent, or 100 percent) There was no single exact distance at which you always "drew the line" between pulling the trigger and not pulling the trigger. Instead, the collective result was simply: the closer that each tiger came, the more likely it was that he would get shot.

This concept of statistical fuzziness suggests at least one possible approach for introducing shades of gray into matters that seem to require the drawing of a black and white boundary line somewhere. Let's consider the question of how a person's age should be used to determine his or her voting rights.

Just as in our example of shooting the tigers, we might view the matter of determining voting rights as having to decide at what age we should "pull the trigger" in allowing each person to vote. Instead of merely "drawing the line" at 18 years of age (or any age), we could allow a certain percentage of 17-year-olds to vote. And we could allow an even smaller percentage of 16-year-olds to vote, and so on.

Before every election each teenage citizen in the country could be allowed to apply for the right to vote. (The process might be handled in a manner similar to a lottery.) The older the person is, the better their chances would be of "winning" one of those voting rights. By the time they reached 21 years of age (or whatever), their "chances" of being allowed to vote would finally reach 100 percent (i.e., they would always be allowed to vote). This approach would eliminate the necessity of having to "draw the line" at an arbitrary (and therefore meaningless) minimum age limit. (In Chapter Nine we will see an even better way of handling this voting rights issue.)

Statistical fuzziness does not necessarily require "randomness." For example statistical fuzziness is also the basis for the process known as "halftone printing." (In computer graphics a similar technique is called "dithering.") If you look at a "black and white" photograph in a newspaper and examine it carefully with a magnifying glass, you will see that the gray portions of the image are not printed with gray ink. Instead, gray is produced by printing tiny black dots on a white background. Any microscopic point on the paper therefore contains either black ink or no ink at all, but the resulting macroscopic visual effect is a shade of gray for that particular region. The higher the ratio of black dots to white, the darker the apparent shade of gray. In this way a printed photograph can be displayed without the printer having to "draw the line" in terms of which regions of the image should be printed as totally black, and which regions should be printed as totally white. Because of statistical fuzziness the entire image can be presented realistically, i.e., in shades of gray!

 

Kicking the Aristotelian Habit

If you really want to kick the Aristotelian habit, your thinking is going to have to undergo a complete overhaul. You will need to shift paradigms, and that's not going to be an easy thing to do. It's not sufficient to merely acknowledge the existence of fuzzy reality with its shades of gray. You are going to have to make a conscious effort to think in fuzzy terms as well. Just as in the case of E-Prime (see "Introduction to Reality" at the beginning of this book) you might start out by becoming aware of the terms that you use in everyday speech. Try to keep yourself from using phrases that contain all-or-nothing implications such as:

"George is a good person."

"I had no idea that .... "

"At some point in time ...."

"I would be perfectly happy to ...."

"You are wrong about ...."

"Everybody is talking about ...."

                (etc.)

Instead, train yourself to use more correct phrases like:

"George is a person with a high degree of goodness."

"I had no more than a very low degree of awareness that ...."

"During some interval of time ...."

"It would give me a high degree of happiness to ...."

"You have no more than a low degree of correctness about ...."

"A high percentage of the population is talking about ...."

(etc.)

These new phrases will sound awkward and unnatural at first, but they will help drive home the fuzzy principle (that everything is a matter of degree).

And above all, try to avoid using the phrase: "Well, you gotta draw the line somewhere."

While there are times when there is no other alternative but to "draw the line," most Americans are far too quick to automatically adopt such a solution as being the only possibility, and never even bother to look for other plausible approches. However (as we will see in the remainder of this book), most societal issues can be resolved without having to resort to Aristotelian "line drawing."