× back

Fuzzy Sets

Fuzzy Logic

Crisp Logic vs Fuzzy Logic

Crisp Set

Fuzzy Set

Membership Function Features

A is a fuzzy set, and x is a member of A. These features of the membership function can be understood by plotting them on a graph:

  1. Support: The support of a fuzzy set is the set of all elements x for which the membership value μA(x) is greater than 0.
    Meaning: It represents all points where the fuzzy set has some degree of membership, no matter how small.
    Mathematical Representation:
    Support(A) = {x | μA(x) > 0}
    Example: If μA(x) > 0 for elements x = 1, 2, 3, then the support of the set A is {1, 2, 3}.
  2. Core: The core of a fuzzy set is the set of all elements x for which the membership value μA(x) is exactly equal to 1.
    Meaning: It represents the points that fully belong to the fuzzy set with the maximum membership value.
    Mathematical Representation:
    Core(A) = {x | μA(x) = 1}
    Example: If μA(x) = 1 for elements x = 5 and x = 6, then the core of the set A is {5, 6}.
  3. Boundary: The boundary of a fuzzy set consists of all elements x where the membership value is strictly between 0 and 1.
    Meaning: It represents the elements that belong to the fuzzy set partially (neither fully included nor completely excluded).
    Mathematical Representation:
    Boundary(A) = {x | 0 < μA(x) < 1}
    Example: If μA(x) = 0.4 for x = 4 and μA(x) = 0.8 for x = 7, then the boundary of the set A includes {4, 7}.
Graph showing membership function features

Discrete and Continuous Membership Functions

Discrete Membership

  • In a discrete membership function, the membership values are defined only at specific, distinct points in the universal set.
  • These points are not continuous and are often represented as a series of individual data points.
  • Example: Let U = {1, 2, 3, 4, 5} and the fuzzy set A is defined as:
    A = {(1, 0.2), (2, 0.5), (3, 0.7), (4, 1.0), (5, 0.3)}.
    Here, the membership function μA(x) is only defined for these discrete points: 1, 2, 3, 4, and 5.
  • Such membership functions are represented graphically as isolated points, often marked with dots or vertical lines.

Continuous Membership

  • In a continuous membership function, the membership values are defined over a continuous range of points in the universal set.
  • The membership function is expressed as a smooth curve rather than isolated points.
  • Example: Let U represent the range of temperatures in degrees Celsius. The fuzzy set "Warm" may be defined by:
    μWarm(x) =
    • 0, if x < 20
    • (x - 20) / 10, if 20 ≤ x ≤ 30
    • 1, if x > 30

    This membership function defines a smooth transition of values from 0 to 1 as the temperature increases.
  • Graphically, a continuous membership function appears as a curve, indicating gradual changes in membership value.
Graph of a continuous & discrete membership function

Fuzzy Set Properties

Fuzzy Set Operations

If fuzzy sets are given to us, for example, set A and set B, various operations can be performed on them. These operations help us manipulate and analyze fuzzy sets effectively.

Union: (A ⋃ B)

  • When the union of A and B is performed, the new set is generated based on a specific rule. A key principle to remember is that while performing operations like union or intersection, the elements in the set do not change, only their associated membership values are modified.
  • μ(A ⋃ B)(x) = max ( μA(x), μB(x) )
    This means, for the same element in sets A and B, the maximum membership value is chosen for the union. For example, if an element has membership values 0.9 in set A and 0.1 in set B, the resulting membership value in the union will be 0.9.

Intersection: (A ⋂ B)

  • μ(A ⋂ B)(x) = min ( μA(x), μB(x) )
    In the intersection, for the same element in sets A and B, the minimum membership value is chosen.

Example:

A = {(x1, 0.6), (x2, 0.7), (x3, 0.4)}
B = {(x1, 0.3), (x2, 0.2), (x3, 0.5)}

  • (A ⋃ B) = {(x1, 0.6), (x2, 0.7), (x3, 0.5)}
  • (A ⋂ B) = {(x1, 0.3), (x2, 0.2), (x3, 0.4)}

