SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
Artificial Intelligence – CS364
                           Fuzzy Logic




 Soft Computing: Fuzzy Logic 2
these slides are taken from the web and the author of
         these slides is: Dr Bogdan L. Vrusias
                b.vrusias@surrey.ac.uk
Artificial Intelligence – CS364
                                  Fuzzy Logic


                          Contents
•   Characteristics of Fuzzy Sets
•   Operations
•   Properties
•   Fuzzy Rules
•   Examples




                                                          2
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
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
Artificial Intelligence – CS364
                       Fuzzy Logic


Operations of Fuzzy Sets
 Not A
                                     B

         A                           A
                                     A




  Complement                  Containment




    A        B                   A
                                 A       B




  Intersection                   Union
                                               5
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
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
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
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
Artificial Intelligence – CS364
                           Fuzzy Logic


    Operations of Fuzzy Sets
(x)

1
            A
0
                        x
1
         Not A
0
                        x
       Complement

(x)                           (x)

1                              1
        A        B                     A     B
0                              0
                        x                          x
1        AB                   1
                                        AB
0                              0
                        x                          x
       Intersection                     Union
                                                       10
Artificial Intelligence – CS364
                                  Fuzzy Logic


               Properties of Fuzzy Sets
•   Equality of two fuzzy sets
•   Inclusion of one set into another fuzzy set
•   Cardinality of a fuzzy set
•   An empty fuzzy set
•   -cuts (alpha-cuts)




                                                          11
Artificial Intelligence – CS364
                                Fuzzy Logic


                        Equality
• Fuzzy set A is considered equal to a fuzzy set B, IF AND
  ONLY IF (iff):
      A(x) = B(x), xX

  A = 0.3/1 + 0.5/2 + 1/3
  B = 0.3/1 + 0.5/2 + 1/3

  therefore A = B




                                                             12
Artificial Intelligence – CS364
                                 Fuzzy Logic


                        Inclusion
• Inclusion of one fuzzy set into another fuzzy set. Fuzzy set
  A  X is included in (is a subset of) another fuzzy set, B 
  X:
       A(x)  B(x), xX

  Consider X = {1, 2, 3} and sets A and B

  A = 0.3/1 + 0.5/2 + 1/3;
  B = 0.5/1 + 0.55/2 + 1/3

  then A is a subset of B, or A  B
                                                             13
Artificial Intelligence – CS364
                                        Fuzzy Logic


                              Cardinality
• Cardinality of a non-fuzzy set, Z, is the number of elements in Z. BUT
  the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is
  expressed as a SUM of the values of the membership function of
  A, A(x):

        cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi),           for i=1..n


   Consider X = {1, 2, 3} and sets A and B

   A = 0.3/1 + 0.5/2 + 1/3;
   B = 0.5/1 + 0.55/2 + 1/3

   cardA = 1.8
   cardB = 2.05
                                                                             14
Artificial Intelligence – CS364
                                    Fuzzy Logic


                        Empty Fuzzy Set
• A fuzzy set A is empty, IF AND ONLY IF:
       A(x) = 0, xX

  Consider X = {1, 2, 3} and set A

  A = 0/1 + 0/2 + 0/3

  then A is empty




                                                            15
Artificial Intelligence – CS364
                                       Fuzzy Logic


                              Alpha-cut
• An -cut or -level set of a fuzzy set A  X is an ORDINARY SET
  A  X, such that:
      A={A(x), xX}.

   Consider X = {1, 2, 3} and set A

   A = 0.3/1 + 0.5/2 + 1/3

   then A0.5 = {2, 3},
        A0.1 = {1, 2, 3},
        A1 = {3}



                                                                    16
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
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
Artificial Intelligence – CS364
                                     Fuzzy Logic


            Fuzzy Set Math Operations
• aA = {aA(x), xX}
  Let a =0.5, and
        A = {0.5/a, 0.3/b, 0.2/c, 1/d}
  then
        Aa = {0.25/a, 0.15/b, 0.1/c, 0.5/d}


• Aa = {A(x)a, xX}
  Let a =2, and
        A = {0.5/a, 0.3/b, 0.2/c, 1/d}
  then
        Aa = {0.25/a, 0.09/b, 0.04/c, 1/d}
