Docstoc

fuzzy_sets_fuzzy_logic

Document Sample
fuzzy_sets_fuzzy_logic Powered By Docstoc
					                      1/1




Fuzzy Rendszerek I.


   Dr. Kóczy László
                                                                              1/2
                          An Example
                                      • A class of students
                                         (E.G. M.Sc. Students taking „Fuzzy Theory”)
                                      • The universe of discourse: X

                                      • “Who does have a driver’s licence?”
                                      • A subset of X = A (Crisp) Set
                                      • (X) = CHARACTERISTIC FUNCTION
 1    0    1     1    0   1     1



                                      • “Who can drive very well?”
                                         (X) = MEMBERSHIP FUNCTION

0.7   0   1.0   0.8   0   0.4   0.2



                      FUZZY SET
                                                               1/3

            History of fuzzy theory
• Fuzzy sets & logic: Zadeh 1964/1965-
• Fuzzy algorithm: Zadeh 1968-(1973)-
• Fuzzy control by linguistic rules: Mamdani & Al. ~1975-
• Industrial applications: Japan 1987- (Fuzzy boom), Korea
  Home electronics
  Vehicle control
  Process control
  Pattern recognition & image processing
  Expert systems
  Military systems (USA ~1990-)
  Space research
• Applications to very complex control problems: Japan 1991-
  E.G. helicopter autopilot
                                                                       1/4

            An application example
One of the most interesting applications of fuzzy computing:
“FOREX” system.
1989-1992, Laboratory for International Fuzzy Engineering Research
(Yokohama, Japan) (Engineering – Financial Engineering)
To predict the change of exchange rates (FOReign EXchange)
~5600 rules like:
“IF the USA achieved military successes on the past day [E.G. in the
Gulf War] THEN ¥/$ will slightly rise.”




                           Inputs       FOREX
                       (Observations)            Prediction

                               Fuzzy Inference Engine
                                                                          1/5

                    Another Example
              ¥/$
     100




       1993               1994               1995          Time
What is fuzzy here?
- What is the tendency of the ¥/$ exchange rate?
“It’s MORE OR LESS falling” (The general tendency is “falling”, there’s
no big interval of rising, etc.)
- What is the current rate?
Approximately 88 ¥/$  Fuzzy number
- When did it first cross the magic 100 ¥/$ rate? SOMEWHEN in mid
1995
                                                                   1/6

                    A complex problem




                                      Many components, very complex
                                      system. Can AI system solve it?
                                      Not, as far as we know. But WE
                                      can.
Our car, save fuel, save time, etc.
                                                                  1/7

                      Definitions
• Crisp set:                                        c•
                      aA             •x
                                                     •d      •b
                      bA             •y
                                                     •a
                                 B
• Convex set:                                  Crisp set A
  A is not convex as aA, cA, but
  d=a+(1-)c A, [0, 1].
  B is convex as for every x, yB and
  [0, 1] z=x+(1-)y B.


• Subset:                                      If xA then
                                           B   also xB.
                                     •y
                          •x
                                 A             AB
                                                         1/8

                   Definitions
• Equal sets:
  If AB and BA then A=B if not so AB.


• Proper subset:
  If there is at least one yB such that yA then AB.


• Empty set: No such x.

• Characteristic function:
  A(x): X{0, 1}, where X the universe.
  0 value: x is not a member,
  1 value: x is a member.
                                                                            1/9

                            Definitions
  A={1, 2, 3, 4, 5, 6}
• Cardinality: |A|=6.
• Power set of A:
  P (A)={{}=Ø, {1}, {2}, {3}, {4}, {5}, {6}, {1, 2}, {1, 3}, {1, 4},
  {1, 5}, {1, 6}, {2, 3}, {2, 4}, {2, 5}, {2, 6}, {3, 4}, {3, 5}, {3, 6},
  {4, 5}, {4, 6}, {5, 6}, {1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2, 6}, {1, 3,
  4}, {1, 3, 5}, {1, 3, 6}, {1, 4, 5}, {1, 4, 6}, {1, 5, 6}, {2, 3, 4}, {2,
  3, 5}, {2, 3, 6}, {2, 4, 5}, {2, 4, 6}, {2, 5, 6}, {3, 4, 5}, {3, 4, 6},
  {3, 5, 6}, {4, 5, 6}, {1, 2, 3, 4}, {1, 2, 3, 5}, {1, 2, 3, 6}, {1, 2, 4,
  5}, {1, 2, 4, 6}, {1, 2, 5, 6}, {1, 3, 4, 5}, {1, 3, 4, 6}, {1, 3, 5, 6},
  {1, 4, 5, 6}, {2, 3, 4, 5}, {2, 3, 4, 6}, {2, 3, 5, 6}, {2, 4, 5, 6}, {3, 4,
  5, 6}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 6}, {1, 2, 4, 5, 6}, {1, 3, 4, 5, 6},
  {2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}}.
  |P (A)|=2|6|=64.
                                                         1 / 10

                             Definitions
