Project DIP
Project DIP
Experiment Name :
Objectives:
Theory :
Fuzzy logic is a type of logic that tries to model human reasoning. Unlike traditional or classical logic
where things are either true or false (0 or 1), fuzzy logic works with degrees of truth. This means a
value can be partly true and partly false at the same time. For example, instead of saying "The weather
is hot" (true or false), fuzzy logic can say "The weather is 70% hot and 30% not hot."This type of logic
is especially useful in situations where decisions are not black and white, but rather fall into a gray
area—like deciding how much tip to give at a restaurant. People don’t always give the same tip
percentage. It depends on the quality of food and service, and both of these factors can be good, bad, or
something in between.In our lab, we used fuzzy logic to build a tipping system using Python and the
scikit-fuzzy (skfuzzy) library. The system takes two inputs:
Discussion :
In this lab, we successfully used fuzzy logic to simulate a real-life decision-making system: deciding
how much tip to give at a restaurant. We created fuzzy variables for quality and service as inputs and tip
as the output. Each variable was assigned membership functions using the triangular shape, which helped
convert crisp input values into fuzzy values.
We then created three fuzzy rules that combine the conditions of quality and service to determine the
appropriate tip. For example, if the service is great or the quality of food is amazing, the system suggests
a high tip. This way, the system behaves more like a human, making decisions that consider multiple
factors.
After setting up the control system and giving inputs (e.g., quality = 6.5 and service = 9.8), we used
the .compute() function to get the tip amount. The output showed a reasonable tip value, which was also
visualized using graphs. This showed how fuzzy logic can deal with uncertainty and provide smart
solutions in uncertain situations.
Conclusion :
From this experiment, we learned how fuzzy logic can be applied in practical systems to make human-
like decisions. We understood how to define fuzzy sets, create membership functions, and build rules for
inference. Using Python and the skfuzzy library, we developed a complete fuzzy control system for tip
calculation.
This lab helped us see the power of fuzzy logic in solving real-world problems where inputs are not fixed.
It also improved our understanding of fuzzy systems and how they can be used in artificial intelligence
and decision support systems.