WID3007 Fuzzy Logic Tutorial 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

WID3007

Tutorial 1

1. What is the similarity between fuzziness and randomness?

Fuzziness and randomness are two different concepts in the realm of uncertainty and imprecision,
but there are some similarities and connections between them:

1. Uncertainty: Both fuzziness and randomness represent forms of uncertainty. Fuzziness


deals with the imprecision or vagueness of information, while randomness pertains to
unpredictability or lack of determinism. In both cases, there is a degree of uncertainty in
the outcomes or information.

2. Degree of Predictability: In both fuzziness and randomness, it can be challenging to make


precise predictions. Fuzziness involves situations where boundaries are not well-defined,
making it difficult to determine exact categories or values. Randomness, on the other
hand, implies that outcomes are not predictable, and one can only describe probabilities
and distributions.

3. Statistical Approaches: Statistical methods are often used to analyze and describe both
fuzzy and random phenomena. In the case of randomness, statistics help describe the
probabilities of different outcomes. In fuzziness, techniques such as fuzzy logic and fuzzy
set theory use mathematical tools to handle and represent imprecise data.

4. Applications in Artificial Intelligence: Fuzziness and randomness are both utilized in


artificial intelligence and machine learning. Fuzzy logic is used in systems that handle
imprecise information, while randomness is fundamental in probabilistic models and
algorithms.

5. Real-world Complexity: In many real-world scenarios, both fuzziness and randomness may
coexist. For example, in financial markets, stock prices can exhibit both random
fluctuations and fuzzy trends due to imprecise economic indicators and investor sentiment.

Despite these similarities, it's important to distinguish between the two. Fuzziness deals with
imprecision within well-defined categories or concepts, while randomness pertains to the inherent
unpredictability of outcomes or events.

2. Explain a scenario where measurement of membership degree is more appropriate


compared to probability.

A scenario where the measurement of membership degree is more appropriate compared to


probability is in the context of evaluating subjective or qualitative concepts that do not have
clearly defined boundaries. This is where fuzzy logic and membership degrees come into play.
Here's an example to illustrate this:
Scenario: Customer Satisfaction in a Restaurant

Imagine you are the manager of a restaurant, and you want to assess the level of customer
satisfaction with the service provided. You ask your customers to rate their satisfaction on a scale
from 1 to 10, with 1 being "extremely dissatisfied" and 10 being "extremely satisfied." However,
customer satisfaction is a subjective and qualitative concept, and people may have different
interpretations of what "satisfaction" means.

In this scenario:

Fuzziness of Satisfaction: Different customers might have different expectations and experiences,
and their perceptions of satisfaction can vary. What one customer considers a "7" might be very
different from another customer's "7."

Lack of Clear Boundaries: There are no universally agreed-upon boundaries that separate
"satisfied" from "dissatisfied." For instance, you can't definitively say that a rating of "6" is
completely dissatisfied while "7" is completely satisfied.

Subjectivity: Customer satisfaction is highly subjective. It depends on various factors like personal
preferences, mood, and previous experiences, which are hard to quantify precisely with
probabilities.

In this scenario, measuring membership degrees using fuzzy logic is more appropriate than using
probabilities. With fuzzy logic, you can define fuzzy sets to represent different degrees of
satisfaction, such as "very dissatisfied," "somewhat dissatisfied," "neutral," "somewhat satisfied,"
and "very satisfied." Each customer's satisfaction rating can then be assigned membership degrees
to these fuzzy sets based on how well it matches the set's criteria.

For example, if a customer rates their satisfaction as "7," their membership degree in the
"somewhat satisfied" fuzzy set might be 0.7, indicating a high degree of satisfaction. Another
customer who rates their satisfaction as "7" might have a membership degree of 0.3 in the same
set, indicating a lower level of satisfaction.

Fuzzy logic allows you to capture the imprecise and subjective nature of customer satisfaction
more effectively compared to a purely probabilistic approach, which would require well-defined
probabilities and thresholds that may not be appropriate for this context.
3. Explain a scenario where measurement of probability is more appropriate compare to

membership degree.

A scenario where the measurement of probability is more appropriate compared to membership


degrees is when dealing with events or phenomena that have well-defined, objective, and
quantifiable outcomes. Probability theory is particularly suitable for scenarios where events can be
described in terms of discrete or continuous probability distributions. Here's an example to
illustrate this:

Scenario: Tossing a Fair Coin

Consider the simple act of tossing a fair coin, where you are interested in determining the
likelihood of getting heads or tails. In this scenario:

