You are on page 1of 96

CLASSICAL AND FUZZY SETS

Dr S.Natarajan
Professor,
Department of Information Science and Engineering
PESIT, Bangalore

Classical Sets and Fuzzy Sets


Classical Sets Operations on Classical Sets, Properties of
Classical (Crisp) Sets, Mapping of Classical Sets to Functions,
Fuzzy Sets Fuzzy Set operations, Properties of Fuzzy Sets,

boolean logic

fuzzy logic

Crisp set vs. Fuzzy set

A traditional crisp set

A fuzzy set
4

DEFINITIONS- CLASSICAL SETS

Sets
Classical sets either an element belongs to the set or
it does not. For example, for the set of integers, either
an integer is even or it is not (it is odd). However,
either you are in the USA or you are not. What about
flying into USA, what happens as you are crossing?
Another example is for black and white photographs,
one cannot say either a pixel is white or it is black.
However, when you digitize a b/w figure, you turn all
the b/w and gray scales into 256 discrete tones.

Crisp set vs. Fuzzy set

A classical (crisp) set A in the universe of discourse


U can be defined in three ways:
- by enumerating (listing) elements (often called list
or extensional definition)
- by specifying the common properties of elements
(intensional or rule definition)
the notation A = {x | P(x)} means that set A is
composed of elements x such that every x has the
property P(x)
- by introducing a zero-one membership function
(characteristic or indicator definition)

U (set of integer numbers), A {x U | x is divisible by 3}


, if x U, and x is divisible by 3
1
0, if x U, and x is not divisible by 3

A (x ) m A (x)

CLASSICAL SETS (1)

Classical sets are also called crisp (sets).


Lists: A = {apples, oranges, cherries,
mangoes}
A = {a1,a2,a3 }
A = {2, 4, 6, 8, }
Formulas: A = {x | x is an even natural
number}
A = {x
| x = 2n, n is a natural

1 if x A
number} A( x)
0 if x A
Membership or characteristic function
8

Characteristic function
Let A be any subset of X, the characteristic
function of A, denoted by , is defined by

Characteristic function of the set of real numbers


from 5 to 10

CLASSICAL SETS (2):


X collection of objects all having the same characteristics -UNIVERSE OF DISCOURSE --- individual elements in the
Universe X will be denoted as x
Examples:
The clock speeds of computer CPUs Hertz
The operating currents of an electronic motor
The operating temperature of a heat pump ( in degrees Celsius)
The Richter magnitude of an earthquake
The integers 1 to 10
First 4 items are examples of real world engineering elements
For the purpose of modeling , these engineering problems are
simplified and only integer values of the elements are considered
Magnitudes of Richter Scale greater than 9 ???
Set of destructive magnitudes composed of (i) magnitudes >= 6
crisp case or (ii) all magnitudes appx. 6 and higher fuzzy case
10

CLASSICAL SETS (3)

Useful metric cardinality or the cardinal number total number of


elements in a universe X is called its cardinal number denoted by n x,
x is the index
Discrete universes that are composed of a countably finite collection
of elements will have a finite cardinal number ; continuous universes
comprising of an infinite collection of elements will have an infinite
cardinality
Sets collections of elements within an universe
Subsets collection of elements within the sets

11

Basic concepts
Set: a collection of items
To Represent sets
The set C is composed of elements x

List method A={a, b, c}


Every x has property P
Rule method C = { x | P(x) }
Family of sets {Ai | i I } i: index I: index set
Universal set X and empty set

12

Set Inclusion
A is a subset of B
A B : x A implies that x B
A and B are equal set
A = B : A B and B A
A B : A B and A B
A is a proper subset of B

13

Power set
All the possible subsets of a given set X is call the
power set of X, denoted by P(X) = {A| A X}
|P(X) | = 2n when |X| = n
X={a, b, c}
P(X) = {, a, b, c, {a, b}, {b, c}, {a, c}, X}

14

Operations on Classical Sets


Union:

A B = {x | x A or x B}