• Relative complement or difference:
  A–B={x | xA and xB}
  B={1, 3, 4, 5}, A–B={2, 6}.
  C={1, 3, 4, 5, 7, 8}, A–C={2, 6}!
• Complement: A  X  Awhere X is the universe.
  Complementation is involutive: A  A
  Basic properties:   X,
                   X
• Union:
  AB={x | xA or xB}
                       n
  For   Ai | i  I  Ai  x | x  Ai for some i
                      i 1
        AX  X
        A   A              (Law of excluded middle)

        AA  X
                                                                   1 / 11

                           Definitions
• Intersection:
  AB={x | xA and xB}.
                                    n
                For   Ai | i  I  Ai  x | x  Ai for all i
                                   i 1
                 A   
                 AX  A           (Law of contradiction)

                 AA  

• More properties:
    Commutativity:            AB=BA, AB=BA.
    Associativity:       ABC=(AB)C=A(BC),
                         ABC=(AB)C=A(BC).
    Idempotence:              AA=A, AA=A.
    Distributivity:
                         A(BC)=(AB)(AC),
                         A(BC)=(AB)(AC).
                                                               1 / 12

                      Definitions
• More properties (continued):
     DeMorgan’s laws:       AB  AB
                            AB  AB

• Disjoint sets: AB=.
• Partition of X:
                                                          
         x   A i | i  I, A i1  A i 2  ,  A i  X 
                                                iI       
                                      6
                                X   Ai
                                     i 1
                                Ai  A j  
                                A i | i  N 6   x 
                                                             1 / 13

                 Summarize properties
Involution                               AA
Commutativity                 AB=BA, AB=BA
                           ABC=(AB)C=A(BC),
Associativity
                           ABC=(AB)C=A(BC)
                             A(BC)=(AB)(AC),
Distributivity
                             A(BC)=(AB)(AC)
Idempotence                      AA=A, AA=A
Absorption                   A(AB)=A, A(AB)=A
                                A  A  B  A  B
Absorption of complement        A  A  B  A  B
Abs. by X and                  AX=X, A=
Identity                         A=A, AX=A
Law of contradiction                AA  
Law of excl. middle                 AA  X
DeMorgan’s laws            A B  A B         A B  A B
                                                                       1 / 14

                   Membership function
             Crisp set                             Fuzzy set
         Characteristic function                Membership function
            A:X{0, 1}                           A:X[0, 1]




                                                           
                                    0        x  5  x  17
             1                                             
A                       B   0.2x  5     5  x  10       C  2
       1  5 x 102           1                          
                                                                        A

                                7 x  17  10  x  17 
                                                           
                                          1 / 19

      Some basic concepts of fuzzy sets
 Ele-   Infant Adult   Young   Old
ments

 5        0      0      1      0

 10       0      0      1      0

 20       0     .8      .8     .1

 30       0      1      .5     .2

 40       0      1      .2     .4

 50       0      1      .1     .6

 60       0      1      0      .8

 70       0      1      0      1

 80       0      1      0      1
                                               1 / 20

  Some basic concepts of fuzzy sets
• Support: supp(A)={x | A(x)>0}.
    supp:   ~
           P x   P x 
  Infant=0, so supp(Infant)=0.
  If |supp(A)|<, A can be defined
             A=1/x1+ 2/x2+…+ n/xn.
                 n
          A   i / x i       A    A x  / x
                i 1                x
• Kernel (Nucleus, Core):
   Kernel(A)={x | A(x)=1}.
                                                                    1 / 21

                         Definitions
• Height:          Height (A)  max ( A ( x ))  sup ( A ( x ))
                                   x                 x
       • height(old)=1         height(infant)=0
   – If height(A)=1            A is normal
   – If height(A)<1            A is subnormal
   – height(0)=0