• …

                                                             19
Artificial Intelligence – CS364
                                  Fuzzy Logic


                 Fuzzy Sets Examples
• Consider two fuzzy subsets of the set X,
      X = {a, b, c, d, e }

  referred to as A and B

        A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
  and
        B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e}




                                                          20
Artificial Intelligence – CS364
                                     Fuzzy Logic


                   Fuzzy Sets Examples
• Support:
   supp(A) = {a, b, c, d }
   supp(B) = {a, b, c, d, e }


• Core:
   core(A) = {a}
   core(B) = {o}


• Cardinality:
   card(A) = 1+0.3+0.2+0.8+0 = 2.3
   card(B) = 0.6+0.9+0.1+0.3+0.2 = 2.1


                                                             21
Artificial Intelligence – CS364
                                     Fuzzy Logic


                  Fuzzy Sets Examples
• Complement:
   A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
   A = {0/a, 0.7/b, 0.8/c 0.2/d, 1/e}


• Union:
   A  B = {1/a, 0.9/b, 0.2/c, 0.8/d, 0.2/e}


• Intersection:
   A  B = {0.6/a, 0.3/b, 0.1/c, 0.3/d, 0/e}




                                                             22
Artificial Intelligence – CS364
                                     Fuzzy Logic


                   Fuzzy Sets Examples
• aA:
   for a=0.5
   aA = {0.5/a, 0.15/b, 0.1/c, 0.4/d, 0/e}


• Aa:
   for a=2
   Aa = {1/a, 0.09/b, 0.04/c, 0.64/d, 0/e}

• a-cut:
   A0.2 = {a, b, c, d}
   A0.3 = {a, b, d}
   A0.8 = {a, d}
   A1 = {a}

                                                             23
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
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
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
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
Artificial Intelligence – CS364
                                           Fuzzy Logic


                      Firing Fuzzy Rules
• These fuzzy sets provide the basis for a weight estimation model. The
  model is based on a relationship between a man’s height and his
  weight:
       IF      height is tall
       THEN weight is heavy
 Degree of                                    Degree of
 Membership                                   Membership
 1.0                                          1.0
                Tall men                                Heavy men
 0.8                                          0.8
 0.6                                          0.6

 0.4                                          0.4
 0.2                                          0.2
 0.0                                          0.0
    160       180          190       200            70     80       100          120
                             Height, cm                                   Weight, kg
                                                                                       28
Artificial Intelligence – CS364
                                           Fuzzy Logic


                      Firing Fuzzy Rules
• The value of the output or a truth membership grade of the rule
  consequent can be estimated directly from a corresponding truth
  membership grade in the antecedent. This form of fuzzy inference
  uses a method called monotonic selection.


Degree of                                   Degree of
Membership                                  Membership
1.0                                         1.0
               Tall men
0.8                                         0.8        Heavy men
0.6                                         0.6

0.4                                         0.4
0.2                                         0.2
0.0                                         0.0
      160    180          190         200         70        80     100         120
                             Height, cm                               Weight, kg
                                                                                     29
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
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
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 MINIMAL

RULE 2:
    IF   TEMP is COOL               THEN      SPEED is SLOW

RULE 3:
    IF   TEMP is PLEASANT           THEN      SPEED is MEDIUM

RULE 4:
    IF   TEMP is WARM               THEN      SPEED is FAST

RULE 5:
    IF   TEMP is HOT                THEN      SPEED is BLAST

                                                                 32
Artificial Intelligence – CS364
                                              Fuzzy Logic


                          Fuzzy Sets Example
The temperature graduations are
                                             Temp        COLD   COOL   PLEASANT   WARM        HOT
related to Johnny’s perception of            (0C).
ambient temperatures.
                                                     0    Y*     N        N        N           N

                                                     5    Y      Y        N        N           N
where:
                                                 10       N      Y        N        N           N
Y : temp value belongs to the set
(0<A(x)<1)                                    12.5       N      Y*       N        N           N

                                                 15       N      Y        N        N           N
Y* : temp value is the ideal member to         17.5       N      N        Y*       N           N
the set (A(x)=1)
                                                 20       N      N        N        Y           N

                                               22.5       N      N        N        Y*          N
