# What is fuzzy membership function – A complete guide

Fuzzy membership function is used to convert the crisp input provided to the fuzzy inference system. Fuzzy logic itself is not fuzzy, rather it deals with the fuzziness in the data. And this fuzziness in the data is best described by the fuzzy membership function.

A fuzzy inference system is the core part of any fuzzy logic system. Fuzzification is the first step in Fuzzy Inference System.

Formally, a membership function for a fuzzy set A on the universe of discourse X is defined as µ_{A}: X → [0, 1], where each element of X is mapped to a value between 0 and 1. This value, called **membership value **or **degree of membership**, quantifies the grade of membership of the element in X to the fuzzy set A. Here, X is the universal set and A is the fuzzy set derived from X.

The fuzzy membership function is the graphical way of visualizing the degree of membership of any value in a given fuzzy set. In the graph, X-axis represents the universe of discourse and the Y-axis represents the degree of membership in the range [0, 1]

In the following discussion, we will see various fuzzy membership functions. These functions are mathematically very simple. Fuzzy logic is meant to deal with the fuzziness, so the use of complex membership functions would not add much precision to the final output.

## Fuzzy Membership Function:

### Singleton membership function:

The Singleton membership function assigns membership value 1 to a particular value of x and assigns value 0 to the rest of all. It is represented by the impulse function as shown.

Mathematically it is formulated as,

### Triangular membership function:

This is one of the most widely accepted and used membership functions (MF) in fuzzy controller design. The triangle which fuzzifies the input can be defined by three parameters a, b and c, where c defines the base and b defines the height of the triangle.

**Trivial case:**

Here, in the diagram, X-axis represents the input from the process (such as air conditioner, washing machine, etc.) and the Y axis represents the corresponding fuzzy value.

If input x = b, then it is having full membership in the given set. So,

μ(x) = 1, if x = b

And if the input is less than a or greater than b, then it does belong to the fuzzy set at all, and its membership value will be 0

μ(x) = 0, x < a or x > c

**x is between a and b:**

If x is between a and b, as shown in the figure, its membership value varies from 0 to 1. If it is near a, its membership value is close to 0, and if x is near b, its membership value gets close to 1.

We can compute the fuzzy value of x using a similar triangle rule,

μ(x) = (x – a) / (b – a), a ≤ x ≤ b

**x is between b and c:**

If x is between b and c, as shown in the figure, its membership value varies from 0 to 1. If it is near b, its membership value is close to 1, and if x is near c, its membership value gets close to 0.

We can compute the fuzzy value of x using a similar triangle rule,

μ(x) = (c – x) / (c – b), b ≤ x ≤ c

**Combine all together:**

We can combine all the above scenarios in single equation as,

**Example: Triangular membership function**

Determine μ, corresponding to x = 8.0

For the given values of a, b and c, we have to compute the fuzzy value corresponding to x = 8. Using the equation of the triangular membership function,

Thus, x = 8 will be mapped to a fuzzy value of 0.5 using the given triangle fuzzy membership function

### Trapezoidal membership function:

The trapezoidal membership function is defined by four parameters: a, b, c and d. Span b to c represents the highest membership value that element can take. And if x is between (a, b) or (c, d), then it will have a membership value between 0 and 1.

We can apply the triangle MF if elements are in between a to b or c to d.

It is quite obvious to combine all together as,

There are two special forms of trapezoidal function based on the openness of function. They are known as R-function (Open right) and L-function (Left open). Shape and parameters of both functions are depicted here:

**R-function:** it has a = b = -∞

**L-function: **It has c = d = +∞

**Example: Trapezoidal membership function**

Determine μ, corresponding to x = 3.5

### Gaussian membership function:

A Gaussian MF is specified by two parameters {m, σ} and can be defined as follows.

In this function, m represents the mean / center of the gaussian curve and σ represents the spread of the curve. This is a more natural way of representing the data distribution, but due to mathematical complexity, it is not much used for fuzzification.

**Example: Gaussian membership function**

Determine μ corresponding to x = 9, m = 10 and σ = 3.0

### Generalized bell-shaped function:

It is also called **Cauchy MF.** A generalized bell MF is specified by three parameters {a, b, c} and can be defined as follows.

**Example: Generalized bell shape membership function**

Determine μ corresponding to x = 8

Using the above-discussed equation of the generalized bell-shape membership function,

it is called generalized MF, because by changing the parameters a, b and c, we can produce a family of different membership functions.

The function μ(X) =1 / (1 + x^{2} ) can be modelled by setting a = b = 1 and c = 0. Similarly, we can produce other shapes/functions by setting appropriate a, b and c

### Sigmoid Membership function:

Sigmoid functions are widely used in classification tasks in machine learning. Specifically, it is used in logistic regression and neural networks, where it suppresses the input and maps it between 0 and 1.

It is controlled by parameters a and c. Where *a* controls the slope at the crossover point *x = c*

Mathematically, it is defined as

Graphically, we can represent it as,

**Example: Sigmoid function**

Determine μ corresponding to x = 8

By using the equation of the sigmoid membership function

## Test Your Knowledge !

- What is the use of fuzzy membership functions?
- Which membership function is used in Machine Learning?
- State the pros and cons of complex fuzzy membership function

**Please post your answer / query / feedback in comment section below !**

helpful article for fuzzy system college subject..

Thanks a lot Simran

Superb! very well explained. Thank You for such a contribution to the knowledge world

Thank you very much Zaland. That’s really motivating

May God bless u for ur concise n intuitive examples that hav now aided me to perform regression problems without any software using these MEMBERSHIP FUNCTIONS..I shall forever remain grateful to u.

Thank you very much. You words made my day :-)

बहुत बढिया भाई धन्यवाद

Thanks a lot

I have exam tomorrow, and this post really explained the concept very well that I can solve examples now

thank you very much for this

Glad to know that. Here is the entire video playlist on Fuzzy logic: https://www.youtube.com/playlist?list=PLUVnh0w_cCjIzH0i8B6yQcXs567mST9cQ

nice one brother good to understannd

Thanks Dear! Entire video playlist is available here: https://shorturl.at/inryW

I’m currently writing an essay for college and this really helps me keeping track of the functions. Thanks!

Happy to know that. Entire playlist on Fuzzy Logic is available here: https://www.youtube.com/playlist?list=PLUVnh0w_cCjIzH0i8B6yQcXs567mST9cQ

Hope this will help you in your studies

Hey dude, how did you plot those graphs? Did you use a graph calculator or did you drew them by hand?

I prepared those in Powerpoint

typo error in Trivial case last paragraph.

Where exactly? Can you plz. point out ?

Indeed a complete guide to understand fuzzy membership functions.

Thanks a lot. You may be interested in watching video playsit on fuzzy logic: You can find it at https://shorturl.at/inryW