• a-cut: A a  {x |  A ( x )  a}
  Strong Cut: A a  {x |  A ( x )  a}
      • Young 0.8  {5,10, 20}       Young 0.8  {5,10}
   – Kernel:     A1  {x |  A ( x )  1}
   – Support: A 0  {x |  A ( x )  0}
      • If A is subnormal, Kernel(A)=0
   – A a  A IF         a
                                                           1 / 22

                      Definitions
• Level set of A:
       A  {a |  A ( x )  a for some x  X}
• Convex fuzzy set:
      X  n
  – A is convex if for every x,yX and
     [0,1]:
         A (x  (1  ) y)  min(  A ( x ),  A ( y))
  – All sets on the previous figure are
    convex FS‟s
                                            1 / 23

               Definitions
• Nonconvex fuzzy set:




• Convex fuzzy set over R      2


         x2   Kernel
                            a=0.2
                          a=0.4
                       a=0.8   a=0.6




                                       x1
                                                                      1 / 24

                      Definitions
• Fuzzy cardinality of FS A:
  Fuzzy number A  ~


               A  Aa   a for all aA
                ~
     ~
    O l d  0.1 / 7  0.2 / 6  0.4 / 5  0.6 / 4  0.3 / 3  1 / 2
                                                                  1 / 25

                     Definitions
• Fuzzy number: Convex and normal fuzzy set of 
  – Example 1:                                      N
                       1



                       0
    height(N(r))=1                r1   r*       r2   
    for any r1, r2: N(r*)= N(r1+(1- )r2)  min(N(r1), N(r2))
  – Example 2: “Approximately equal to 6”
                 r 6
             1        if r  [3, 9]
   N (r )        3                                     N(r)
             0 otherwise
             
                             1
                                  

                               0
                                             3      6     9    
                                                  1 / 26

                 Definitions
• Flat fuzzy number:
  There is a,b (ab, a,b) N(r)=1 IFF r[a,b]
            (Extension of „interval‟)
• Containment (inclusion) of fuzzy set
      AB IFF A(x) B(x)
  – Example:                Old Adult
• Equal fuzzy sets
   A=B IFF AB and AB If it is not the case: AB
• Proper subset
     AB IFF AB and A  B
  – Example:                Old Adult
                                                      1 / 27

                         Definitions
• Extension principle:
  How to generalize crisp concepts to fuzzy?
     Suppose that X and Y are crisp sets
     X={xi}, Y={yi} and f: XY
                               ~
     If given a fuzzy set A  P x 
           n
                                     ~
     A   i / xi THEN B  P (Y ) IS
         i 1        n          n
     B  f  A  f   i / xi    i / f  xi 
                               
                     i 1       i 1

                                        
     The latter is understood that if for
     yi  f xij FOR xij | j n THEN
       yi   max  x j | f x j   yi 
     IF      THEN   y   0
           i
          xj                           i
                                                          1 / 28

                      Definitions
  – Example                               a  d
                                          
    X={a,b,c}                         f  b  f
    Y={d,e,f}                             c  d
                                          
                 A  X   .1/ a  .5 / b  .8 / c
                 f  AY   .8 / d  .5 / f

• Arithmetics with fuzzy numbers:
  Using extension principle
      a+b=c       (a,b,c  )

     A+B=C
                    
                             ~
                                     ~
                     A, B  P  EVEN C  
                                            
                                                      
                    WHAT IS C ?            
                                           
                                                                                         1 / 29

                                 Example
                
    1                       A               B             C

    0
        0 1             2   3    4 5 6 7 8 9 10 11 12                                
                            C n  max min A a ,  B b | a  b  n
                                    a,b


n       a           b       min(A,B)           n        a       b       min(A,B)
    3       0           3           0                7        2       5         1
    4       0           4           0                         3       4        0.5
            1           3           0                         4       3         0

    5       0           5           0                8        1       7         0
            1           4          0.5                        2       6        0.5
            2           3           0                         3       5        0.5
                                                              4       4         0
    6       0           6           0
            1           5          0.5               9        2       7         0
            2           4          0.5                        3       6        0.5
            3           3                                     4       5         0

    7        0          7           0                10       3       7        0
             1          6          0.5                        4       6        0
            ...                                      11       4       7        0
                                                      1 / 30

                   Definitions
• Fuzzy set operations defined by L.A. Zadeh in
  1964/1965