Intersection:
A B = {x | x A and x B}
Complement:
A = {x | x A, x X}
X Universal Set
Set Difference:
A | B = {x | x A and x B}
Set difference is also denoted by A - B

Set Operations

Complement
Union
Intersection
difference

16

UNION OF TWO SETS

INTERSECTION OF TWO SETS

18

19

COMPLEMENT OF A SET

20

21

22

Properties of Classical Sets


AB=B A
AB=B A
A (B C) = (A B) C
A (B C) = (A B) C
A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
AA=A
AA=A
AX=X
AX=A
A =A
A =

Properties of Classical Sets


If A B C, then A C
De Morgans Law:
(A B) = A B
(A B) = A B
Proof:
LHS= {x | x (A and B)}= {x | x A or x
B)}=
A B= RHS

Real numbers

Total ordering: a b
Real axis: the set of real number (x-axis)
Interval: [a,b], (a,b), (a,b]
One-dimensional Euclidean space

25

De Morgans laws

26

Distributive laws

27

Associative laws

28

Can be extended to n sets


Generalized De Morgan Law:
A A
X
X


Using ( ) to keep original processing order

Generalized Duality Law:


X
X


Using ( ) to keep original processing order

Law of the excluded middle:


A A = X
Law of the Contradiction:
A A =
These laws are not true for
Fuzzy Sets!

33

Mapping of Classical Sets to Functions

Relates set-theoretic forms to function theoretic representation of


information
More generally, it can be used to map elements or subsets on one
universe of discourse to elements or sets in another universe
Suppose X and U are two universes of discourse (information)
If an element x is contained in X and corresponds to an element y
contained in Y, it is generally termed as mapping from X to Y, of f; X -> Y

As a mapping, the characteristic (indicator) function

1 if x A
( x)

A
0 if x A

expresses membership in set A for the element x in the universe


This membership idea is a mapping from an element x in the universe X to
one of the two elements in universe Y; i.e., to the elements 0 or 1
For any set A defined on the universe X, there exists a function-theoretic set,
called a Value Set, denoted by V(A), under the mapping of the characteristic
function, x. By convention the null set is assigned the membership
value 0 and the whole set X is assigned the membership value 1

34

35

36

Fuzzy Theory

Fuzzy
Mathematics

Fuzzy
Decision-Making
Fuzzy Systems

Uncertainty &
Information
Fuzzy Logic
& AI
37

fuzzy sets the truth of a statement


becomes a matter of degree

38

fuzzy membership functions

39

fuzzy membership functions


(another example)

40

Definitions fuzzy sets


Fuzzy sets
admits gradation such as all tones between
black and white. A fuzzy set has a graphical
description that expresses how the transition from
one to another takes place. This graphical
description is called a membership function.
Definition : Let X be some set of objects, with
elements noted as x.
Thus, X = {x}. For example, if X were to equal
the set of all common house pets, then
X = {dogs, cats, fish, birds}, where x1 = dogs,
x2 = cats, x3 = fish, and x4 = birds.

41

Fuzzy Sets
Characteristic function X, indicating the belongingness
of x to the set A
X(x) = 1
xA
0
xA
or called membership
Hence,
A B XA B(x)
= XA(x) XB(x)
= max(XA(x),XB(x))
Note: Some books use + for , but still it is not ordinary
addition!
Some more explanations follow

Fuzzy Sets
A B XA B(x)
= XA(x) XB(x)
= min(XA(x),XB(x))
A XA(x)
= 1 XA(x)
A B XA(x) XB(x)
A = A

Fuzzy Sets
Note (x) [0,1]
not {0,1} like Crisp set
A = {A(x1) / x1 + A(x2) / x2 + }
= { A(xi) / xi}
Note: + add
/ divide
Only for representing
membership.

element

and

Also some books use (x) for Crisp Sets too.

its

Fuzzy Set Operations