1. Objective Outcomes: The coin toss has two clear and objective outcomes: heads or tails.
These outcomes are well-defined and do not depend on subjective interpretation.

2. Quantifiable Probabilities: Each outcome, heads or tails, has an equal probability of


occurring, i.e., 0.5 (50%) for each. These probabilities can be precisely calculated and
expressed as real numbers between 0 and 1.

3. Law of Large Numbers: Probability theory allows you to make precise predictions about
the long-term behavior of coin tosses, such as the expected frequency of heads or tails in a
large number of trials.

4. Statistical Analysis: You can apply statistical techniques, such as calculating the mean,
variance, and standard deviation, to describe the distribution of outcomes over multiple
coin tosses.

In this scenario, the measurement of probability is more appropriate because it is a well-defined,


objective, and quantifiable concept. Membership degrees and fuzzy logic are not necessary since
the outcomes are binary (heads or tails) with clearly defined probabilities. Probabilistic models
provide an accurate and efficient way to analyze and predict the behavior of such events.

In contrast to the coin toss scenario, fuzzy logic and membership degrees are more suitable for
situations where there is uncertainty, imprecision, and subjectivity, as they allow for a more
flexible representation of vague or non-binary concepts.

4. Explain membership function and membership degree.

Membership Function:

A membership function is a fundamental concept in fuzzy logic and fuzzy set theory. It defines the
degree to which an element belongs to a fuzzy set. Fuzzy sets are a generalization of classical
(crisp) sets, allowing elements to belong to a set to varying degrees between 0 and 1, rather than
just being in or out of the set.
A membership function maps each element in the universe of discourse to a value between 0 and
1, representing the degree of membership of that element in the fuzzy set. The membership
function is typically shaped as a curve or graph, and its specific shape depends on the context and
the characteristics of the set it represents. Common shapes include triangular, trapezoidal,
Gaussian, and S-shaped curves.

For example, consider a fuzzy set "Tall" that represents the concept of height. The membership
function for this set may look like a triangular curve, where the base of the triangle represents the
range of heights considered "Tall," and the height of the triangle represents the degree of
membership. So, someone who is exactly at the center of the base would have a membership
degree of 1, while someone at the edges would have a lower degree of membership.

Membership Degree:

A membership degree is a quantitative value that represents the extent to which an element
belongs to a particular fuzzy set. It is obtained by evaluating the element's membership function
for that set. The membership degree can range from 0 (no membership) to 1 (full membership).
The higher the membership degree, the stronger an element belongs to the fuzzy set.

For example, if we have a fuzzy set "Young" with a triangular membership function, and we want
to evaluate the membership degree of a person who is 25 years old, we would look at the value on
the membership function curve at the point 25 on the x-axis. If the value at that point is, say, 0.7, it
means the person has a membership degree of 0.7 in the "Young" set, indicating a relatively strong
membership.

Membership degrees are crucial in fuzzy logic for handling imprecise, uncertain, or vague
information. They allow us to express the degree to which elements satisfy the criteria of a fuzzy
set, which is especially useful in decision-making and control systems that deal with complex, real-
world situations where exact boundaries and crisp classifications are not always applicable.

5. Based on Figure 1, identify the membership degree of elements x1, x2, x3 and x4. Write a

membership function that represent this fuzzy set A if x1 = 1 and x2 = 3.

Membership degrees of x1, x2, x3, and x4:

x1 = 1: 1.0

x2 = 3: 1.0

x3 = 5: 0.5

x4 = 7: 0.0
Membership function of fuzzy set A if x1 = 1 and x2 = 3:

The degree of membership of an element x in the fuzzy set A is:

1.0 if x is between 1 and 3, inclusive.

(x - 1) / 2 if x is between 3 and 5, exclusive.

0.0 otherwise.

This means that elements in the interval [1, 3] are fully members of the fuzzy set A, elements in
the interval (3, 5) are partially members of the fuzzy set A, and elements outside of these intervals
are not members of the fuzzy set A at all.

This membership function is a triangular function with a base of 2 and a height of 1. The center of
the triangle is at x = 3, and the membership degree is 1.0 at the center and decreases linearly to
0.0 at the edges of the triangle.

Note that the membership function is not explicitly defined for values of x greater than 5. This is
because the membership degree of all elements greater than 5 is 0.0.

6. Given that P(x1)=0.2, P(x2)=0.6, P(x3)=1.0, P(x4)=0.5 and x1<x2<x3<x4, xi∊ℝ. Draw a graph

