Fuzzy Logic and Approximate Reasoning
Fuzzy Sets and Membership Functions · 15 min
Classical set theory forces a binary choice: an element either belongs to a set or it does not, represented by a characteristic function that outputs exactly 0 or 1. That binary framing works poorly for predicates people use constantly in ordinary reasoning — "tall," "hot," "nearly full" — where membership is genuinely a matter of degree rather than an arbitrary threshold. A person who is 179 centimeters tall is not cleanly "tall" or "not tall" the way a light switch is on or off; any hard cutoff, say 180 centimeters, produces the absurd consequence that one millimeter of height makes the entire difference between category membership and non-membership. Engineers building real control systems face the identical problem whenever they must translate a vague human instruction, such as "reduce the heat somewhat," into a precise numeric command, and a system built entirely on hard thresholds tends to behave erratically right at those threshold boundaries. Lotfi Zadeh's 1965 paper introduced fuzzy sets to address exactly this mismatch between formal set theory and the graded categories natural language actually uses, and the framework it launched is now generally referred to as approximate reasoning.
Zadeh's core move was to generalize the characteristic function into a membership function that can take any real value in the closed interval [0, 1], not just the two endpoints. A fuzzy set A over a universe X is fully characterized by a function that assigns each element x a grade of membership, with values near 1 indicating strong membership and values near 0 indicating weak or no membership. Ordinary sets become the special case where the membership function only ever outputs 0 or 1. From this single generalization, Zadeh defined fuzzy analogues of the standard set operations: complement as one minus the membership value, union as the pointwise maximum of two membership functions, and intersection as the pointwise minimum. He also defined structural properties such as a fuzzy set's support (the elements with nonzero membership) and convexity (whether every level set, the elements with membership at or above a given threshold, forms a convex region).
A crucial and frequently misunderstood point is that a membership degree is not a probability. Probability describes uncertainty about which of several crisp, mutually exclusive states actually holds — for example, whether a coin that has already landed came up heads, a fact that is fixed but unknown to the observer. A membership degree instead describes how well a single, fully known state matches a vague linguistic category. A room measured at 23 degrees Celsius is not "70% likely" to be warm in some probabilistic sense; its temperature is known exactly, and it simply satisfies the vague predicate "warm" to degree 0.7, with zero uncertainty about the underlying measurement itself. Confusing the two is a common error even among practitioners, since both frameworks output a number between 0 and 1 and can look superficially similar on paper despite representing entirely different things. Keeping this distinction sharp matters directly for later coursework, since Topic 48 introduces probability as the separate formal tool for reasoning about genuine uncertainty over which state holds, rather than about graded compatibility with a vague description.
Linguistic Variables and Fuzzy Rule-Based Inference · 18 min
Fuzzy sets become practically useful once they are organized into linguistic variables, a concept Zadeh formalized in a 1973 paper on analyzing complex systems and decision processes. A linguistic variable is a variable whose values are words rather than numbers — for instance, the variable "Temperature" taking values like Cold, Warm, or Hot instead of a bare numeric reading. Each word is itself defined as a fuzzy set with its own membership function over the underlying numeric domain, so "Warm" might be a triangular membership function peaking at 20 degrees Celsius and tapering to zero by 10 and 30 degrees. This construction lets a control system accept the same kind of imprecise, human-style category an operator would use, while still being backed by a precise numeric function underneath. Zadeh's stated motivation was that many real systems are too intricate for tractable exact quantitative analysis, so tolerating some imprecision in exchange for a workable, human-interpretable model is often the better engineering trade.
Given linguistic variables, fuzzy inference builds an entire reasoning pipeline out of them, following the pattern E.H. Mamdani established for fuzzy controllers. First, fuzzification takes a crisp numeric input and evaluates it against each relevant membership function to obtain a set of membership degrees. Second, rule evaluation combines the antecedent conditions of each IF-THEN rule: a logical AND between two fuzzy conditions is standardly computed as the minimum of their membership degrees, and a logical OR as the maximum, generalizing classical logic's truth tables to continuous-valued truth. Third, aggregation combines the outputs of every rule that fired at all, typically by taking the pointwise maximum across the rules' clipped or scaled consequent membership functions to form one combined output fuzzy set. Fourth, defuzzification converts that combined fuzzy output back into a single crisp number, most commonly via the centroid, or center-of-gravity, of the aggregated output shape. Together these four steps generalize classical modus ponens — "if P then Q; P is true; therefore Q is true" — into a graded version that outputs a degree of applicability rather than a strict yes or no.
A concrete worked example makes the pipeline precise. Define three triangular membership functions for Temperature over 0-40 degrees Celsius: Cold equals 1 for temperatures at or below 10 and falls linearly to 0 by 20; Warm rises linearly from 0 at 10 to 1 at 20 and falls linearly back to 0 by 30; Hot rises linearly from 0 at 20 to 1 by 30 and stays at 1 above 30. Fuzzifying an input of 23 degrees gives Cold(23) = 0, since 23 is past Cold's zero point at 20. Warm(23) falls on Warm's downward slope from (20, 1) to (30, 0), giving Warm(23) = 1 − (23−20)/10 = 0.7. Hot(23) falls on Hot's upward slope from (20, 0) to (30, 1), giving Hot(23) = (23−20)/10 = 0.3. Now suppose a Humidity sensor has already been fuzzified to High(Humidity) = 0.6, and the rule base contains "IF Temperature is Warm AND Humidity is High THEN FanSpeed is Medium" together with "IF Temperature is Hot THEN FanSpeed is High." The first rule's firing strength is min(0.7, 0.6) = 0.6; the second rule's firing strength is simply Hot(23) = 0.3. Aggregation would combine a Medium output clipped at 0.6 with a High output clipped at 0.3, and defuzzification would then compute the centroid of that combined shape to produce one crisp fan-speed command — with the Medium-speed rule dominating the result, since its firing strength is larger.
Fuzzy Control in Practice: From Steam Engines to Modern Systems · 14 min
The pipeline from the previous lesson was not merely a theoretical proposal; E.H. Mamdani and S. Assilian built and tested it on a real industrial control problem in 1975. Their target was a laboratory steam engine and boiler combination with two inputs, heat and throttle, and two outputs, pressure and speed. Rather than deriving a precise differential-equation model of the plant, they interviewed a human operator who could run the system well by feel and translated the operator's heuristic rules — expressed in terms of linguistic error and change-of-error labels such as Positive Big, Positive Medium, Positive Small, Nil, Negative Small, Negative Medium, and Negative Big — directly into fuzzy IF-THEN rules of the form "if the pressure error is Negative Big, then the heat change is Positive Big." The resulting fuzzy controller consistently outperformed a conventional fixed digital controller across multiple operating points, an outcome that was striking precisely because no explicit mathematical model of the plant's dynamics had been used at all — only a human's linguistic expertise, made computable.
That result generalizes to a broader lesson about when fuzzy control earns its keep: it is most valuable exactly where an accurate first-principles model of a system is expensive or unavailable, but a human expert already has workable heuristics for controlling it. A second practical advantage follows from the membership functions themselves — because inputs blend gradually between categories rather than switching abruptly at a hard threshold, fuzzy controllers tend to avoid the "chattering" that a naive threshold-based controller exhibits when a noisy sensor reading hovers near a cutoff, since a fuzzy rule's firing strength changes smoothly rather than snapping on and off. It is worth reiterating the conceptual boundary from Lesson 1: fuzzy logic is a tool for handling vagueness in category membership, not a tool for handling uncertainty about which fact is true. A fuzzy controller does not need probabilistic sensor models to function; it needs well-chosen linguistic categories and rules.
Fuzzy inference also has real limitations that a rigorous treatment should not gloss over. The rule base grows combinatorially with the number of input variables and linguistic terms, so a system with many inputs quickly becomes unwieldy to author and verify by hand. There is no general procedure that guarantees a hand-written rule base is complete or free of internal conflicts, and any biases or blind spots in the human expert whose heuristics were encoded get baked directly into the controller. Defuzzification methods such as the centroid are useful engineering choices but are not derived from any single unifying formal principle the way, say, expected value is derived from probability theory, and fuzzy inference by itself offers none of the calibrated statistical guarantees that a probabilistic model can provide. These gaps are exactly why later systems often pair fuzzy structure with machine learning that tunes membership functions and rule weights from data rather than by hand alone — an idea that anticipates the broader theme of the next module, where neural learning and symbolic or rule-based structure are combined deliberately rather than treated as separate toolkits.
Fuzzifying 23°C into Warm and Hot
Triangular membership functions for the linguistic variable Temperature; the dashed line at 23°C shows fuzzification producing Warm = 0.7 and Hot = 0.3 (with Cold = 0), the exact values used in the module's rule-firing worked example.
- A fuzzy set's membership function assigns every element a graded value in [0, 1], generalizing the crisp characteristic function that classical set theory restricts to exactly {0, 1}.
- Mamdani-style inference chains four steps — fuzzification, rule evaluation (AND = min, OR = max), aggregation (max across rules), and defuzzification (commonly the centroid) — to turn linguistic rules into one crisp control output.
- Fuzzy membership degree measures graded compatibility with a vague category, not the probability of an uncertain event: a 23°C reading is Warm to degree 0.7 with total certainty about the temperature, not '70% likely to be Warm.'
Recall Practice
Glossary
- Fuzzy set
- A generalization of a classical set in which membership is a matter of degree, represented by a membership function ranging over [0, 1] rather than the binary values {0, 1}.
- Membership function
- The function that assigns each element of a universe a grade of membership in a fuzzy set, with 1 indicating full membership and 0 indicating none.
- Linguistic variable
- A variable whose values are words (e.g., Cold, Warm, Hot) rather than numbers, with each word defined as a fuzzy set over the underlying numeric domain.
- Fuzzification
- The step in fuzzy inference that converts a crisp numeric input into a set of membership degrees against the relevant fuzzy sets.
- Defuzzification
- The step in fuzzy inference that converts an aggregated fuzzy output set back into a single crisp numeric value, commonly via the centroid (center-of-gravity) method.
- Mamdani inference
- A fuzzy rule-based inference method, introduced by E.H. Mamdani, that chains fuzzification, min/max rule evaluation, max aggregation, and centroid defuzzification to map fuzzy inputs to a crisp output.
Hand-Trace a Two-Rule Fuzzy Controller
A fully virtual, paper-based worksheet exercise — no software, sensors, or real controllers are involved. Learners are given the piecewise-linear formulas for the module's Cold/Warm/Hot triangular membership functions and a second, supplied membership function for a Humidity variable, plus a two-rule fuzzy rule base. Working entirely by hand, learners fuzzify a new supplied temperature/humidity pair, compute each rule's firing strength using the min operator for AND, and write a short paragraph identifying which rule dominates the aggregated output and why, based purely on the arithmetic they performed.
Ready to test yourself?
5 questions on this module.