• Complement:  A x   1   A x 
• Intersection:   AB x   min A x , B x 
• Union:           AB x   max  A x ,  B x 

   (x):
     
   0  x  A, B
     
   1  x  A, B
                                                     1 / 31

               Definitions

This is really a generalization of crisp set op’s!
  A     B     A   AB AB       1-A   min   max
  0     0      1     0     0      1     0     0
  0     1      1     0     1      1     0     1
  1     0      0     0     1      0     0     1
  1     1      0     1     1      0     1     1
                                                            1 / 32

        Classical (Two valued) logic
• Classical (two valued logic):
  Any logic – Means of a reasoning propositions: true
  (1) or false (0). Propositional logic uses logic
  variables, every variable stands for a proposition.
  When combining LV‟s new variables (new
  propositions) can be constricted.
  Logical function:
  f: v1, v2, …, vn  vn+1
        2ndifferent logic functions of n variables exist.
•   2
    E.G. if n=2, 16 different logic functions (see next
    page).
                                                           1 / 33

Logic functions of two variables
 v2   1100   Adopted name    Symbol   Other names used
 v1   1010
 w1   0000      Zero fn.       0           Falsum
 w2   0001      Nor fn.      v1v2        Pierce fn.
 w3   0010     Inhibition    v1>v2     Proper inequality
 w4   0011     Negation       v2        Complement
 w5   0100     Inhibition    v1<v2     Proper inequality
 w6   0101     Negation       v1        Complement
 w7   0110    Excl. or fn.   v1v2       Antivalence
 w8   0111     Nand fn.      v1v2      Sheffer Stroke
 w9   1000    Conjunction    v1v2       And function
w10   1001   Biconditional   v1v2       Equivalence
w11   1010     Assertion       v1          Identity
w12   1011    Implication    v1v2    Conditional, ineq.
w13   1100     Assertion       v2          Identity
w14   1101    Implication    v1v2    Conditional, ineq.
w15   1110    Disjunction    v1v2       Or function
w16   1111      One fn.        1            Verum
                                                    1 / 34

                  Definitions
• Important concern:
  How to express all logic fn‟s by a few logic
  primitives (fn‟s of one or two lv‟s)?

  A system of lp‟s is (functionally) complete if all
  LF‟s can be expressed by the FNs in the system.

  A system is a base system if it is functionally
  complete and when omitting any of its elements
  the new system isn‟t functionally complete.
                                                   1 / 35

                        Definitions
• A system of LFN‟s is functionally complete if:
  –   At least one doesn‟t preserve 0
  –   At least one doesn‟t preserve 1
  –   At least one isn‟t monotonic
  –   At least one isn‟t self dual
  –   At least one isn‟t linear
• Example:               AND , NOT
            A         00
            A         1 1
            A         0  1, 1  0, 0  1, 1  0
            A  B A  B  A  B  A  B 
            A  B CANNOT BE EXPRESSED
                      BY ONLY 
                                                      1 / 36

                    Definitions
• Importance of base systems, and functionally
  complete systems.
  Digital engineering:
  Which set of primitive digital circuits is suitable to
  construct an arbitrary circuit?
• Very usual: AND, OR, NOT (Not easy from the point
  of view of technology!)
• NAND (Sheffer stroke)

• NOR (Pierce function)

• NOT, IMPLICATION (Very popular among logicians.)
                                                                       1 / 37

                          Definitions
• Logic formulas:
   – E.G.: Let‟s adopt +,-,* as a complete system. Then:
     • 0 and 1 are LFs          • If A and B are LFs, then A+B, A*B are LFs
     • If v is a LF v is a LF   • There are no other LFs

   – Similarly with -,, etc.
• There are infinitely many ways to describe a LF in an
  equivalent way
   – E.G.: A, A, A+A, A*A, A+A+A, etc.
• Canonical formulas, normal form
   – DCF AB  AB  AB  A  B
   – CCF A  B A  B  AB  AB
   – Logic formulas with identical truth values are named
     equivalent               a=b
                                                                           1 / 38

                        Definitions
• Always true logic formulas:
       Tautology:          AA+A
• Always false logic formulas:
       Contradiction:      AA
• Various forms of tautologies are used for didactive
  inference = inference rules
   – Modus Ponens:
            (a*(ab))b
   – Modus Tollens:
               b * a  b  a
   – Hypothetical Syllogism:
              ((a b)*(b c)) (a c)
   – Rule of Substitution:
              If in a tautology any variable is replaced by a LF then it
              remains a tautology.
                                                 1 / 39

                 Definitions