N : temp value is not a member of the
set (A(x)=0)                                    25       N      N        N        Y           N

                                               27.5       N      N        N        N           Y

                                                 30       N      N        N        N          Y*


                                                                                         33
Artificial Intelligence – CS364
                                              Fuzzy Logic


                          Fuzzy Sets Example
Johnny’s perception of the speed of the    Rev/sec   MINIMAL   SLOW   MEDIUM   FAST    BLAST
motor is as follows:                       (RPM)
                                                 0     Y*       N       N       N          N

where:                                          10     Y        N       N       N          N

Y : temp value belongs to the set               20     Y        Y       N       N          N
(0<A(x)<1)                                     30     N        Y*      N       N          N

                                                40     N        Y       N       N          N
Y* : temp value is the ideal member to          50     N        N       Y*      N          N
the set (A(x)=1)                               60     N        N       N       Y          N

                                                70     N        N       N       Y*         N
N : temp value is not a member of the           80     N        N       N       Y          Y
set (A(x)=0)
                                                90     N        N       N       N          Y

                                               100     N        N       N       N          Y*




                                                                                      34
Artificial Intelligence – CS364
                                   Fuzzy Logic


                    Fuzzy Sets Example
• The analytically expressed membership for the reference
  fuzzy subsets for the temperature are:

• COLD:
   for 0 ≤ t ≤ 10        COLD(t) = – t / 10 + 1

• SLOW:
   for 0 ≤ t ≤ 12.5               SLOW(t) = t / 12.5
   for 12.5 ≤ t ≤ 17.5            SLOW(t) = – t / 5 + 3.5

• etc… all based on the linear equation:
   y = ax + b
                                                             35
Artificial Intelligence – CS364
                                             Fuzzy Logic


                             Fuzzy Sets Example

                               Temperature Fuzzy Sets

               1
              0.9
              0.8                                                         Cold
Truth Value




              0.7
              0.6                                                         Cool
              0.5                                                         Pleasent
              0.4
              0.3
                                                                          Warm
              0.2                                                         Hot
              0.1
               0
                    0   5     10      15        20         25        30

                            Temperature Degrees C


                                                                              36
Artificial Intelligence – CS364
                                  Fuzzy Logic


                     Fuzzy Sets Example
• The analytically expressed membership for the reference
  fuzzy subsets for the Speed are:

• MINIMAL:
   for 0 ≤ v ≤ 30                COLD(t) = – v / 30 + 1

• SLOW:
   for 10 ≤ v ≤ 30               SLOW(t) = v / 20 – 0.5
   for 30 ≤ v ≤ 50               SLOW(t) = – v / 20 + 2.5

• etc… all based on the linear equation:
   y = ax + b
                                                             37
Artificial Intelligence – CS364
                                                      Fuzzy Logic


                                  Fuzzy Sets Example
                                            Speed Fuzzy Sets

               1
              0.8                                                               MINIMAL
Truth Value




              0.6                                                               SLOW
                                                                                MEDIUM
              0.4
                                                                                FAST
              0.2                                                               BLAST
               0
                    0   10   20   30   40     50    60     70    80    90 100
                                            Speed


                                                                                  38
Artificial Intelligence – CS364
                                    Fuzzy Logic


                            Exercises
For
      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 B

Then, 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
Artificial Intelligence – CS364
                                       Fuzzy Logic


                               Solutions
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}
Support
   Supp(A) = {a, b, c, d}
   Supp(B) = {b, c, d, e}
Core
    Core(A) = {c}
    Core(B) = {}
Cardinality
    Card(A) = 0.2 + 0.4 + 1 + 0.8 + 0 = 2.4
    Card(B) = 0 + 0.9 + 0.3 + 0.2 + 0.1 = 1.5
Complement
   Comp(A) = {0.8/a, 0.6/b, 0/c, 0.2/d, 1/e}
   Comp(B) = {1/a, 0.1/b, 0.7/c, 0.8/d, 0.9/e}


                                                               40
Artificial Intelligence – CS364
                                       Fuzzy Logic


                               Solutions
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}
Union
    AB = {0.2/a, 0.9/b, 1/c, 0.8/d, 0.1/e}
Intersection
     AB = {0/a, 0.4/b, 0.3/c, 0.2/d, 0/e}
