Skip to main content

Fuzzy Logic - Database, Queries and Quantification

Fuzzy Logic is an approach to computing based on "degrees of truth" rather than the usual "true or false" logic. It deals with reasoning that is approximate rather than precise to solve problems in a way that more resembles human logic, hence database querying process by the two valued realization of Boolean algebra is not adequate.

Fuzzy Scenario of Relations on Databases

The Fuzzy Scenario of Relations on Databases can be understood with the help of the following example −

Example

Suppose we have a database having the records of persons who visited India. In simple database, we will have the entries made in the following way −

NameAgeCitizenVisited CountryDays SpentYear of Visit
John Smith35U.S.India411999
John Smith35U.S.Italy721999
John Smith35U.S.Japan311999

Now, if anyone queries about the person who visited India and Japan in the year 99 and is the citizen of US, then the output will show two entries having the name of John Smith. This is simple query generating simple output.

But what if we want to know whether the person in the above query is young or not. According to the above result, the age of the person is 35 years. But can we assume the person to be young or not? Similarly, same thing can be applied on the other fields like days spent, year of visit, etc.

The solution of the above issues can be found with the help of Fuzzy Value sets as follows −

  • FV(Age){ very young, young, somewhat old, old }

  • FV(Days Spent){ barely few days, few days, quite a few days, many days }

  • FV(Year of Visit){distant past, recent past, recent }

  • Now if any query will have the fuzzy value then the result will also be fuzzy in nature.

Fuzzy Query System

A fuzzy query system is an interface to users to get information from the database using (quasi) natural language sentences. Many fuzzy query implementations have been proposed, resulting in slightly different languages. Although there are some variations according to the particularities of different implementations, the answer to a fuzzy query sentence is generally a list of records, ranked by the degree of matching.

Quantification

In modeling natural language statements, quantified statements play an important role. It means that NL heavily depends on quantifying construction which often includes fuzzy concepts like “almost all”, “many”, etc. Following are a few examples of quantifying propositions −

  • Every student passed the exam.
  • Every sport car is expensive.
  • Many students passed the exam.
  • Many sports cars are expensive.

In the above examples, the quantifiers “Every” and “Many” are applied to the crisp restrictions “students” as well as crisp scope “(person who)passed the exam” and “cars” as well as crisp scope ”sports”.

Fuzzy Events, Fuzzy Means and Fuzzy Variances

With the help of an example, we can understand the above concepts. Let us assume that we are a shareholder of a company named ABC. And at present the company is selling each of its share for ₹40. There are three different companies whose business is similar to ABC but these are offering their shares at different rates - ₹100 a share, ₹85 a share and ₹60 a share respectively.

Now the probability distribution of this price takeover is as follows −

Price₹100₹85₹60
Probability0.30.50.2

Now, from the standard probability theory, the above distribution gives a mean of expected price as below −

100×0.3+85×0.5+60×0.2=84.5

And, from the standard probability theory, the above distribution gives a variance of expected price as below −

(10084.5)2×0.3+(8584.5)2×0.5+(6084.5)2×0.2=124.825

Suppose the degree of membership of 100 in this set is 0.7, that of 85 is 1, and the degree of membership is 0.5 for the value 60. These can be reflected in the following fuzzy set −

{0.7100,185,0.560,}

The fuzzy set obtained in this manner is called a fuzzy event.

We want the probability of the fuzzy event for which our calculation gives −

0.7×0.3+1×0.5+0.5×0.2=0.21+0.5+0.1=0.81

Now, we need to calculate the fuzzy mean and the fuzzy variance, the calculation is as follows −

Fuzzy_mean =(10.81)×(100×0.7×0.3+85×1×0.5+60×0.5×0.2)

=85.8

Fuzzy_Variance 



Anurag Rana

Comments

Popular posts from this blog

JAVA Scrollbar, MenuItem and Menu, PopupMenu

ava AWT Scrollbar The  object  of Scrollbar class is used to add horizontal and vertical scrollbar. Scrollbar is a  GUI  component allows us to see invisible number of rows and columns. AWT Scrollbar class declaration public   class  Scrollbar  extends  Component  implements  Adjustable, Accessible   Java AWT Scrollbar Example import  java.awt.*;   class  ScrollbarExample{   ScrollbarExample(){               Frame f=  new  Frame( "Scrollbar Example" );               Scrollbar s= new  Scrollbar();               s.setBounds( 100 , 100 ,  50 , 100 );               f.add(s);               f.setSize( 400 , 400 );               f.setLayout( null );               f.setVisible( true );   }   public   static   void  main(String args[]){           new  ScrollbarExample();   }   }   Output: Java AWT Scrollbar Example with AdjustmentListener import  java.awt.*;   import  java.awt.event.*;   class  ScrollbarExample{        ScrollbarExample(){               Frame f=  new  Frame( "Scro

Difference between net platform and dot net framework...

Difference between net platform and dot net framework... .net platform supports programming languages that are .net compatible. It is the platform using which we can build and develop the applications. .net framework is the engine inside the .net platform which actually compiles and produces the executable code. .net framework contains CLR(Common Language Runtime) and FCL(Framework Class Library) using which it produces the platform independent codes. What is the .NET Framework? The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class librari

C++ this Pointer, static, struct and Enumeration

C++ this Pointer In C++ programming,  this  is a keyword that refers to the current instance of the class. There can be 3 main usage of this keyword in C++. It can be used  to pass current object as a parameter to another method. It can be used  to refer current class instance variable. It can be used  to declare indexers. C++ this Pointer Example Let's see the example of this keyword in C++ that refers to the fields of current class. #include <iostream>    using   namespace  std;   class  Employee {       public :           int  id;  //data member (also instance variable)               string name;  //data member(also instance variable)            float  salary;          Employee( int  id, string name,  float  salary)             {                   this ->id = id;                  this ->name = name;                  this ->salary = salary;            }             void  display()             {                 cout<<id<< "  " <<name<&