Complement (Ac)

  • μ(Ac) = 1 - μA(x)
  • here also only the membership value will be changed
  • Example:
    A = {(x1, 0.6), (x2, 0.7), (x3, 0.4)}
    B = {(x1, 0.3), (x2, 0.2), (x3, 0.5)}
  • Ac = {(x1, (1 - 0.6)), (x2, (1 - 0.7)), (x3, (1- 0.4))}
    = {(x1, 0.4), (x2, 0.3), (x3, 0.6)}
  • Bc = {(x1, (1 - 0.3)), (x2, (1 - 0.2)), (x3, (1- 0.5))}
    = {(x1, 0.7), (x2, 0.8), (x3, 0.4)}

Fuzzy Relations

\[ \mu_R(X, Y) = \begin{pmatrix} a & 0.2 & 0.5 \\ b & 0.5 & 0.6 \\ c & 0.4 & 0.4 \end{pmatrix} \]

Operations on Fuzzy Relations

Previously, we learned about operations on fuzzy sets. Now, we explore operations between two fuzzy relations.

  1. Union: μR⋃S(X, Y) = max(μR(X, Y), μS(X, Y))
    Example:

    \[ \mu_R(X, Y) = \begin{pmatrix} & a & b \\ a & 0.2 & 0.2 \\ b & 0.5 & 0.6 \\ c & 0.4 & 0.4 \end{pmatrix} \]

    \[ \mu_S(X, Y) = \begin{pmatrix} & a & b \\ a & 0.3 & 0.5 \\ b & 0.1 & 0.4 \\ c & 0.3 & 0.6 \end{pmatrix} \]

    \[ \mu_{R \cup S}(X, Y) = \begin{pmatrix} & a & b \\ a & 0.3 & 0.5 \\ b & 0.5 & 0.6 \\ c & 0.4 & 0.6 \end{pmatrix} \]

  2. Intersection: μR∩S(X, Y) = min(μR(X, Y), μS(X, Y))
    Example:

    \[ \mu_R(X, Y) = \begin{pmatrix} & a & b \\ a & 0.2 & 0.2 \\ b & 0.5 & 0.6 \\ c & 0.4 & 0.4 \end{pmatrix} \]

    \[ \mu_S(X, Y) = \begin{pmatrix} & a & b \\ a & 0.3 & 0.5 \\ b & 0.1 & 0.4 \\ c & 0.3 & 0.6 \end{pmatrix} \]

    \[ \mu_{R \cap S}(X, Y) = \begin{pmatrix} & a & b \\ a & 0.2 & 0.2 \\ b & 0.1 & 0.4 \\ c & 0.3 & 0.4 \end{pmatrix} \]

  3. Complement: μRc(X, Y) = 1 - μR(X, Y)
    Example:

    \[ \mu_R(X, Y) = \begin{pmatrix} & a & b \\ a & 0.2 & 0.2 \\ b & 0.5 & 0.6 \\ c & 0.4 & 0.4 \end{pmatrix} \]

    \[ \mu_{R^c}(X, Y) = \begin{pmatrix} & a & b \\ a & 0.8 & 0.8 \\ b & 0.5 & 0.4 \\ c & 0.6 & 0.6 \end{pmatrix} \]

Fuzzy Composition

  • Fuzzy composition is the operation performed on two compatible fuzzy relations to produce a single fuzzy relation.
  • Let \( R \) be a fuzzy relation from universe \( X \) to \( Y \) (\( R: X \rightarrow Y \)), and \( S \) be a fuzzy relation from universe \( Y \) to \( Z \) (\( S: Y \rightarrow Z \)). The composition of \( R \) and \( S \) represents a fuzzy relation from \( X \) to \( Z \) (\( R \circ S: X \rightarrow Z \)).
  • There are two common types of composition in fuzzy relations:
    1. Fuzzy Max-Min Composition:
      The membership value of the resulting relation \( \mu_{R \circ S}(x, z) \) is determined by taking the maximum value of the minimum membership values between \( R(x, y) \) and \( S(y, z) \) for all \( y \) in \( Y \).

      \(\mu_{R \circ S}(x, z) = \max_{y \in Y} \big(\min(\mu_R(x, y), \mu_S(y, z))\big)\)

    2. Fuzzy Max-Product Composition:
      The membership value of the resulting relation \( \mu_{R \circ S}(x, z) \) is determined by taking the maximum value of the product of the membership values \( R(x, y) \) and \( S(y, z) \) for all \( y \) in \( Y \).

      \(\mu_{R \circ S}(x, z) = \max_{y \in Y} \big(\mu_R(x, y) \cdot \mu_S(y, z)\big)\)

  • Key Notes:
    • Fuzzy relations must be compatible for composition, meaning the output universe of \( R \) (e.g., \( Y \)) matches the input universe of \( S \).
    • Fuzzy composition helps in modeling complex systems by linking intermediate relations.