C=A2
   C = {0.04/a, 0.16/b, 1/c, 0.64/d, 0/e}

D = 0.5B
    D = {0/a, 0.45/b, 0.15/c, 0.1/d, 0.05/e}
E = A0.5
    E = {c, d}


                                                               41

Weitere ähnliche Inhalte

Was ist angesagt?

Extension principle
Extension principleExtension principle
Extension principleSavo Delić
 
6.3 Equivalences versus partitions
6.3 Equivalences versus partitions6.3 Equivalences versus partitions
6.3 Equivalences versus partitionsJan Plaza
 
Fuzzy logicintro by
Fuzzy logicintro by Fuzzy logicintro by
Fuzzy logicintro by Waseem Abbas
 
Evaluating classification algorithms
Evaluating classification algorithmsEvaluating classification algorithms
Evaluating classification algorithmsUtkarsh Sharma
 
Restoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarRestoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarSania Nisar
 
Fuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionFuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionNagasuri Bala Venkateswarlu
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differencesDr. Nirav Vyas
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematicsRachana Pathak
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic ProgrammingSahil Kumar
 
Introduction to Linear Discriminant Analysis
Introduction to Linear Discriminant AnalysisIntroduction to Linear Discriminant Analysis
Introduction to Linear Discriminant AnalysisJaclyn Kokx
 
Matrix mult class-17
Matrix mult class-17Matrix mult class-17
Matrix mult class-17Kumar
 
Matrix chain multiplication by MHM
Matrix chain multiplication by MHMMatrix chain multiplication by MHM
Matrix chain multiplication by MHMMd Mosharof Hosen
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functionsallyn joy calcaben
 
Find Transitive Closure Using Floyd-Warshall Algorithm
Find Transitive Closure Using Floyd-Warshall AlgorithmFind Transitive Closure Using Floyd-Warshall Algorithm
Find Transitive Closure Using Floyd-Warshall AlgorithmRajib Roy
 

Was ist angesagt? (20)

Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Extension principle
Extension principleExtension principle
Extension principle
 
6.3 Equivalences versus partitions
6.3 Equivalences versus partitions6.3 Equivalences versus partitions
6.3 Equivalences versus partitions
 
Fuzzy logicintro by
Fuzzy logicintro by Fuzzy logicintro by
Fuzzy logicintro by
 
Evaluating classification algorithms
Evaluating classification algorithmsEvaluating classification algorithms
Evaluating classification algorithms
 
Restoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarRestoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania Nisar
 
Fuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionFuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introduction
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differences
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Introduction to Linear Discriminant Analysis
Introduction to Linear Discriminant AnalysisIntroduction to Linear Discriminant Analysis
Introduction to Linear Discriminant Analysis
 
Fuzzy sets
Fuzzy setsFuzzy sets
Fuzzy sets
 
Matrix mult class-17
Matrix mult class-17Matrix mult class-17
Matrix mult class-17
 
Sorting
SortingSorting
Sorting
 
Matrix chain multiplication by MHM
Matrix chain multiplication by MHMMatrix chain multiplication by MHM
Matrix chain multiplication by MHM
 
Binary Search
Binary SearchBinary Search
Binary Search
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
Find Transitive Closure Using Floyd-Warshall Algorithm
Find Transitive Closure Using Floyd-Warshall AlgorithmFind Transitive Closure Using Floyd-Warshall Algorithm
Find Transitive Closure Using Floyd-Warshall Algorithm
 
Clique and sting
Clique and stingClique and sting
Clique and sting
 
Formula book
Formula bookFormula book
Formula book
 

Ähnlich wie Fuzzy Logic Fundamentals

23 fuzzy lecture ppt basics- new 23.ppt
23 fuzzy lecture ppt basics- new 23.ppt23 fuzzy lecture ppt basics- new 23.ppt
23 fuzzy lecture ppt basics- new 23.pptjdinfo444
 
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptxsaadurrehman35
 
Fuzzy Logic.pptx
Fuzzy Logic.pptxFuzzy Logic.pptx
Fuzzy Logic.pptxImXaib
 
Unit-II -Soft Computing.pdf
Unit-II -Soft Computing.pdfUnit-II -Soft Computing.pdf
Unit-II -Soft Computing.pdfRamya Nellutla
 