A B(x) = A(x) B(x)
= max(A(x), B(x))
A B(x) = A(x) B(x)
= min(A(x), B(x))
A(x) = 1 - A(x)
De Morgans Law also holds:
(A B) = A B
(A B) = A B
But, in general
A A

A Fuzzy Set is a set with a smooth boundaries


Fuzzy Set Theory generalizes classical set theory
to allow partial membership
Fuzzy Set A is a universal set X is determined by a
membership function A(x) that assigns to each
element xX a number A(x) in the unit interval
[0,1]
Universal set X (Universe of Discourse) contains all
possible elements of concern for a particular
application
Fuzzy set has a one-to-one correspondence
with its membership function
46

Fuzzy set A is defined as


A = { (x, A(x)) }, x X, A(x)[0,1]
A(x) = Degree(xA) is a grade of membership of
element x X in set A
X1
X2
X3
.
.
.

1/2

1
unit interval

xN
.
.

U (universe of discourse)

47

Membership functions can be represented (a) graphically,


(b) in a tabular or list form, (c ) analytically and (d)
geometrically (as a points in the unit cube)
Geometrical representation for two-element universal set
U = ({x1,x2}) has a following vizualization:
membership values
1.0

(0,1)

(1,1)

2
1
0.0

U
x1

x2

graphical (standard)
representation form

(0,0)
1

(1,0)

set of maximum fuzziness

48

[see the previous figure] Vertices (0,0), (0,1),


(1,0) and (1,1) represent all crisp sets that can be
defined for the universal set U, e.g. the point (1,0)
corresponds to the crisp set {x1} (element x2 has
no membership)
Membership functions can be symmetrical or
asymmetrical, and the most commonly used forms
are triangular,
triangular trapezoidal,
trapezoidal Gaussian and bell (the
first two dominate in applications due to simplicity
and computational efficiency)
Membership functions are typically defined on
one-dimensional universes, and in most cases, the
membership function appears in the continuos
form
49

Properties of Fuzzy Sets


AB=B A
AB=B A
A (B C) = (A B) C
A (B C) = (A B) C
A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
AA=A
AX=X
A =A
If A B C, then A C
A = A

A A=A
A X = A
A =

The height of a fuzzy set A is the highest (maximum) value


of its membership function, i.e. height(A) = max A (xi )
xi

If a fuzzy set has a height 1, then it is called a normal fuzzy


set;
set in contrast, if height(A) < 1, the fuzzy set is said to be
subnormal
A subnormal set is a fuzzy set that contains only elements
with partial (<1) membership
In most of applications fuzzy sets are normal, and during the
reasoning process usually subnormal fuzzy sets are
generated
A set of all elements of the universal set U whose degree of
membership in a fuzzy set A is nonzero is called the support
{x U | A (x ) 0}
of a fuzzy set A,
A i.e. supp(A) =

51

A set of all elements x of the universal set U with a property


A(x) = 1 (A is a fuzzy set) is called the core of a fuzzy set A
(core(A))

height(A) = 1

(normal fuzzy set)

Membership
function has a
trapezoidal form
0
a

U = [a,b]

core(A)
supp(A)

52

A Fuzzy Set is a set with a smooth boundaries


Fuzzy Set Theory generalizes classical set theory
to allow partial membership
Fuzzy Set A is a universal set U is determined by a
membership function A(x) that assigns to each
element xU a number A(x) in the unit interval
[0,1]
Universal set U (Universe of Discourse) contains all
possible elements of concern for a particular
application
Fuzzy set has a one-to-one correspondence
with its membership function
53

Information World
Crisp set has a unique membership function
A(x) = 1
0

xA
xA

A(x) {0, 1}
Fuzzy Set can have an infinite number of membership
functions
A [0,1]

54

Fuzziness
Examples:
A number is close to 5

55

Fuzziness

Examples:
He/she is tall

56

Example: Young

Example:
Ann is 28,
Bob is 35,
Charlie is 23,

0.8 in set Young


0.1 in set Young
1.0 in set Young

Unlike statistics and probabilities, the degree is not describing