Example Question: Fuzzy Max-Min Composition

\[ R_{x,y} = \begin{pmatrix} & y1 & y2 \\ x1 & 0.6 & 0.3 \\ x2 & 0.2 & 0.9 \end{pmatrix} \]

\[ S_{y,z} = \begin{pmatrix} & z1 & z2 & z3 \\ y1 & 1 & 0.5 & 0.3 \\ y2 & 0.8 & 0.4 & 0.7 \end{pmatrix} \]

\[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & ? & ? & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

Now we will find each element of the resulting fuzzy relation using the formula for max-min composition:

\(\mu_{R \circ S}(x, z) = \max_{y \in Y} \big(\min(\mu_R(x, y), \mu_S(y, z))\big)\)

  • For (x1, z1):

    \(\mu_{R∘S}(x_1, z_1) = \max\big(\min(\mu_R(x_1, y_1), \mu_S(y_1, z_1)), \min(\mu_R(x_1, y_2), \mu_S(y_2, z_1))\big)\)


    = \(\max\big(\min(0.6, 1), \min(0.3, 0.8)\big)\)
    = \(\max(0.6, 0.3)\)
    = 0.6

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & ? & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x1, z2):

    \(\mu_{R∘S}(x_1, z_2) = \max\big(\min(\mu_R(x_1, y_1), \mu_S(y_1, z_2)), \min(\mu_R(x_1, y_2), \mu_S(y_2, z_2))\big)\)


    = \(\max\big(\min(0.6, 0.5), \min(0.3, 0.4)\big)\)
    = \(\max(0.5, 0.3)\)
    = 0.5

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.5 & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x1, z3):

    \(\mu_{R∘S}(x_1, z_3) = \max\big(\min(\mu_R(x_1, y_1), \mu_S(y_1, z_3)), \min(\mu_R(x_1, y_2), \mu_S(y_2, z_3))\big)\)


    = \(\max\big(\min(0.6, 0.3), \min(0.3, 0.7)\big)\)
    = \(\max(0.3, 0.3)\)
    = 0.3

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.5 & 0.3 \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x2, z1):

    \(\mu_{R∘S}(x_2, z_1) = \max\big(\min(\mu_R(x_2, y_1), \mu_S(y_1, z_1)), \min(\mu_R(x_2, y_2), \mu_S(y_2, z_1))\big)\)


    = \(\max\big(\min(0.2, 1), \min(0.9, 0.8)\big)\)
    = \(\max(0.2, 0.8)\)
    = 0.8

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.5 & 0.3 \\ x2 & 0.8 & ? & ? \end{pmatrix} \]

  • For (x2, z2):

    \(\mu_{R∘S}(x_2, z_2) = \max\big(\min(\mu_R(x_2, y_1), \mu_S(y_1, z_2)), \min(\mu_R(x_2, y_2), \mu_S(y_2, z_2))\big)\)


    = \(\max\big(\min(0.2, 0.5), \min(0.9, 0.4)\big)\)
    = \(\max(0.2, 0.4)\)
    = 0.4

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.5 & 0.3 \\ x2 & 0.8 & 0.4 & ? \end{pmatrix} \]

  • For (x2, z3):

    \(\mu_{R∘S}(x_2, z_3) = \max\big(\min(\mu_R(x_2, y_1), \mu_S(y_1, z_3)), \min(\mu_R(x_2, y_2), \mu_S(y_2, z_3))\big)\)


    = \(\max\big(\min(0.2, 0.3), \min(0.9, 0.7)\big)\)
    = \(\max(0.2, 0.7)\)
    = 0.7

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.5 & 0.3 \\ x2 & 0.8 & 0.4 & 0.7 \end{pmatrix} \]

