What is fuzzy logic?
Fuzzy logic is an approach to computing based on degrees of truth rather than the usual true or false -- 1 or 0 -- Boolean logic on which the modern computer is based.
The idea of fuzzy logic was first advanced by Lotfi Zadeh of the University of California at Berkeley in the 1960s. Zadeh was working on the problem of computer understanding of natural language. Like most other activities in life and, indeed, the universe, natural language is not easily translated into the absolute terms of 0 and 1. Whether everything is ultimately describable in binary terms is a philosophical question worth pursuing, but in practice, much of the data we might want to feed a computer is in some state in between, and so, frequently, are the results of computing. It might help to see fuzzy logic as the way reasoning really works and binary, or Boolean, logic as simply a special case of it.

How does fuzzy logic work?
The goal of fuzzy logic is to optimize the handling of imprecise or uncertain data, reflecting the way humans solve problems. This requires modifying traditional mathematical processes to achieve meaningful results when the data is often unclear. The following are the general steps in this process:
- Fuzzification. This involves moving away from discrete values and replacing them with soft ranges for the values; this is sometimes called a membership function. For instance, if the temperature of a hot tub is 98 degrees, that value could be fuzzified into 0.8 warm and 0.2 hot. Note the human-friendly warm and hot -- soft or fuzzy expressions that make more sense to a person than to a machine.
- Rule evaluation. Write if-then rules that define the problem but apply them to the fuzzy values. For example, if the room temperature is high, then increase the fan speed.
- Combine the outputs. Roll the outputs of all the rules that the fuzzy rules have activated into a single set. In the preceding fan control example, for instance, set different fan speeds for different levels of truth.
- Defuzzification. Fuzzy results are converted back into crisp, or non-fuzzy, results. This is generally done with standard mathematical processes, such as the mean of maxima, which calculates the average of the maximum values.
- Apply the results. For instance, feed a device a new instruction to adjust for the new fuzzy data, per the rule set.
Fuzzy logic in AI
In AI systems, fuzzy logic is used to imitate human reasoning and cognition. Rather than strictly binary cases of truth, fuzzy logic includes 0 and 1 as extreme cases of truth, but with various intermediate degrees of truth.
As a result, fuzzy logic is well suited for the following:
- Engineering for decisions without clear certainties and uncertainties, or with imprecise data -- such as with natural language processing (NLP) technologies.
- Regulating and controlling machine outputs, according to multiple inputs and input variables, such as with temperature control systems.
The IBM Watson supercomputer is one of the most prominent examples of how variations of fuzzy logic and fuzzy semantics are used.
As AI proliferates, a new class of systems is emerging: Adaptive neuro-fuzzy inference systems (ANFIS) work like a typical fuzzy system, but instead of static logic rules, they use AI learning to tune rules and membership functions for perpetual optimization. So far, ANFIS surfaced in stock market predictions, medical diagnostics, autonomous vehicle navigation and energy demand forecasting.
Already ubiquitous, NLP systems have begun incorporating fuzzy logic to help with the interpretation of vague or subjective language in sentiment analysis and language used in legal documents and to improve the accuracy of chatbots and digital assistants.
Fuzzy logic is also being used in decision trees and rule-based classification systems, in fraud detection, credit risk assessment and consumer behavior analysis.

Examples of fuzzy logic applications
AI systems and technologies use fuzzy logic to support a variety of items, including control systems, device and software performance and decision support.
Control systems
- In environmental control systems, such as air conditioners and heaters, fuzzy logic determines output based on factors such as current temperature and target temperature.
- In factory and distribution center applications, fuzzy logic control can optimize both machine and process performance, from machine activity scheduling to fault prediction.
Device and software performance
- In automobiles, fuzzy logic is used for gear selection and is based on factors such as engine load, road conditions and style of driving.
- In dishwashers, fuzzy logic is used to determine the washing strategy and power needed, which is based on factors such as the number of dishes and the level of food residue on the dishes.
- In copy machines, fuzzy logic is used to adjust drum voltage based on factors such as humidity, picture density and temperature.
- In aerospace, fuzzy logic is used to manage altitude control for satellites and spacecraft based on environmental factors.
- In chemical distillation, fuzzy logic is used to control pH and temperature variables.
- In NLP, fuzzy logic is used to determine semantic relations between concepts represented by words and other linguistic variables.
Decision support
- In a business rules engine, fuzzy logic can be used to streamline decision-making according to predetermined criteria.
- In medicine, fuzzy logic is used for computer-aided diagnoses, based on factors such as symptoms and medical history.
Advantages and disadvantages of fuzzy logic systems
Fuzzy logic is a powerful problem-solver, making possible a vast range of options in myriad domains that were not nearly as elegant and accurate before. It offers the following advantages over more conventional methods:
Advantages of fuzzy logic
- Subjective inputs, subjective results. Because fuzzy logic functions as human beings do, processing degrees of truth rather than binary values, it is often a superb modeling tool for achieving subjective, or people-pleasing, answers to problems, such as environmental controls.
- High fault tolerance. Fuzzy logic systems accommodate imprecise inputs, making noise in the data less of an issue.
- Highly flexible. Logic rules and membership functions are easily adjusted in most applications.
- Applicability. Fuzzy logic can solve a formidable range of problems in various devices, including consumer electronics, medical diagnostics and factory floor implementations.
Disadvantages of fuzzy logic
- Fuzzy logic systems cannot learn. In a new era where AI systems can learn and self-improve perpetually, it is important to understand that fuzzy logic systems, by their very nature, cannot. The exception is custom hybrid systems capable of generating revised rules over time, based on external data, and evaluating system performance, as described above.
- Cost. Computationally heavy fuzzy logic systems can consume considerable resources, especially when embedded in other systems.
- Difficulty in dynamic applications. In a real-time system where conditions change rapidly and significantly, fuzzy logic systems might be inefficient.
Declarative programming relies on logic and rules to perform an action. Learn how it works, its benefits and the different types of declarative programming.