• These inference rules form the base of expert
  systems and related systems (even fuzzy control!)
• Abstract algebraic model:
  Boolean Algebra
            B=(B,+,*,-)
  B has at least two different elements (bounds): 0
  and 1
  + some properties of binary OPs “+” and “*”, and
  unary OP “-”.
                                                     1 / 40

Properties of boolean algebras

B1. Idempotence            a+a=a, a·a=a
B2. Commutativity            a+b=b+a
B3. Associativity        (a+b)+c=a+(b+c),      Lattice
                          (a·b)·c=a·(b·c)
B4. Absorption          a+(a·b)=a, a·(a+b)=a
B5. Distributivity      a·(b+c)=(a·b)+(a·c),
                        a+(b·c)=(a+b)·(a+c)
B6. Universal bounds       a+0=a, a+1=1
                           a·1=a, a·0=0
B7. Complementarity    a+a=1, a·a=0, 1=0
B8. Involution           (a+b)= a · b
B9.Dualization           (a·b)= a +b
                                                       1 / 41

                      Definitions
  Set
theory
         Boolean
         algebra
                   Propositional
                       logic       • Correspondences
 P(X)       B          F(V)          defining
          +            
                                     isomorphisms
                                     between set theory,
          *            
                                     boolean algebra and
  -         -            -           propositional logic
  X        1            1

          0            0

                      
                                                1 / 42

                   Definitions
• Isomorphic structure of crisp set and logic
  operations = boolean algebra
                      Lattice


                        B.A.



• Structure of propositions:
                x is P
  –     Dr. Kóczy is above190cm
          
                     
                        
            x1             P
         SUBJECT    PREDICATE TRUE
  –   x2=Dr.Kim       P(x2)=FALSE!
                                                 1 / 43

                 Definitions

• Quantifiers:
  – (x) P(x):   There exists an x such
     that x is P
  – (x) P(x): For all x, x is P
  – (!x) P(x): x and only one x such that x is P
                                                                           1 / 44

                          Definitions
• Two valued logic questioned since B.C.
  Three valued logic includes indeterminate value: ½
  Negation: 1-a,  differ in these logics.
• Examples:
                  Łukasiewicz   Bochvar   Kleene   Heyting   Reichenbach
          ab                                                  
                                       
           00      0011         0011      0011     0011       0011
           0½      0½1½         ½½½½      0½1½     0½10       0½1½
           01      0110         0110      0110     0110       0110
           ½0      0½½½         ½½½½      0½½½     0½00       0½½½
           ½½      ½½11         ½½½½      ½½½½     ½½11       ½½11
           ½1      ½11½         ½½½½      ½11½     ½11½       ½11½
           10      0100         0100      0100     0100       0100
           1½      ½1½½         ½½½½      ½1½½     ½1½½       ½1½½
           11      1111         1111      1111     1111       1111
                                                      1 / 45

                 Definitions
• No difference from classical logic for 0 and 1.

      But:   a  a  0, a  a  1     are not true!

• Quasi tautology: doesn‟t assume 0. Quasi
  contradiction: doesn‟t assume 1.
• Next step?
                                               1 / 46

               N-valued logic
• N-valued logic:
                    1          n2 
           Tn  0,     , ... ,     ,1
                  n 1         n 1 
     Degrees of truth
           (Lukasiewicz, ~1933)
       a  1- a
       a  b  min a, b            LOGIC
       a  b  max a, b 
       a  b  min(1,1  b - a)   PRIMITIVES
       a  b  1- a - b
                                                                1 / 47

                      Definitions
• Ln n=2, … ,                Rational truth
             (0)               values
     Classical Logic
  If T is extended to [0,1] we obtain (T ) L1 with continuum
                                          1
  truth degrees
• L1 is isomorphic with fuzzy set

  It is enough to study one of them, it will reveal all the facts
  above the other.
• Fuzzy logic must be the foundator of approximate
  reasoning, based on natural language!
                                                                  1 / 48

                   Fuzzy Proportion
• Fuzzy proportion: X is P
  „Tina is young‟, where:
  „Tina‟: Crisp age, „young‟: fuzzy predicate.
        Fuzzy sets expressing         Truth claims – Fuzzy sets
       linguistic terms for ages              over [0, 1]




   • Fuzzy logic based approximate reasoning
   is most important for applications!

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:14
posted:8/23/2011
language:Hungarian
pages:44