Fuzzy logic and fuzzy time series edited
Fuzzy logic and fuzzy time series   editedFuzzy logic and fuzzy time series   edited
Fuzzy logic and fuzzy time series editedProf Dr S.M.Aqil Burney
 
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Amit Kumar Rathi
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 

Ähnlich wie Fuzzy Logic Fundamentals (13)

23 fuzzy lecture ppt basics- new 23.ppt
23 fuzzy lecture ppt basics- new 23.ppt23 fuzzy lecture ppt basics- new 23.ppt
23 fuzzy lecture ppt basics- new 23.ppt
 
8709508
87095088709508
8709508
 
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
 
Fuzzy Logic.pptx
Fuzzy Logic.pptxFuzzy Logic.pptx
Fuzzy Logic.pptx
 
Classical Sets & fuzzy sets
Classical Sets & fuzzy setsClassical Sets & fuzzy sets
Classical Sets & fuzzy sets
 
Unit-II -Soft Computing.pdf
Unit-II -Soft Computing.pdfUnit-II -Soft Computing.pdf
Unit-II -Soft Computing.pdf
 
fuzzy
fuzzyfuzzy
fuzzy
 
WEEK-1.pdf
WEEK-1.pdfWEEK-1.pdf
WEEK-1.pdf
 
Fuzzy logic and fuzzy time series edited
Fuzzy logic and fuzzy time series   editedFuzzy logic and fuzzy time series   edited
Fuzzy logic and fuzzy time series edited
 
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
 
Soft computing Chapter 1
Soft computing Chapter 1Soft computing Chapter 1
Soft computing Chapter 1
 
FUZZY COMPLEMENT
FUZZY COMPLEMENTFUZZY COMPLEMENT
FUZZY COMPLEMENT
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 

Mehr von university of sargodha (10)

Soft computing06
Soft computing06Soft computing06
Soft computing06
 
Soft computing01
Soft computing01Soft computing01
Soft computing01
 
Final taxo
Final taxoFinal taxo
Final taxo
 
Advance analysis of algo
Advance analysis of algoAdvance analysis of algo
Advance analysis of algo
 
Soft computing08
Soft computing08Soft computing08
Soft computing08
 
Prolog2 (1)
Prolog2 (1)Prolog2 (1)
Prolog2 (1)
 
Presentation1
Presentation1Presentation1
Presentation1
 
Lecture 32 fuzzy systems
Lecture 32   fuzzy systemsLecture 32   fuzzy systems
Lecture 32 fuzzy systems
 
Lecture 29 fuzzy systems
Lecture 29   fuzzy systemsLecture 29   fuzzy systems
Lecture 29 fuzzy systems
 
Cobi t riskmanagementframework_iac
Cobi t riskmanagementframework_iacCobi t riskmanagementframework_iac
Cobi t riskmanagementframework_iac
 

