Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 36 ยท Fuzzy Sets

Linguistic Variables and Hedges

Learn what a linguistic variable is, how terms such as cold or warm are attached to a numeric universe, and how hedges like very and somewhat reshape fuzzy sets.

People do not say "the temperature is 27.3 degrees"; they say "it is warm" or "it is very hot". Fuzzy logic captures this speech with two ideas. A linguistic variable is a variable whose values are words instead of numbers. A hedge is a modifier such as very or somewhat that adjusts the meaning of a word. Together they let rules read almost like ordinary language while staying completely computable.

This lesson builds on Fuzzy Sets and Membership Degrees.

Linguistic variables

A linguistic variable has four parts:

  1. Name: for example temperature.
  2. Universe of discourse: the numeric range it describes, for example 0 to 40 degrees.
  3. Term set: the words it can take, for example cold, cool, warm, hot.
  4. Meaning of every term: a fuzzy set (membership function) over the universe.

So "temperature is warm" means: take the numeric temperature, evaluate the membership function of warm at that value, and use the resulting degree as the truth of the statement.

flowchart TD
    V["Linguistic variable<br/>temperature"] --> U["Universe: 0 to 40 C"]
    V --> T["Terms"]
    T --> C["cold"]
    T --> W["warm"]
    T --> H["hot"]
    C --> MC["membership function"]
    W --> MW["membership function"]
    H --> MH["membership function"]

A linguistic variable ties words to fuzzy sets on one universe.

Python A temperature variable with three terms

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that at 16 degrees the temperature is both cold and warm to some degree. Neighbouring terms overlap, and that overlap is what makes the controller's output change smoothly instead of switching between words.

Terms can be ordered and named by experts

Good term sets are small and meaningful: three to seven terms per variable is typical. Common patterns are low / medium / high, negative / zero / positive and very low / low / medium / high / very high. Too few terms give a coarse system, too many make the rule base huge (the number of possible rules multiplies across inputs; see Fuzzy IF-THEN Rules).

Hedges: very, somewhat, not

Words also come with modifiers. "Very tall" is a narrower idea than "tall": only the clearly tall people qualify. "Somewhat tall" is wider. Zadeh proposed simple mathematical operations on the membership degree to imitate these modifiers:

Hedge Formula Effect
very mu ** 2 concentrates: lowers partial degrees
extremely mu ** 3 concentrates even more
somewhat (more or less) mu ** 0.5 dilates: raises partial degrees
slightly mu ** 0.25 or similar dilates even more
not 1 - mu complement
intensify 2*mu**2 below 0.5, 1 - 2*(1-mu)**2 above pushes degrees away from 0.5 toward 0 or 1

Degrees of exactly 0 and 1 are unchanged by powers, so hedges only act on the partial memberships, which is exactly where the vagueness is. These formulas are conventional approximations, not laws of language; you may tune the exponents.

Python Hedges applied to tall

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check the row for 174 cm: "tall" is 0.36, "very tall" is only 0.13 and "somewhat tall" is 0.6. The ordering extremely <= very <= tall <= somewhat holds for every height. Hedges also stack: not very tall is 1 - mu**2, which is quite different from very not tall.

Python The intensifier makes a set crisper

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Applied repeatedly, the intensifier drives values toward 0 and 1, turning a fuzzy set into something close to a crisp one. This can be used to make a rule base "more decisive", at the price of the smoothness we wanted fuzzy logic for.

Language is more subtle than exponents. "Very" does not always square a degree, and in other languages the modifiers behave differently. Treat hedges as a convenient modelling tool: they are very useful in rule bases written in natural-looking language, but validate the result against how real users speak.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which of these is a linguistic variable?

    A linguistic variable takes words as values; each word is defined by a membership function on a numeric universe.
  2. 2. If mu_tall(x) = 0.5, what is mu_very_tall(x) with the squaring hedge?

    very squares the degree: 0.5 ** 2 = 0.25.
  3. 3. What does the hedge somewhat (square root) do to a degree of 0.25?

    The square root dilates the set: sqrt(0.25) = 0.5.
  4. 4. Which degrees do the power hedges very and somewhat leave unchanged?

    0 and 1 raised to any positive power stay 0 and 1, so only the vague, partial memberships change.
  5. 5. Why do neighbouring terms of a variable usually overlap?

    Overlap lets two terms be partly true at once, which gives a gradual transition between rules.

Summary

  • A linguistic variable has a name, a numeric universe, a term set and a membership function for each term.
  • Three to seven overlapping terms per variable is a common, workable design.
  • Hedges modify meaning: very squares, somewhat takes the square root, not complements, intensify sharpens.
  • Hedges only change partial memberships; 0 and 1 stay put.
  • Hedge formulas are modelling conventions that you may adjust.

Next: Properties of Fuzzy Sets