probabilities that the item is in the set, but instead describes to what
extent the item is the set.

57

Fuzzy Subset
U = {1, 2, 3, 4,.,10}
A = {1, 2, 3, 4, 5}
B = {2, 3, 4}
B A in CRISP SET THEORY
A(x) >= B(x), x
In terms of membership predicate
Crisp subsethood
S1(x) <= S2(x), x

58

Geometric Interpretation(1)

U = {x1 , x2}
(0,1)

(1,1)

x2

A
B1
B2

(0,0)

B3
(1,0)

x1

Bis are such that


Bi(x) <= A(x), x
59

Geometric Interpretation (2)


The points within the hypercube for which A is the upper
right corner are the subsets of A.
Space defined by the square is the power set of A.
Formulation of ZADEH, classical fuzzy set theory
For B to be a subset of A, B(x) <= A(x), x.
This means B P(A) crisply.

A
B

60

Geometric Interpretation (3)


Each Bi is a subset of A to some degree.
B3

A
B2

B1

Result of Union, Intersection, Complement is a SET

61

Membership function of fuzzy logic

Fuzzy values
DOM
Degree of
Membership

Young

Middle

Old

0.5
0

25

40

55

Age

Fuzzy values have associated degrees of membership in the set.


62

Membership Functions of the example on age


A1 (x)

1
when x <= 25
= (40-x)/15
when 25< x < 40
0
when x >=40

A2 (x)

0
when either x <= 25 or >= 55
= (x-25)/15
when 25 < x < 40
(55-x)/15
when 40<x< 55

A3 (x)

0
when x <= 40
= (x-40)/15
when 40< x < 55
1
when x >= 55

63

Membership Functions using Fuzzy Sets Zadehs Notation


YA = 1.0/0 + 1.0/25 + 0.5/32.5 + 0.0/40
MA = 0.0/25 + 0.5/32.5 + 1.0/40 + 0.5/47.5 + 0.0/55
OA = 0.0/40 + 0.5/ 47.5 + 1.0/55

64

Linguistic Values

Membership

Height
1

short

medium

160

170

tall

180

(cm)

Membership

Weight
1

light

medium

50

70

heavy

90

(kg)

Definitions: Fuzzy Sets (figure from Klir&Yuan)

66

Membership functions (figure from Klir&Yuan)

67

Fuzzy set (figure from Earl Cox)

68

Fuzzy Set (figure from Earl Cox)

69

Fuzzy Set Operations


Union

AB A ( x) B ( x)
~

Intersection :

AB A ( x) B ( x)

Complement

A ( x) 1 A ( x)
~

70

Operations of Fuzzy Sets


Not A

B
A

AA

Complement

Containment

Intersection

AA

Union
71

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)
72

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.
73

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:
AB(x) = min [A(x), B(x)] = A(x) B(x),
where xX
74

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:
AB(x) = max [A(x), B(x)] = A(x) B(x),
where xX
75

Operations of Fuzzy Sets

(x)

(x)

B
A

A
0
1

0
1

Not A

0
Complement

0
Containment

(x)

(x )

0
1

B
A

x
AB

0
Intersection

1
x

AB
Union

x
76

77

De Morgans Laws

A B A B
~

A B A B
~

78

Properties of Fuzzy Set

A B B A

Commutativity

A B B A
~

Associativity

A B C A B C
~

A BC A B C
~

79

Distributivity

A B C A B AC

A BC A B AC
~

A
~

A X X

A A
~

A A A

A A A

Idempotency

Identity

A X A
~

80

Transitivity

Involution

A B C then A C

If

A
~

A
~

81

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), xX
A = 0.3/1 + 0.5/2 + 1/3
B = 0.3/1 + 0.5/2 + 1/3
therefore A = B

82

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), xX
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
83

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
84

Artificial Intelligence CS364


Fuzzy Logic

Empty Fuzzy Set

A fuzzy set A is empty, IF AND ONLY IF:


A(x) = 0, xX
Consider X = {1, 2, 3} and set A
A = 0/1 + 0/2 + 0/3
then A is empty