Fuzzy Logic Fundamentals

  • 1. Artificial Intelligence – CS364 Fuzzy Logic Soft Computing: Fuzzy Logic 2 these slides are taken from the web and the author of these slides is: Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk
  • 2. Artificial Intelligence – CS364 Fuzzy Logic Contents • Characteristics of Fuzzy Sets • Operations • Properties • Fuzzy Rules • Examples 2
  • 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 Logic Operations 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
  • 10. Artificial Intelligence – CS364 Fuzzy Logic Operations of Fuzzy Sets (x) 1 A 0 x 1 Not A 0 x Complement (x) (x) 1 1 A B A B 0 0 x x 1 AB 1 AB 0 0 x x Intersection Union 10
  • 11. Artificial Intelligence – CS364 Fuzzy Logic Properties of Fuzzy Sets • Equality of two fuzzy sets • Inclusion of one set into another fuzzy set • Cardinality of a fuzzy set • An empty fuzzy set • -cuts (alpha-cuts) 11
  • 12. Artificial Intelligence – CS364 Fuzzy Logic Equality • Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF (iff): A(x) = B(x), xX A = 0.3/1 + 0.5/2 + 1/3 B = 0.3/1 + 0.5/2 + 1/3 therefore A = B 12
  • 13. Artificial Intelligence – CS364 Fuzzy Logic Inclusion • Inclusion of one fuzzy set into another fuzzy set. Fuzzy set A  X is included in (is a subset of) another fuzzy set, B  X: A(x)  B(x), xX Consider X = {1, 2, 3} and sets A and B A = 0.3/1 + 0.5/2 + 1/3; B = 0.5/1 + 0.55/2 + 1/3 then A is a subset of B, or A  B 13
  • 14. Artificial Intelligence – CS364 Fuzzy Logic Cardinality • Cardinality of a non-fuzzy set, Z, is the number of elements in Z. BUT the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is expressed as a SUM of the values of the membership function of A, A(x): cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n Consider X = {1, 2, 3} and sets A and B A = 0.3/1 + 0.5/2 + 1/3; B = 0.5/1 + 0.55/2 + 1/3 cardA = 1.8 cardB = 2.05 14
  • 15. Artificial Intelligence – CS364 Fuzzy Logic Empty Fuzzy Set • A fuzzy set A is empty, IF AND ONLY IF: A(x) = 0, xX Consider X = {1, 2, 3} and set A A = 0/1 + 0/2 + 0/3 then A is empty 15
  • 16. Artificial Intelligence – CS364 Fuzzy Logic Alpha-cut • An -cut or -level set of a fuzzy set A  X is an ORDINARY SET A  X, such that: A={A(x), xX}. Consider X = {1, 2, 3} and set A A = 0.3/1 + 0.5/2 + 1/3 then A0.5 = {2, 3}, A0.1 = {1, 2, 3}, A1 = {3} 16
  • 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
  • 19. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Set Math Operations • aA = {aA(x), xX} Let a =0.5, and A = {0.5/a, 0.3/b, 0.2/c, 1/d} then Aa = {0.25/a, 0.15/b, 0.1/c, 0.5/d} • Aa = {A(x)a, xX} Let a =2, and A = {0.5/a, 0.3/b, 0.2/c, 1/d} then Aa = {0.25/a, 0.09/b, 0.04/c, 1/d} • … 19
  • 20. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Examples • Consider two fuzzy subsets of the set X, X = {a, b, c, d, e } referred to as A and B A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e} and B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e} 20
  • 21. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Examples • Support: supp(A) = {a, b, c, d } supp(B) = {a, b, c, d, e } • Core: core(A) = {a} core(B) = {o} • Cardinality: card(A) = 1+0.3+0.2+0.8+0 = 2.3 card(B) = 0.6+0.9+0.1+0.3+0.2 = 2.1 21
  • 22. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Examples • Complement: A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e} A = {0/a, 0.7/b, 0.8/c 0.2/d, 1/e} • Union: A  B = {1/a, 0.9/b, 0.2/c, 0.8/d, 0.2/e} • Intersection: A  B = {0.6/a, 0.3/b, 0.1/c, 0.3/d, 0/e} 22
  • 23. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Examples • aA: for a=0.5 aA = {0.5/a, 0.15/b, 0.1/c, 0.4/d, 0/e} • Aa: for a=2 Aa = {1/a, 0.09/b, 0.04/c, 0.64/d, 0/e} • a-cut: A0.2 = {a, b, c, d} A0.3 = {a, b, d} A0.8 = {a, d} A1 = {a} 23
  • 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
  • 28. Artificial Intelligence – CS364 Fuzzy Logic Firing Fuzzy Rules • These fuzzy sets provide the basis for a weight estimation model. The model is based on a relationship between a man’s height and his weight: IF height is tall THEN weight is heavy Degree of Degree of Membership Membership 1.0 1.0 Tall men Heavy men 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 0.0 0.0 160 180 190 200 70 80 100 120 Height, cm Weight, kg 28
  • 29. Artificial Intelligence – CS364 Fuzzy Logic Firing Fuzzy Rules • The value of the output or a truth membership grade of the rule consequent can be estimated directly from a corresponding truth membership grade in the antecedent. This form of fuzzy inference uses a method called monotonic selection. Degree of Degree of Membership Membership 1.0 1.0 Tall men 0.8 0.8 Heavy men 0.6 0.6 0.4 0.4 0.2 0.2 0.0 0.0 160 180 190 200 70 80 100 120 Height, cm Weight, kg 29
  • 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 MINIMAL RULE 2: IF TEMP is COOL THEN SPEED is SLOW RULE 3: IF TEMP is PLEASANT THEN SPEED is MEDIUM RULE 4: IF TEMP is WARM THEN SPEED is FAST RULE 5: IF TEMP is HOT THEN SPEED is BLAST 32
  • 33. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example The temperature graduations are Temp COLD COOL PLEASANT WARM HOT related to Johnny’s perception of (0C). ambient temperatures. 0 Y* N N N N 5 Y Y N N N where: 10 N Y N N N Y : temp value belongs to the set (0<A(x)<1) 12.5 N Y* N N N 15 N Y N N N Y* : temp value is the ideal member to 17.5 N N Y* N N the set (A(x)=1) 20 N N N Y N 22.5 N N N Y* N N : temp value is not a member of the set (A(x)=0) 25 N N N Y N 27.5 N N N N Y 30 N N N N Y* 33
  • 34. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example Johnny’s perception of the speed of the Rev/sec MINIMAL SLOW MEDIUM FAST BLAST motor is as follows: (RPM) 0 Y* N N N N where: 10 Y N N N N Y : temp value belongs to the set 20 Y Y N N N (0<A(x)<1) 30 N Y* N N N 40 N Y N N N Y* : temp value is the ideal member to 50 N N Y* N N the set (A(x)=1) 60 N N N Y N 70 N N N Y* N N : temp value is not a member of the 80 N N N Y Y set (A(x)=0) 90 N N N N Y 100 N N N N Y* 34
  • 35. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example • The analytically expressed membership for the reference fuzzy subsets for the temperature are: • COLD: for 0 ≤ t ≤ 10 COLD(t) = – t / 10 + 1 • SLOW: for 0 ≤ t ≤ 12.5 SLOW(t) = t / 12.5 for 12.5 ≤ t ≤ 17.5 SLOW(t) = – t / 5 + 3.5 • etc… all based on the linear equation: y = ax + b 35
  • 36. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example Temperature Fuzzy Sets 1 0.9 0.8 Cold Truth Value 0.7 0.6 Cool 0.5 Pleasent 0.4 0.3 Warm 0.2 Hot 0.1 0 0 5 10 15 20 25 30 Temperature Degrees C 36
  • 37. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example • The analytically expressed membership for the reference fuzzy subsets for the Speed are: • MINIMAL: for 0 ≤ v ≤ 30 COLD(t) = – v / 30 + 1 • SLOW: for 10 ≤ v ≤ 30 SLOW(t) = v / 20 – 0.5 for 30 ≤ v ≤ 50 SLOW(t) = – v / 20 + 2.5 • etc… all based on the linear equation: y = ax + b 37
  • 38. Artificial Intelligence – CS364 Fuzzy Logic Fuzzy Sets Example Speed Fuzzy Sets 1 0.8 MINIMAL Truth Value 0.6 SLOW MEDIUM 0.4 FAST 0.2 BLAST 0 0 10 20 30 40 50 60 70 80 90 100 Speed 38
  • 39. Artificial Intelligence – CS364 Fuzzy Logic Exercises For 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 B Then, 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
  • 40. Artificial Intelligence – CS364 Fuzzy Logic Solutions 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} Support Supp(A) = {a, b, c, d} Supp(B) = {b, c, d, e} Core Core(A) = {c} Core(B) = {} Cardinality Card(A) = 0.2 + 0.4 + 1 + 0.8 + 0 = 2.4 Card(B) = 0 + 0.9 + 0.3 + 0.2 + 0.1 = 1.5 Complement Comp(A) = {0.8/a, 0.6/b, 0/c, 0.2/d, 1/e} Comp(B) = {1/a, 0.1/b, 0.7/c, 0.8/d, 0.9/e} 40
  • 41. Artificial Intelligence – CS364 Fuzzy Logic Solutions 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} Union AB = {0.2/a, 0.9/b, 1/c, 0.8/d, 0.1/e} Intersection AB = {0/a, 0.4/b, 0.3/c, 0.2/d, 0/e} C=A2 C = {0.04/a, 0.16/b, 1/c, 0.64/d, 0/e} D = 0.5B D = {0/a, 0.45/b, 0.15/c, 0.1/d, 0.05/e} E = A0.5 E = {c, d} 41