3.
Artificial Intelligence – CS364 Fuzzy Logic Characteristics of Fuzzy Sets• The classical set theory developed in the late 19th century by Georg Cantor describes how crisp sets can interact. These interactions are called operations.• Also fuzzy sets have well defined properties.• These properties and operations are the basis on which the fuzzy sets are used to deal with uncertainty on the one hand and to represent knowledge on the other. 3

4.
Artificial Intelligence – CS364 Fuzzy Logic Note: Membership Functions• For the sake of convenience, usually a fuzzy set is denoted as: A = A(xi)/xi + …………. + A(xn)/xn where A(xi)/xi (a singleton) is a pair “grade of membership” element, that belongs to a finite universe of discourse: A = {x1, x2, .., xn} 4

5.
Artificial Intelligence – CS364 Fuzzy LogicOperations of Fuzzy Sets Not A B A A A Complement Containment A B A A B Intersection Union 5

6.
Artificial Intelligence – CS364 Fuzzy Logic Complement• Crisp Sets: Who does not belong to the set?• Fuzzy Sets: How much do elements not belong to the set?• The complement of a set is an opposite of this set. For example, if we have the set of tall men, its complement is the set of NOT tall men. When we remove the tall men set from the universe of discourse, we obtain the complement.• If A is the fuzzy set, its complement A can be found as follows: A(x) = 1  A(x) 6

7.
Artificial Intelligence – CS364 Fuzzy Logic Containment• Crisp Sets: Which sets belong to which other sets?• Fuzzy Sets: Which sets belong to other sets?• Similar to a Chinese box, a set can contain other sets. The smaller set is called the subset. For example, the set of tall men contains all tall men; very tall men is a subset of tall men. However, the tall men set is just a subset of the set of men. In crisp sets, all elements of a subset entirely belong to a larger set. In fuzzy sets, however, each element can belong less to the subset than to the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set. 7

8.
Artificial Intelligence – CS364 Fuzzy Logic Intersection• Crisp Sets: Which element belongs to both sets?• Fuzzy Sets: How much of the element is in both sets?• In classical set theory, an intersection between two sets contains the elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships.• A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X: AB(x) = min [A(x), B(x)] = A(x)  B(x), where xX 8

9.
Artificial Intelligence – CS364 Fuzzy Logic Union• Crisp Sets: Which element belongs to either set?• Fuzzy Sets: How much of the element is in either set?• The union of two crisp sets consists of every element that falls into either set. For example, the union of tall men and fat men contains all men who are tall OR fat.• In fuzzy sets, the union is the reverse of the intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as: AB(x) = max [A(x), B(x)] = A(x)  B(x), where xX 9

17.
Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Set Normality• A fuzzy subset of X is called normal if there exists at least one element xX such that A(x) = 1.• A fuzzy subset that is not normal is called subnormal.• All crisp subsets except for the null set are normal.• The height of a fuzzy subset A is the large membership grade of an element in A height(A) = maxx(A(x)) 17

18.
Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Core and Support• Assume A is a fuzzy subset of X:• the support of A is the subset of A consisting of all elements with membership grade: supp(A) = {x A(x)  0 and xX}• the core of A is the subset of A consisting of all elements with membership grade: core(A) = {x A(x) = 1 and xX} 18

24.
Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Rules• In 1973, Lotfi Zadeh published his second most influential paper. This paper outlined a new approach to analysis of complex systems, in which Zadeh suggested capturing human knowledge in fuzzy rules.• A fuzzy rule can be defined as a conditional statement in the form: IF x is A THEN y is B• where x and y are linguistic variables; and A and B are linguistic values determined by fuzzy sets on the universe of discourses X and Y, respectively. 24

25.
Artificial Intelligence – CS364 Fuzzy Logic Classical Vs Fuzzy Rules• A classical IF-THEN rule uses binary logic, for example, Rule: 1 Rule: 2 IF speed is > 100 IF speed is < 40 THEN stopping_distance is long THEN stopping_distance is short• The variable speed can have any numerical value between 0 and 220 km/h, but the linguistic variable stopping_distance can take either value long or short. In other words, classical rules are expressed in the black-and-white language of Boolean logic. 25

26.
Artificial Intelligence – CS364 Fuzzy Logic Classical Vs Fuzzy Rules• We can also represent the stopping distance rules in a fuzzy form: Rule: 1 Rule: 2 IF speed is fast IF speed is slow THEN stopping_distance is long THEN stopping_distance is short• In fuzzy rules, the linguistic variable speed also has the range (the universe of discourse) between 0 and 220 km/h, but this range includes fuzzy sets, such as slow, medium and fast. The universe of discourse of the linguistic variable stopping_distance can be between 0 and 300 m and may include such fuzzy sets as short, medium and long. 26

27.
Artificial Intelligence – CS364 Fuzzy Logic Classical Vs Fuzzy Rules• Fuzzy rules relate fuzzy sets.• In a fuzzy system, all rules fire to some extent, or in other words they fire partially. If the antecedent is true to some degree of membership, then the consequent is also true to that same degree. 27

30.
Artificial Intelligence – CS364 Fuzzy Logic Firing Fuzzy Rules• A fuzzy rule can have multiple antecedents, for example: IF project_duration is long AND project_staffing is large AND project_funding is inadequate THEN risk is high IF service is excellent OR food is delicious THEN tip is generous• The consequent of a fuzzy rule can also include multiple parts, for instance: IF temperature is hot THEN hot_water is reduced; cold_water is increased 30

31.
Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example• Air-conditioning involves the delivery of air which can be warmed or cooled and have its humidity raised or lowered.• An air-conditioner is an apparatus for controlling, especially lowering, the temperature and humidity of an enclosed space. An air- conditioner typically has a fan which blows/cools/circulates fresh air and has cooler and the cooler is under thermostatic control. Generally, the amount of air being compressed is proportional to the ambient temperature.• Consider Johnny’s air-conditioner which has five control switches: COLD, COOL, PLEASANT, WARM and HOT. The corresponding speeds of the motor controlling the fan on the air-conditioner has the graduations: MINIMAL, SLOW, MEDIUM, FAST and BLAST. 31

32.
Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example• The rules governing the air-conditioner are as follows:RULE 1: IF TEMP is COLD THEN SPEED is MINIMALRULE 2: IF TEMP is COOL THEN SPEED is SLOWRULE 3: IF TEMP is PLEASANT THEN SPEED is MEDIUMRULE 4: IF TEMP is WARM THEN SPEED is FASTRULE 5: IF TEMP is HOT THEN SPEED is BLAST 32

39.
Artificial Intelligence – CS364 Fuzzy Logic ExercisesFor A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e} B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}Draw the Fuzzy Graph of A and BThen, calculate the following: - Support, Core, Cardinality, and Complement for A and B independently - Union and Intersection of A and B - the new set C, if C = A2 - the new set D, if D = 0.5B - the new set E, for an alpha cut at A0.5 39