Example Question: Max-Product Composition

\[ R_{x,y} = \begin{pmatrix} & y1 & y2 \\ x1 & 0.6 & 0.3 \\ x2 & 0.2 & 0.9 \end{pmatrix} \] \[ S_{y,z} = \begin{pmatrix} & z1 & z2 & z3 \\ y1 & 1 & 0.5 & 0.3 \\ y2 & 0.8 & 0.4 & 0.7 \end{pmatrix} \] \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & ? & ? & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

Now we will find each element of the resulting fuzzy relation using the formula for max-product composition:

\(\mu_{R \circ S}(x, z) = \max_{y \in Y} \big(\mu_R(x, y) \cdot \mu_S(y, z)\big)\)

  • For (x1, z1):

    \(\mu_{R∘S}(x_1, z_1) = \max\big((\mu_R(x_1, y_1) \cdot \mu_S(y_1, z_1)), (\mu_R(x_1, y_2) \cdot \mu_S(y_2, z_1))\big)\)


    = \(\max\big((0.6 \cdot 1), (0.3 \cdot 0.8)\big)\)
    = \(\max(0.6, 0.24)\)
    = 0.6

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & ? & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x1, z2):

    \(\mu_{R∘S}(x_1, z_2) = \max\big((\mu_R(x_1, y_1) \cdot \mu_S(y_1, z_2)), (\mu_R(x_1, y_2) \cdot \mu_S(y_2, z_2))\big)\)


    = \(\max\big((0.6 \cdot 0.5), (0.3 \cdot 0.4)\big)\)
    = \(\max(0.3, 0.12)\)
    = 0.3

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.3 & ? \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x1, z3):

    \(\mu_{R∘S}(x_1, z_3) = \max\big((\mu_R(x_1, y_1) \cdot \mu_S(y_1, z_3)), (\mu_R(x_1, y_2) \cdot \mu_S(y_2, z_3))\big)\)


    = \(\max\big((0.6 \cdot 0.3), (0.3 \cdot 0.7)\big)\)
    = \(\max(0.18, 0.21)\)
    = 0.21

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.3 & 0.21 \\ x2 & ? & ? & ? \end{pmatrix} \]

  • For (x2, z1):

    \(\mu_{R∘S}(x_2, z_1) = \max\big((\mu_R(x_2, y_1) \cdot \mu_S(y_1, z_1)), (\mu_R(x_2, y_2) \cdot \mu_S(y_2, z_1))\big)\)


    = \(\max\big((0.2 \cdot 1), (0.9 \cdot 0.8)\big)\)
    = \(\max(0.2, 0.72)\)
    = 0.72

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.3 & 0.21 \\ x2 & 0.72 & ? & ? \end{pmatrix} \]

  • For (x2, z2):


    \(\mu_{R∘S}(x_2, z_2) = \max\big((\mu_R(x_2, y_1) \cdot \mu_S(y_1, z_2)), (\mu_R(x_2, y_2) \cdot \mu_S(y_2, z_2))\big)\)


    = \(\max\big((0.2 \cdot 0.5), (0.9 \cdot 0.4)\big)\)
    = \(\max(0.1, 0.36)\)
    = 0.36

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.3 & 0.21 \\ x2 & 0.72 & 0.36 & ? \end{pmatrix} \]

  • For (x2, z3):

    \(\mu_{R∘S}(x_2, z_3) = \max\big((\mu_R(x_2, y_1) \cdot \mu_S(y_1, z_3)), (\mu_R(x_2, y_2) \cdot \mu_S(y_2, z_3))\big)\)


    = \(\max\big((0.2 \cdot 0.3), (0.9 \cdot 0.7)\big)\)
    = \(\max(0.06, 0.63)\)
    = 0.63

    \[ \mu_{R \circ S} = \begin{pmatrix} & z1 & z2 & z3 \\ x1 & 0.6 & 0.3 & 0.21 \\ x2 & 0.72 & 0.36 & 0.63 \end{pmatrix} \]

Reference