Lesson 1 (Fuzzy Sets)

download Lesson 1 (Fuzzy Sets)

of 46

Transcript of Lesson 1 (Fuzzy Sets)

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    1/46

    Models for Inexact Reasoning

    Fuzzy Logic Lesson 1

    Crisp and Fuzzy Sets

    Master in Computational Logic

    Department of Artificial Intelligence

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    2/46

    Origins and Evolution of Fuzzy Logic

    Origin: Fuzzy Sets Theory (Zadeh, 1965)

    Aim: Represent vagueness and impre-cission

    of statements in natural language

    Fuzzy sets: Generalization of classical (crisp)

    sets

    In the 70s: From FST to Fuzzy Logic

    Nowadays: Applications to control systems Industrial applications

    Domotic applications, etc.

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    3/46

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    4/46

    Real-World Applications

    ABS Brakes

    Expert Systems

    Control Units

    Bullet train between Tokyo and Osaka

    Video Cameras

    Automatic Transmissions

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    5/46

    Crisp (Classic) Sets

    Classic subsets are defined by crisp predicates

    Crisp predicates classify all individuals into two

    groups or categories

    Group 1: Individuals that make true the predicate Group 2: Individuals that make false the predicate

    Example:

    Predicate: n is odd{ }| 1 2 ,E

    E n E n k k Z =

    = = +

    Z

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    6/46

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    7/46

    Fuzzy Sets

    Human reasoning often uses vague predicates

    Individuals cannot be classified into two groups!(either true or false)

    Example: The set of tall men But what is tall?

    Height is all relative

    As a descriptive term, tall is very subjective andrelies on the context in which it is used

    Even a 5ft7 man can be considered "tall" when he issurrounded by people shorter than he is

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    8/46

    Fuzzy Membership Functions

    It is impossible to give a classic definition for

    the subset of tall men

    However, we could establish to which degree

    a man can be considered tall

    This can be done using membership functions:

    : [0,1]A E

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    9/46

    Fuzzy Membership Functions

    A(x) = y

    Individual x belongs to some extent (y) to subset

    A

    y is the degree to which the individual x is tall

    A(x) = 0

    Individual x does not belong to subset A

    A(x) = 1

    Individual x definitelly belongs to subset A

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    10/46

    Types of Membership Functions

    Gaussian

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    11/46

    Types of Membership Functions

    Triangular

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    12/46

    Types of Membership Functions

    Trapezoidal

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    13/46

    Example

    E = {0, , 100} (Age)

    Fuzzy sets: Young, Mature, Old

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    14/46

    Membership Functions

    Membership functions represent distributions ofpossibility rather than probability

    For instance, the fuzzy set Young expresses the

    possibility that a given individual be young Membership functions often overlap with each

    others

    A given individual may belong to different fuzzy sets(with different degrees)

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    15/46

    Membership Functions

    For practical reasons, in many cases theuniverse of discourse (E) is assumed to be

    discrete

    { 1 2, , , n E x x x= K

    The pair ( A(x), x), denoted by A(x)/x is called

    fuzzy singleton

    Fuzzy sets can be described in terms of fuzzy

    singletons

    { }1

    ( ( ) / ) ( ) / n

    A A i i

    i

    A x x x x =

    = =U

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    16/46

    Basic Definitions over Fuzzy Sets

    Empty set: A fuzzy subset A E is empty(denoted A = ) iff

    ( ) 0,A x x E=

    Equality: two fuzzy subsets A and B definedover E are equivalent iff

    ( ) ( ),A B x x x E =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    17/46

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    18/46

    Operations over Fuzzy Sets

    The basic operations over crisp sets can be

    extended to suit fuzzy sets

    Standard operations:

    Intersection:

    Union:

    Complement:

    ( ) min( ( ), ( )) A B A B x x x =

    ( ) max( ( ), ( )) A B A B

    x x x =

    ( ) 1 ( )AA

    x x =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    19/46

    Operations over Fuzzy Sets

    Intersection

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    20/46

    Operations over Fuzzy Sets

    Union

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    21/46

    Operations over Fuzzy Sets

    Complement

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    22/46

    Operations over Fuzzy Sets

    Conversely to classic set theory, min (), max(), and 1-id () are not the only possibilitiesto define logical connectives

    Different functions can be used to represent

    logical connectives in different situations

    Not only membership functions depend on

    the context, but also logical connectives!!

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    23/46

    Fuzzy Complement (c-norms)

    Given a fuzzy set A E, its complement can bedefined as follows:

    ( )( ) ,AA C x x E =

    The function C( ) must satisfy the following

    conditions:

    (0) 1, (1) 0, [0,1], ( ) ( )

    C Ca b a b C a C b

    = =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    24/46

    Fuzzy Complement (c-norms)

    In some cases, two more properties aredesirable

    C(x) is continuous

    C(x) is involutive:

    ( ( )) ,C C a a a E =

    Examples:

    1

    ( ) 1 .

    1( ) (0, )

    1

    ( ) (1 ) (0, )w w

    C x x Std negation

    xC x Sugeno

    x

    C x x w Yager

    =

    =

    =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    25/46

    Fuzzy Intersection (t-norms)

    Given two fuzzy sets A, B E, theirintersection can be defined as follows:

    [ ]( ) ( ), ( ) , A B A BT x y x y E =

    Required properties:

    ( , ) ( , ) ,

    ( ( , ), ) ( , ( , )) , ,

    ( ), ( ) ( , ) ( , ) , , ,

    ( , 0) 0

    ( ,1)

    T x y T y x x y E commutativity

    T T x y z T x T y z x y z E associativity

    x y w z T x w T y z x y w z E monotony

    T x x E absorption

    T x x x E neutrality

    =

    =

    =

    =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    26/46

    Fuzzy Intersection (t-norms)

    Examples:

    ( , ) min( , ) min

    ( , ) max(0, 1)

    ( , )

    min( , ) max( , ) 1( , ) mod

    0

    T x y x y

    T x y x y Lukasiewicz

    T x y x y product

    x y x yT x y product

    otherwise

    =

    = + =

    ==

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    27/46

    Fuzzy Union (t-conorms)

    Given two fuzzy sets A, B E, their union canbe defined as follows:

    [ ]( ) ( ), ( ) , A B A BS x y x y E =

    Required properties:

    ( , ) ( , ) ,

    ( ( , ), ) ( , ( , )) , ,

    ( ), ( ) ( , ) ( , ) , , ,

    ( ,1) 1

    ( , 0 )

    S x y S y x x y E commutativity

    S S x y z S x S y z x y z E associativity

    x y w z S x w S y z x y w z E monotony

    S x x E absorption

    S x x x E neutrality

    =

    =

    =

    =

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    28/46

    Fuzzy Union (t-conorms)

    Examples:

    ( , ) max( , ) max

    ( , ) min(1, )( , )

    max( , ) min( , ) 0( , ) mod

    1

    S x y x y

    S x y x y LukasiewiczS x y x y x Y sum

    x y x yS x y sum

    otherwise

    =

    = += +

    ==

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    29/46

    Properties of Fuzzy Operations

    The t-norms and t-conorms are bounded

    operators:

    ( , ) min( , ) , [0,1]

    ( , ) max( , ) , [0,1]

    T x y x y x y

    S x y x y x y

    The minimum is the biggest t-norm

    The maximum is the smallest t-conorm

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    30/46

    Properties of Fuzzy Operations

    Duality (Generalized De Morgan Laws):

    ( ( , )) ( ( ), ( ))

    ( ( , )) ( ( ), ( ))

    C T x y S C x C y

    C S x y T C x C y

    =

    =

    Only some tuples (T, S, C) meet this property

    In such cases the t-norm and the t-conorm are

    said to be dual w.r.t. the fuzzy complement

    Examples:

    (max, min, 1-id)

    (prod, sum, 1-id)

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    31/46

    Properties of Fuzzy Operations

    Distributive Properties:

    ( , ( , )) ( ( , ), ( , ))

    ( , ( , )) ( ( , ), ( , ))

    T x S y z S T x y T x z

    S x T y z T S x y S x z

    =

    =

    The only tuple satisfying this property is (max,

    min, 1-id)

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    32/46

    Properties of Fuzzy Operations

    In general, given t-norm T, and involutive

    complement C, we can define operator:

    ( , ) ( ( ( ), ( )))S a b C T C a C b=

    It can be proved that S is a t-conorm s.t. tuple(T, S, C) is dual w.r.t. c-norm C

    Similarly, given S and an involutive C, we can

    define a dual T for S w.r.t. C as:

    ( , ) ( ( ( ), ( )))T a b C S C a C b=

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    33/46

    Properties of Fuzzy Operations

    Some dual tuples (T, S, C) satisfy the followingproperties (excluded-middle and non-contradiction):

    ( , ( ))

    ( , ( ))

    S x C x E

    T x C x

    =

    =

    It can be proved that distributive laws do nothold in such cases

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    34/46

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    35/46

    Choice of T, S, and C

    The selection of T, S, and C always depend on

    the concrete case or application

    We need to determine which properties are

    required for our application

    The most common choice:

    T = min, S = max, C = 1-id

    Properties:

    Comm., assoc., neutrality, absorption, involution, inv. 0-1, inv. 1-0, duality, idempotence, distributive

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    36/46

    Example

    Let us suppose that we are thirsty and we arethinking about going to a bar to have a drink

    However, we are reluctant to go to whatever

    bar We want to go to a bar satisfying the following

    requirements:

    We want the bar to be traditional

    We want to go to a bar close to our home

    We want the drinks to be cheap

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    37/46

    Example

    To decide to which bar to go, we will make the

    following assumptions:

    We consider that a bar is traditional if it started

    working 5 years or more ago

    A bar is close to our home if it is not farther than

    ten blocks

    A drink is cheap if it costs 1 Euro or less

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    38/46

    Example

    We know four different bars to which we can

    go:

    Price Years Blocks

    Bar 1 1.40 3 3

    Bar 2 0.80 7 12

    Bar 3 1.00 4 9

    Bar 4 1.25 5 10

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    39/46

    Example

    Using the classical set theory to solve this

    problem, we have that the chosen bar must

    satisfy the following logical formula:

    ( ) ( ) ( )5 10 1 years blocks price

    This yields the following solution:

    Price Years Blocks

    Classical

    SolutionBar 1 0 0 1 0

    Bar 2 1 1 0 0

    Bar 3 1 0 1 0

    Bar 4 0 1 1 0

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    40/46

    Example

    Using the classic set theory we are bounded to

    stay at homeL

    None of the bars satisfy our requirements!

    This is not consistent with the fact we arethirsty

    We need a more flexible approach

    Let us now try the fuzzy set based approach

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    41/46

    Example

    We distinguish three fuzzy sets described by

    the following predicates:

    The bar is traditional

    The bar is close to home The drink is cheap

    Thus, first of all we need to model the

    abovementioned fuzzy sets

    i.e. we need to provide the fuzzy membershipfunctions associated to such fuzzy sets

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    42/46

    Example

    MF for the predicate the bar is traditional

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    43/46

    Example

    MF for the predicate the bar is close to

    home

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    44/46

    Example

    Membership function for the predicate the

    drink is cheap

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    45/46

    Example

    Now, the second step involves the selection ofthe fuzzy operators needed for this application

    In this case, we will use the following

    operators:

    T = min, S = max, C = 1-id

    In other cases we will have to carefully choose

    the fuzzy operators depending on the required

    properties for the concrete application

  • 8/3/2019 Lesson 1 (Fuzzy Sets)

    46/46

    Example

    Results obtained using fuzzy sets theory:

    Price Years Blocks Solution

    Bar 1 0,2 0,5 1 0,2

    Bar 2 1 1 0,6667 0,6667

    Bar 3 1 0,875 1 0,875

    Bar 4 0,5 1 1 0,5