# 128.

 C++ Neural Networks and Fuzzy Logic by Valluru B. Rao M&T Books, IDG Books Worldwide, Inc. ISBN: 1558515526   Pub Date: 06/01/95

#### Queries

Let us turn our attention now to how queries are answered with this type of a database model. Suppose you want a list of U.S. citizens in your database. Peter and Alan clearly satisfy this condition on citizenship. Andre and Raj can only be said to possibly satisfy this condition. But Roberto and James clearly do not satisfy the given condition. This query itself is crisp and not fuzzy (either you belong to the list of U.S. citizens or you don’t). The answer therefore should be a crisp set, meaning that unless the degree of membership is 1, you will not list an element. So you get the set containing Peter and Alan only.

A second query could be for people who made more than a few visits outside the United States Here the query is fuzzy. James with many visits outside United States seems to clearly satisfy the given condition. It is perhaps reasonable to assume that each element in the fuzzy set for many appears in the fuzzy set more than a few with a degree of membership 1. Andre’s 2 may be a number that merits 0 degree of membership in more than a few. The other numbers in the database are such that they possibly satisfy the given condition to different degrees. You can see that the answer to this fuzzy query is a fuzzy set. Now, we switch gears a little, to talk more on fuzzy theory. This will help with material to follow.

### Fuzzy Events, Means and Variances

Let us introduce you to fuzzy events, fuzzy means, and fuzzy variances. These concepts are basic to make a study of fuzzy quantification theories. You will see how a variable’s probability distribution and its fuzzy set are used together. We will use an example to show how fuzzy means and fuzzy variances are calculated.

#### Example: XYZ Company Takeover Price

Suppose you are a shareholder of company XYZ and that you read in the papers that its takeover is a prospect. Currently the company shares are selling at \$40 a share. You read about a hostile takeover by a group prepared to pay \$100 a share for XYZ. Another company whose business is related to XYZ’s business and has been on friendly terms with XYZ is offering \$85 a share. The employees of XYZ are concerned about their job security and have organized themselves in preparing to buy the company collectively for \$60 a share. The buyout price of the company shares is a variable with these three possible values, viz., 100, 85, and 60. The board of directors of XYZ have to make the ultimate decision regarding whom they would sell the company. The probabilities are 0.3, 0.5, and 0.2 respectively, that the board decides to sell at \$100 to the first group, to sell at \$85 to the second, and to let the employees buy out at \$60.

Thus, you get the probability distribution of the takeover price to be as follows:

 price 100 85 60 probability 0.3 0.5 0.2

From standard probability theory, this distribution gives a mean(or expected price) of:

`      100 x 0.3 + 85 x 0.5 + 60 x 0.2 = 84.5 `

and a variance of :

`      (100-84.5)2 x 0.3 +(85-84.5)2 x 0.5 + (60-84.5)2 x 0.2 = 124.825 `

Suppose now that a security analyst specializing in takeover situations feels that the board hates a hostile takeover but to some extent they cannot resist the price being offered. The analyst also thinks that the board likes to keep some control over the company, which is possible if they sell the company to their friendly associate company. The analyst recognizes that the Board is sensitive to the fears and apprehensions of their loyal employees with whom they built a healthy relationship over the years, and are going to consider the offer from the employees.

The analyst’s feelings are reflected in the following fuzzy set:

`      {0.7/100, 1/85, 0.5/60} `

You recall that this notation says, 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.

The fuzzy set obtained in this manner is also called a fuzzy event. A different analyst may define a different fuzzy event with the takeover price values. You, as a shareholder, may have your own intuition that suggests a different fuzzy event. Let us stay with the previous fuzzy set that we got from a security analyst, and give it the name A.

#### Probability of a Fuzzy Event

At this point, we can calculate the probability for the fuzzy event A by using the takeover prices as the basis to correspond the probabilities in the probability distribution and the degrees of membership in A. In other words, the degrees of membership, 0.7, 1, and 0.5 are treated as having the probabilities 0.3, 0.5, and 0.2, respectively. But we want the probability of the fuzzy event A, which we calculate as the expected degree of membership under the probability distribution we are using.

Our calculation gives the following:

`      0.7 x 0.3 + 1 x 0.5 + 0.5 x 0.2 = 0.21 + 0.5 + 0.1 = 0.81 `