AI FuzzySets

Embed Size (px)

Citation preview

  • 8/20/2019 AI FuzzySets

    1/21

    Conventional Sets andFuzzy Sets 

    2

    Conventional Sets 

     A set is a collection of things, for example the room

    temperature, the set of all real numbers, etc….

  • 8/20/2019 AI FuzzySets

    2/21

    3

    Conventional Sets 

    Such collection of things are called the Universe of

    Discourse, X, and is defined as the range of all possible

    values for a variable.

    Universe of Discourse can be divided into sets or subsets.

    For Example, consider a set A of the real numbers between 5

    and 8 from the universe of discourse X.

    Conventional sets called crisp sets 

    X

    5 8

    4

    Conventional Sets 

    If we have two sets A and B consisting of a collection of

    elements in X universe of discourse.

     x Є   X (x belongs to X) 

     x Є   A (x belongs to A) 

     x Є   X (x does not belong to A) 

     A B (A is fully contained in B; if x Є   A, then x Є  B) 

     A B (A is contained in or is equivalent to B) 

     A = B (A B and B A)

    The null set Ø is the set with no elements, and the whole set

     , X, is the set of elements in the universe.

    Operations on Classical Sets 

  • 8/20/2019 AI FuzzySets

    3/21

    5

    Conventional Sets 

     A U B ; the union represent all elements that reside in

    both sets A and B. This is called the logic or.

    Operations on Classical Sets: Union 

     A

    B

     A U B = [x | x Є   A or  x Є  B ]

    6

    Conventional Sets 

    Operations on Classical Sets: Intersection 

     A Π B ; the intersection represent all elements that

    simultaneously reside in both sets A and B. This is called the

    logic and.

     A

    B

     A Π B = [ x | x  Є   A and  x Є  B ]

  • 8/20/2019 AI FuzzySets

    4/21

    7

    Conventional Sets 

    Operations on Classical Sets: Complement 

    Є  

      Ā  ; the complement of set A is the collection of all

    elements on the universe that do not reside in set A.

      Ā = [ x | x A and  x Є   X ]

     A

    8

    Conventional Sets 

    Operations on Classical Sets: Difference 

    Є  

     A | B  ; the collection of all elements on the universe

    that reside in A and do not reside in B at the same time.

     A | B = [ x | x  Є   A and  x B]

    B

     A

  • 8/20/2019 AI FuzzySets

    5/21

    9

    Conventional Sets 

    Properties of Classical Sets 

    Commutativity: A U B = B U A; also for the intersection

     Associativity: A U (B U C) = (A U B) U C

    Distributivity: A U (B Π C) = (A U B) Π (A U C)

    Transitivity: if A B C , then A C.

    Identity:  A U Ø = A

     A Π Ø = Ø

     A U X = X 

     A Π X = A

    10

    Conventional Sets 

    Properties of Classical Sets 

    Law of Excluded Middle:

     A U  Ā = X 

     A Π Ā = Ø

    De Morgan’s law: 

     A Π B =  Ā U B

     A U B =  Ā Π B

    The complement of a union or an intersection is equal to the

    intersection or union of the respective complement 

     AB

     A

    B

  • 8/20/2019 AI FuzzySets

    6/21

    11

    Conventional Sets 

    Properties of Classical Sets: Example 

    The survival of the arch will be represented by E1 Π E2.

    The collapse is E1 Π E2. Logically collapse will occur if either

    members fail, i.e., E1 U E2.

    Consider an arch consists of two members,

    if either members fails then the arch will

    collapse. If E1 represents survival of

    member 1 and E2 member 2.

    Load 

    12

    Conventional Sets 

    Mapping 

    If an element x is contained in X and corresponds to an

    element y contained in Y, it is termed a mapping from X

    to Y, ƒ : X Y.

    This is called the characteristic function 

     µ  A(x) =1, x Є   A

    0, x AЄ  

    X

    5 8

  • 8/20/2019 AI FuzzySets

    7/21

    13

    Fuzzy Sets 

    In classic sets, the transition of an element in the

    universe between being a member and non member in a

    given set is abrupt.

    In fuzzy sets, this transition occurs gradually 

     A fuzzy set is a set containing elements that have varying

    degree of membership in the set.

     Accordingly, elements in a fuzzy sets can be members of

    other fuzzy set on the same universe.

    Elements of fuzzy sets are mapped to a universe of

    membership values using a function-theoretic form 

    14

    Fuzzy Sets 

    This function maps elements of fuzzy set A to a real

    numbered value between 0 and 1.

     A fuzzy set A in the universe X can be defined as set of

    ordered pairs 

     A = {(x, µ  A(x ) |x Є   X}

     A discrete and finite fuzzy set is represented as follow 

     A =

    When x is continuous A =  ∫   µ  A(x ) /x

     µ  A(x1 ) /x1 + µ  A(x2 ) /x2 +………

  • 8/20/2019 AI FuzzySets

    8/21

    15

    Fuzzy Sets 

    0 0 0 .1 .3 .5 .7 .9 1 1 Low 

    100 

    90 

    .8 

    .5 

    70 

    .3 

    60 

    .5 

    40 

    .1 

    30 

    10 

    .5 .8 0 Medium 

    .8 .1 0 High 

    80 50 20 Score 

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    0 10 20 30 40 50 60 70 80 90 100 110

    low medium high

    Example 

    16

    Fuzzy Sets 

    100 

    90 

    .8 

    70 

    60 

    .5 

    40 

    .1 

    30 

    10 

    .5 .8 0 Medium 

    80 50 20 Score 

    Example 

    B = Medium score = {(10, 0), (20, 0), (30, .1), (40, .5), (50,

    .8), (60, 1), (70, .8), (80, .5), (90, 0), (100, 0)} Or B = (30, .1), (40, .5), (50, .8), (60, 1), (70, .8), (80, .5)}

    Or B = 0.1/30 + 0.5/40 + 0.8/50 + 1/60 + 0.8/70 +

    0.5/80

  • 8/20/2019 AI FuzzySets

    9/21

    17

    Fuzzy Sets 

    Fuzzy Sets Operations 

    Union: the membership functions of the union of the two

    fuzzy sets A and B is defined as the maximum of both 

     µ  A U B (x) = µ  A (x) V µ B (x)

    18

    Fuzzy Sets 

    Fuzzy Sets Operations 

    Intersection: the membership functions of the intersection

    of the two fuzzy sets A and B is defined as the minimum of

    both 

     µ  A Π B (x) = µ  A (x) ^ µ B (x)

  • 8/20/2019 AI FuzzySets

    10/21

    19

    Fuzzy Sets 

    Fuzzy Sets Operations 

    Complement: the membership functions of the complement

    of fuzzy set A is defined as 

    20

    Fuzzy Sets 

    Fuzzy Sets Operations 

    The same operations of the classical sets are still valid for

    the fuzzy sets.

    Commutativity: A U B = B U A; also for the intersection

     Associativity: A U (B U C) = (A U B) U C

    Distributivity: A U (B Π C) = (A U B) Π (A U C)

    Transitivity: if A B and B C , then A C.

    De Morgan’s law 

  • 8/20/2019 AI FuzzySets

    11/21

    21

    Fuzzy Sets 

    Two fuzzy sets are equal if and only if µ  A (x) = µ B (x) for all

     x Є   X.

     A is a sub set of B: A B, if and only if µ  A (x)

  • 8/20/2019 AI FuzzySets

    12/21

    23

    Fuzzy Sets 

    Example 

    Consider the following two fuzzy sets: 

     A = { 1/2 + .5/3 + .3/4 + .2/5}

    B = {.5/2 + .7/3 + .2/4 + .4/5}

    Difference A | B = A Π B = {.5/2 + .3/3 + .3/4 +.2/5}

    De Mogan’s law = A U B =  Ā Π B = { 1/1 + 0/2 + .3/3 +

    .7/4 +.6/5}

    24

    Fuzzy Sets 

    Normal Fuzzy Set 

     A fuzzy set A is normal if its maximal degree of membership

    is unity (i.e., there must exist at least one x for which  µ  A (x)

    = 1. On the other hand, non-normal fuzzy sets have

    maximum degree of membership less than one Degree of

    Membership

    Universe of Discourse0

    1

  • 8/20/2019 AI FuzzySets

    13/21

    25

    Fuzzy Sets 

    Support of a Fuzzy Set 

    Support of a fuzzy set A

    (written as supp(A)) is a

    (crisp) set of points in X for

    which  µ  A is positive supp(A)

    = { x Є   X |  µ  A (x)>0}

    100 

    90 

    .8 

    70 

    60 

    .5 

    40 

    .1 

    30 

    10 

    .5 .8 0 Medium 

    80 50 20 Score 

    Support (B) = Medium score = {30, 40, 50, 60, 70, 80}

    26

    Fuzzy Sets 

    Convex Fuzzy Set 

     A fuzzy set A is convex if and only if it satisfies the

    following   µ  A ( λ x1 + (1 –  λ ) x2 ) ≥ min (  µ  A ( x1) ,  µ  A ( x2 )),

    where λ is in the interval [0,1], and x1 < x2

  • 8/20/2019 AI FuzzySets

    14/21

    27

    Fuzzy Sets 

    α -cut of a Fuzzy Set 

      α -cut is defined as a crisp set A α  (or a crisp interval) for a

     particular degree of membership, α : A α = [a α  , b α ]  , where α can take on values between [0,1]

    28

    Fuzzy Sets 

    α -cut of a Fuzzy Set: Example 

    Consider the score example 

    100 

    90 

    .8 

    70 

    60 

    .5 

    40 

    .1 

    30 

    10 

    .5 .8 0 Medium 

    80 50 20 Score 

    B 0.8 = Medium score 0.8 = { 50, 60, 70}

  • 8/20/2019 AI FuzzySets

    15/21

    29

    Fuzzy Sets 

    Fuzzy Numbers 

    Fuzzy number is a fuzzy set which is both normal and

    convex. In addition, the membership function of a fuzzy

    number must be piecewise continuous .

    Most common types of fuzzy numbers are triangular and

    trapezoidal. Other types of fuzzy numbers are possible,

    such as bell-shaped or gaussian fuzzy numbers, as well as a

    variety of one sided fuzzy numbers. Triangular fuzzy

    numbers are defined by three parameters, while

    trapezoidal require four parameters

    30

    Fuzzy Sets 

    Fuzzy Numbers 

  • 8/20/2019 AI FuzzySets

    16/21

    31

    Fuzzy Sets 

    Resolution Principle 

     A fuzzy set A can be expanded in terms of its α -cuts.

     µ  A (x) = α ^ µ  A α (x); x Є   X 

    This means that a fuzzy set can be decomposed into α  A α  , α 

    Є  [0, 1].

     X 

     µ A(x)

    1

    α2

    α1

    α2 Aα2

    α1 Aα1

     Aα2 Aα1

    32

    Fuzzy Sets 

    Resolution Principle: Example 

    Consider the following fuzzy set: 

     A = {.1/50 + .3/60 + .5/70 + .8/80 + 1/90 + 1/100}

    Using the resolution principle:

     A = .1 {1/50 + 1/60 + 1/70 + 1/80 +1/90 + 1/100}+ .3 {1/60 + 1/70 + 1/80 +1/90 + 1/100}

    + .5 {1/70 + 1/80 +1/90 + 1/100}

    + .8 {1/80 +1/90 + 1/100}

    + 1 {1/90 + 1/100}

    = .1 A.1 + .3 A.3 + .5 A.5 + .8 A.8 + 1A1

  • 8/20/2019 AI FuzzySets

    17/21

    33

    Fuzzy Sets 

    Representation Theorem 

     As opposed to the resolution principle, a fuzzy set A can be

    represent in terms of its α -cuts. i.e., A fuzzy set can be

    retrieved as a union of its α  A α .

     A = U α  A α 

     X 

     µ A(x)

    1

    α2

    α

    1

     Aα2 Aα1

    34

    Fuzzy Sets 

    Representation Theorem: Example 

    If we are given: A 0.1 = {1, 2, 3, 4, 5}, A 0.4 = {2, 3, 5}, A 0.8 =

    {2, 3}, and A 1 = {3}

    Then, fuzzy set A can be expressed as: A = U α  A α  for α Є  [0,

    1].

     A = 0.1 A 0.1 + 0.4 A 0.4 + 0.8 A 0.8 + 1 A 1

    = 0 .1 {1/1 + 1/2 + 1/3 + 1/4 +1/5}

    + 0.4 {1/2 + 1/3 + 1/5}

    + 0.8 {1/2 + 1/3}

    + 1 {1/3}

    = 0.1/1 + 0.8/2 + 1/3 + 0.1/4 + 0.4/5

  • 8/20/2019 AI FuzzySets

    18/21

    35

    Fuzzy Sets 

    Extension Principle 

    Consider a single relationship between one independent

    variable x and one dependent variable y.

     ƒ(x)  x  y

    The function ƒ(x) represents the mapping of x on y.

    y = ƒ(x) 

    The function y = ax + b, are mapping from one universe X

    to another universe Y and is written as:

     ƒ : X Y

    Sometimes it is called the image of x under ƒ for y=ƒ(x) 

    36

    Fuzzy Sets 

    Extension Principle 

    The extension principle can be also applied to fuzzy sets.

    Given a function f : U V , and a set A in U for x Є  U,

    then its image, set B, in the universe V is found from the

    mapping, B = ƒ(A) 

     x B (y) = x f(A) (y)

     µ B (y) = V  µ f(A) (y); y=f(x) 

  • 8/20/2019 AI FuzzySets

    19/21

    37

    Fuzzy Sets 

    Extension Principle: Example 

    Consider a crisp set A = [0, 1 ] defined in the universe X ={-2, -1, 0, 1, 2}, where A = {0/-2 + 0/-1 + 1/0 + 1/1

    +0/2} and mapping function y= |4x|+2. Find the set B on

    an output universe Y using the extension principle.

    The universe Y = f(x) for x Є   X 

    Then Y = {2, 6, 10}, the mapping for membership

     µ B (2) = V [ µ  A (0) ] = 1 

     µ B

    (6) = V [ µ  A

    (-1), µ  A

    (1) ] = 1 

     µ B (10) = V [ µ  A (-2), µ  A (2) ] = 0 

    Then B = {1/2 + 1/6 + 0/10} or B = [2, 6 ]

    38

    Fuzzy Sets 

    Extension Principle 

    The same operations of the classical sets are still valid for

    the fuzzy sets.

    Given a function ƒ : U V and a fuzzy set A in U, where

     A = µ 1 /x 1 + µ 2 /x 2 + µ 3 /x 3 + ……., the extension principle

    states: ƒ(A) = ƒ(µ 1 /x 1 + µ 2 /x 2 + µ 3 /x 3 + …….) = µ 1 /ƒ (x 1  )+

     µ 2 /ƒ(x 2  ) + µ 3 /ƒ(x 3  )+ …….

    Or the resulting set B = µ  A (x 1  )/y 1 + µ  A (x 2  )/y 2 + ……

    If more than one element of U is mapped to the same

    element y of V, then the max membership is taken 

  • 8/20/2019 AI FuzzySets

    20/21

    39

    Fuzzy Sets 

    Extension Principle: Example 

    Consider X = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; a fuzzy set A =

     “large” is given as = {0.5/6 + 0.7/7 + 0.8/8 + .9/9 +1/10}

    Given a function ƒ : y=f(x) = x 2  , find the fuzzy set B =

    “large” 2 

    B = {0.5/36 + 0.7/49 + 0.8/64 + .9/81 + 1/100}

    One to one mapping always reserve the membership values 

    40

    Fuzzy Sets 

    Extension Principle: Example 

    Consider A = {0.1/-2 + 0.4/-1 + 0.8/0 + 0.9/1 +0.3/2}

     ƒ (x) = x2 – 3, using extension principle to find B = ƒ (x)

    B = {0.1/(4-3)+0.4/(1-3)+0.8/(0-3)+0.9/(1-3)+0.3/(4-3)}

    B = {0.1/1 + 0.4/-2 + 0.8/-3 + 0.9/-2 + 0.3/1}

    B = {(0.1 V 0.3)/1 + (0.4 V 0.9)/-2 + 0.8/-3}

    B = {0.3/1 + 0.9/-2 + 0.8/-3}

  • 8/20/2019 AI FuzzySets

    21/21

    41

    Fuzzy Sets 

    Extension Principle: Example 

    0.1

    -3 -2 -1 0 1 2 3

    0.4

    0.9

    0.3

    0.8

    0.9

    -3 -2 -1 0 1 2 3

    0.3

    0.8

     ƒ (x) = x2 – 3