that represents the membership function of P, if P has a triangular membership function.

To create a graph that represents the membership function of P with a triangular shape based on
the given probabilities for each element (x1, x2, x3, x4),

1. Determine the parameters of the triangular membership function. A triangular


membership function is typically defined by three points: the left boundary (x1), the peak
(x3), and the right boundary (x4). The degree of membership (P) is 1.0 at the peak (x3) and
decreases linearly as you move away from the peak in both directions.

2. Use the provided probabilities to calculate the heights of the membership function at x1,
x3, and x4. These heights represent the degree of membership at each point. The degree of
membership at x1 and x4 will be equal to the given probabilities for x1 and x4, while the
degree of membership at x3 is 1.0.

The reason x2 is ignored in the triangular membership function is that it falls between x1 and x3,
and a triangular membership function typically has its peak at x3. In this context, the triangular
membership function is defined by three key points: the left boundary (x1), the peak (x3), and the
right boundary (x4). The value of x2 is not one of these key points.

Let's calculate these heights:

• P(x1) = 0.2 (height at x1)


• P(x4) = 0.5 (height at x4)

• P(x3) = 1.0 (height at x3)

Now, plot the graph of the triangular membership function using these parameters:

• Place x1, x3, and x4 on the x-axis.

• At x1, the height is 0.2.

• At x3, the height is 1.0.

• At x4, the height is 0.5.

/\

/ \

/ \

/ \

/ \

/ \

/ \

x1 x3 x4

In this graph, the degree of membership (P) starts at 0.2 at x1, increases linearly to 1.0 at x3 (the
peak), and then decreases linearly to 0.5 at x4. This represents a triangular membership function
for the set P based on the provided probabilities and order of the elements.

7. Develop a reasonable membership function for each of the following fuzzy sets:

a) cold weather; b) very cold weather; c) warm weather.

Present your answers in both graph and equation forms.

a) Cold Weather:

Graph Form: A common representation for a membership function of "cold weather" might be a
trapezoidal shape.

0 0.2 0.5

|___ ___|
/ \ / \

/ \ / \

0.0 10.0 15.0 30.0

In this graph, temperatures below 10 degrees Celsius have a low membership degree (0.0),
temperatures between 10 and 15 degrees Celsius have a moderate membership degree (0.2 to
0.5), and temperatures above 15 degrees Celsius have a very low membership degree (0.0).

Equation Form:

You can represent the membership function for "cold weather" in equation form as follows:

For temperatures x < 10: μ_ColdWeather(x) = 0

For 10 ≤ x ≤ 15: μ_ColdWeather(x) = (x - 10) / (15 - 10) = 0.2x - 2

For temperatures x > 15: μ_ColdWeather(x) = 0

b) Very Cold Weather:

Graph Form:

A triangular membership function is often suitable for "very cold weather."

0.0 0.5 1.0

\ | /

\ | /

\ | /

\|/

\|

-10 0

In this graph, temperatures below -10 degrees Celsius have a membership degree of 0.0,
temperatures around -10 degrees have a moderate membership degree (0.5), and temperatures
above -10 degrees have a membership degree of 0.0.

Equation Form: The membership function for "very cold weather" can be represented in equation
form as follows:

• For temperatures x < -10: μ_VeryColdWeather(x) = 0


• For -10 ≤ x ≤ 0: μ_VeryColdWeather(x) = (x + 10) / (0 + 10) = 0.5x + 5

• For temperatures x > 0: μ_VeryColdWeather(x) = 0

c) Warm Weather:

Graph Form:

A triangular membership function is often suitable for "warm weather" as well. Here's a visual
representation:

0.0 0.5 1.0

| /\

|/ \

|/ \

20 30

In this graph, temperatures below 20 degrees Celsius have a membership degree of 0.0,
temperatures around 25 degrees have a moderate membership degree (0.5), and temperatures
above 30 degrees have a membership degree of 0.0.

Equation Form:

The membership function for "warm weather" can be represented in equation form as follows:

• For temperatures x < 20: μ_WarmWeather(x) = 0

• For 20 ≤ x ≤ 30: μ_WarmWeather(x) = (x - 20) / (30 - 20) = 0.5x - 10

• For temperatures x > 30: μ_WarmWeather(x) = 0

These are just example membership functions. The specific shape and parameters of these
functions can be adjusted based on your particular context or preferences.

Figure 1

You might also like