85

Example: An universe has three elements, X= {a,b,c} . We desire to


map the elements of the power set of X, i.e., P(X), to a universe, Y,
consisting of only two elements ( the characteristic function) Y= {0,1}
The elements of the power set are enumerated as follows:
P(X) = {, {a}, {b}, {c}, {a,b}, {b,c}, (a,c}, (a,b,c} }
Thus, the elements in the value set V(A) as determined from the
mappings are
V{P(X)} = { {0,0,0}, {1,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {0,1,1}, {1,0,1},
{1,1,1}}
For example, the third subset in the power set P(X) is the element b.
For this subset there is no a, so a value of 0 goes in the first
position of the data triplet; there is a b, so a value of 1 goes in the
second position of the data triplet; and there is no c, so a value of 0
goes in the third position of the data triplet. Hence, the third subset
of the value set is the data triplet {0,1,0}, as already seen.
86

Example
1 .5 .3 .2
A
~
2 3 4 5

.5 .7 .2 .4
B
~
2 3 4 5

1 0 .5 .7 .8
1 .5 .3 .8 .6
A B
~
1 2 3 4 5 ~ 1 2 3 4 5
1 .7 .3 .4
A B
~
~
2 3 4 5
.5 .5 .2 .2
A B

~
~
2 3 4 5
87

.5 .3 .3 .2
A | B A B

~
~
~
~
2 3 4 5
0 .5 .2 .4
B | A B A
~
~
~
~
2 3 4 5
1 0 .3 .7 .6
A B A B
~
~
~
~
1 2 3 4 5

1 .5 .5 .8 .8
A B A B
~
~
~
~
1 2 3 4 5

88

1 1 .5 .7 .8
AA
~
~
4 5
1 2 3
.5 .3 .2 .4
B B


~
~
3
4
5
2

89

Example fuzzy set operations


A

A
AB

AB
A

90

Operations on Fuzzy Sets

Slightly differs from regular set operations


Fuzzy interval between 5 & 8

Fuzzy number about 4

91

AND, OR, NEGATION

Can also be called intersect, unify, and negate

AND

OR

NEGATION

92

Young employees salary

Question: what is a young employees salary?


A=1/20+1/25+0.8/30+0.6/35+0.4/40+0.2/45+0/50+0/55+0/60+0/
Young employee A=A(x)/x
65
B=1/2.5+1/2.5+0.8/3.0+0.6/3.5+0.4/3.5+0.2/4.0+0/4.0+0/4.5+0/
4.5+0/5.0
B=1/2.5+0.8/3.0+0.6/3.5+0.2/4.0+0/4.5+0/5.0
Young employees salary B=A(x)/f(x)

age

20

25

salar 2.5 2.5


y

30

35 40 45 50 55 60 65

3.0 3.
5

3.
5

4.
0

4.
0

4.
5

4.
5

5.0

93

Young employees salary


Young employee A=A(x)/x

Question: what is a young employees


salary?
A=1/20+1/25+0.8/30+0.6/35+0.4/40+0.2/45+0/50+0/55+0/60+0/
65
B=?
age

20

25

30

35

40

45

50

55

60

65

salary 2.5

2.5

3.0

3.0

4.0

4.0

4.5

4.5

5.0

5.5

94

Extension principle

95

Measurement of fuzziness

Any set that is not crisp involves some degree of fuzziness.


f(A) = the measure of fuzziness of a fuzzy set A
f(A) = 0 for crisp set, f(A) 0 for fuzzy set
The lack of distinct between the set and its complement (1-|2A(x)-1|)
f(A) = xX(1-|2A(x)-1|)
|A(x)-[1-A(x)]| = |2A(x)-1|

example
A=1/20+1/25+0.8/30+0.6/35+0.4/40+0.2/45+0/50+0/55+0/60+0/65
f(A) =10-1-1-0.6-0.2-0.2-0.6-1-1-1-1=2.4

96

You might also like