Fuzzy Logic

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 84

Fuzzy Logic

1
Some Concepts
Fuzzy Logic concept was first conceived by Lotfi Zadeh.

Lotfi Zadeh is a Professor at University of California, Berkley.

Fuzzy logic is not logic that is fuzzy.

Fuzzy Logic is used to describe fuzziness.

Fuzzy logic is the theory of fuzzy sets.

Fuzzy set is used to calibrate vagueness.

Fuzzy logic facilitates to interpret approach of human methodology.

Fuzzy logic is superset of conventional (Boolean) logic that has been extended to handle
the concept of partial truth

In fact, it deals with real world vagueness.

2
Fuzzy logic is based on the idea that all things admit of degrees
(Temperature, height, speed, distance, beauty-all come on a sliding scale).
The motor is running slightly hot.
Ram is a very tall boy.

Fuzzy logic is aimed at a formalization of modes of reasoning
which are approximate rather than exact.

Examples:
Exact: All men are hardworking and Ram is a man implies Ram is
hardworking.

Approximate: Most Indians are tall and Ram is an Indian implies it
is likely that Ram is tall.

3
Fuzzy Set Theory
Fuzzy set theory is an extension of classical (Crisp)set
theory where elements have degrees of membership.

Classical(Crisp) set theory: allows the membership of the
elements in the set in binary terms-an element either
belong or does not belong to the set.

Fuzzy set theory: allows the gradual assessment of the
membership, described with the aid of membership
function in the interval [0,1]
4
Example

Classical example in fuzzy sets is tall men. Elements of the fuzzy set
tall men are all men, but their degrees of membership depend on their height.












X-axis represents universe of discourse range of all possible values applicable
to a chosen variable. In our case, variable is man height. According to this
representation, universe of mens heights consists of all tall men.

Y-axis represents membership value of the fuzzy set. In our case, fuzzy set of
tall men maps height values into corresponding membership values.


150 210 170 180 190 200 160
Height, cm
Degree of
Membership
l
M
T
al
Th
e
cla
ssi
cal
ex
am
ple
in
fu
zz
y
set
s
is
tal
l
me
n.
Th
e
ele
me
nts
150 210 180 190 200
1.0
0.0
0.2
0.4
0.6
0.8
160
Degree of
Membership
170
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
Fuzzy Sets
Crisp Sets

Degree of Membership
Fuzzy
B
C
D
G
I
1
1
1
0
0
1.00
1.00
0.98
0.82
0.78
J
H
F
E
A
Crisp
1
0
0
0
0
0.24
0.15
0.06
0.01
0.00
Name Height, cm
205
198
181
167
155
152
158
172
179
208
5
Classical (Crisp) Set Theory
Set: A set is well defined collection of objects.
(well defined means object either belongs to or does not belong
to set)

Let set A={a
1
,a
2
,a
3
,a
4
,..a
n
}
Here, a
1
,a
2
,a
3
,a
4
,..a
n
are called members of set.

If these elements of a set A are subset of universal set X,
then set A can be represented as for elements x X by its
characteristic function.

e
A
1 if x X
(x)
0 otherwise
e

6
Hence in classical set theory has only value 1 (true)
and 0 (false).

These sets are called crisp sets.
( )
A
x
7
Crisp Sets
Definitions:
1. Cardinality: Number of elements in set is called it
cardinality.
2. Family of sets: Set whose members are sets
themselves, are called as family of sets.
3. Null set/Empty set: Set with no members is
called null set or empty set.
4. Singleton set: Set with single element is called a
singleton set.

8

Operation on Crisp Sets

1. Union : A union of two sets A and B is the
set of all elements that belong to A or B or
both.

2. Intersection : Intersection of two sets
A and B is the set of all elements that belong
to A and B.




( )

{ }
: A B x x A and x B vv = e e
( )
{ }
: A B x x A or x B = e e
9
3. Complement : The complement of a set A is A
c

, is the set of all elements which belong to X but
not to A.


4. Difference (-): The difference of the se A and B is
the set of all elements which are in A but not in B.


( )
c
{ }
: ,
c
A x x A x X = e e
{ }
: A B x x A and x B = e e
10
Properties of Crisp Sets
1. Commutativity:


2. Associativity:


3. Distributivity:
A B B A
A B 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
=
=
11
4. Idempotence:

5. Identity:


6. Law of Absorption:

7. Transitivity:

8. Involution:
9. Law of the Excluded Middle:

A A A
A A A
=
=
A A
A X X
A
A X A
C =
=
C = C
=
( )
( )
A A B A
A A B A
=
=
, If A B B C then A C _ _ _
( )
C C
A A =
C
A A X =
12

10. Law of Contradiction:

11. De Morgan s Laws:
C
A A = C
( )
( )
C C C
C C C
A B A B
A B A B
=
=
13
Fuzzy Sets
Fuzzy set theory is an extension of classical set
theory where the elements have different degree
of membership function in the interval [0,1].

Membership function is represented by

If X is the universe of discourse and x is a
particular element of X, then a fuzzy se A defined
in X may be written as


( )
A
x
{ } A=
{ }
( , ( )).
A
A x x x X = e
14
Example:
Let be the reference set of

students. Let be the fuzzy set of intelligent
students. Where intelligent is a fuzzy linguistic term.


Fuzzy set indicates that intelligence of b
1
is 0.2,
b
2
is 0.7, b
3
is 0.6 and of b
4
is 1 over a scale 0-1.


{ }
1 2 3 4
, , , X b b b b =
A
{ }
1 2 3 4
( , 0.2)( , 0.7)( , 0.6)( ,1) A b b b b =
A
15
Basic Fuzzy Set Operations
1. Union: The union of two fuzzy sets is a
new fuzzy set with a membership function
defined as




Aand B
A B
( ) max( ( ), ( ))
B A B A
x x x

=
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
( , 0.3), ( ,1), ( , 0.9)
( , 0.8), ( , 0.1), ( , 0.7)
( , 0.8), ( ,1), ( , 0.9)
if A x x x
and B x x x
then A B x x x
=
=
=
16
2. Intersection: The intersection of is a
new fuzzy set with membership
function defined as
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
( , 0.3), ( ,1), ( , 0.9)
( , 0.8), ( , 0.1), ( , 0.7)
( , 0.3), ( , 0.1), ( , 0.7)
if A x x x
and B x x x
then A B x x x
=
=
=
Aand B
A B
( ) min( ( ), ( ))
B A B A
x x x

=
17
3. Complement: The complement of a fuzzy set is
a new fuzzy set with a membership function.






A
A
( ) 1 ( )
A A
x x =
{ }
{ }
1 2 3
1 2 3
( , 0.2), ( , 0.4), ( , 0.1)
( , 0.8), ( , 0.6), ( , 0.9)
C
if A x x x
then A x x x
=
=
18
4. Product of two fuzzy sets: The product of
two fuzzy sets is a new fuzzy set
whose membership function is defined as

. A B
Aand B
.
( ) ( ) ( )
B A B A
x x x =
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
( , 0.3), ( ,1), ( , 0.9)
( , 0.8), ( , 0.1), ( , 0.7)
. ( , 0.24), ( , 0.1), ( , 0.63)
if A x x x
and B x x x
then AB x x x
=
=
=
19
5. Equality: Two fuzzy sets are said to be
equal if
Aand B
( ) A B =
( ) ( )
B A
x x =
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
( , 0.3), ( ,1), ( , 0.9)
( , 0.8), ( , 0.1), ( , 0.7)
( , 0.3), ( ,1), ( , 0.9)
if A x x x
B x x x
C x x x
then A B and A C
=
=
=
= =
20
6. Product of a Fuzzy set with a crisp Number:
Product of a fuzzy set by a crisp number a
results a new fuzzy set with the
membership function defined as

A
. a A
.
( ) . ( )
a A A
x a x =
{ }
{ }
1 2 3
1 2 3
( , 0.3), ( ,1), ( , 0.9)
0.4
. ( , 0.12), ( , 0.4), ( , 0.36)
if A x x x
a
then a A x x x
=
=
=
21
7. Power of a fuzzy Set: power of a fuzzy set
is a new fuzzy set whose membership
function is defined as






Concentration(CON): Raising the second power of a
fuzzy set.
Dilation(DIL): Taking the square root of a fuzzy set.




( ) A
o
A
o
( ) ( ( ))
A
A
x x
o
o
=
{ }
{ }
1 2 3
2
1 2 3
( , 0.2), ( , 0.7), ( , 0.4)
2
( ) ( , 0.04), ( , 0.49), ( , 0.16)
if A x x x
then A x x x
o
=
=
=
22
8. Difference: The difference of two fuzzy sets
is a new fuzzy set . It may be defined as
Aand B
A B
( )
c
A B A B =
{ }
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
1 2 3
( , 0.2), ( , 0.4), ( , 0.8)
( , 0.7), ( , 0.5), ( , 0.1)
( , 0.3), ( , 0.5), ( , 0.9)
( , 0.2), ( , 0.4), ( , 0.8)
c
c
if A x x x
B x x x
B x x x
A B A B x x x
=
=
=
= =
B
23
9. Disjunction Sum: The disjunction sum of two
fuzzy sets is new fuzzy set is

Aand B
A B
( ) ( )
c c
A B A B A B =
{ }
{ }
{ }
{ }
{ }
{ }
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1
( , 0.3), ( , 0.6), ( , 0.9)
( , 0.2), ( , 0.4), ( , 0.8)
( , 0.7), ( , 0.4), ( , 0.1)
( , 0.8), ( , 0.6), ( , 0.2)
( ) ( , 0.2), ( , 0.4), ( , 0.1)
( ) ( , 0.3), ( , 0.6), ( , 0.2)
( ,
c
c
c
c
if A x x x
B x x x
A x x x
B x x x
A B x x x
A B x x x
A B x
=
=
=
=
=
=
=
{ }
2 3
0.3), ( , 0.6), ( , 0.2) x x
24
Properties of Fuzzy Sets
1. Commutativity:


2. Associativity:


3. Distributivity:
A B B A
A B 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
=
=
25
4. Idempotence:

5. Identity:


6. Law of Absorption:

7. Transitivity:

8. Involution:
9. Law of the Excluded Middle:

A A A
A A A
=
=
A A
A X X
A
A X A
C =
=
C = C
=
( )
( )
A A B A
A A B A
=
=
, If A B B C then A C _ _ _
( )
C C
A A =
C
A A X =
26

10. Law of Contradiction:

11. De Morgan s Laws:
C
A A = C
( )
( )
C C C
C C C
A B A B
A B A B
=
=
27
Q1. Three fuzzy sets for hot , cold and warm
water are



Prove the different properties of fuzzy sets for
the above fuzzy sets.

{ }
{ }
( ) (20 , 0.1), (40 , 0.2), (60 , 0.3), (80 , 0.6), (90 , 0.9), (100 ,1)
( ) (20 ,1), (40 , 0.5), (60 , 0.4), (80 , 0.3), (90 , 0.2), (100 , 0.1)
( ) (20 , 0.2), (40 , 0.7), (60 , 0.9), (80 , 0.4), (90 , 0.2), (100 , 0.
Hot A
Cold B
Warm C
=
=
=
{ }
1)
28
Q2. Given the two fuzzy sets .

Aand B
{ }
{ }
( , 0.4), ( , 0.6), ( , 0.2), ( , 0.9)
( ,1), ( , 0.2), ( , 0.8), ( , 0.3)
( )
( )
( )
( )
c c
c c
A
B
Find a A B
b A B
c A B
d A B
o | o
o | o
=
=

29
Q3. Let X be the universe of military aircraft of
interest defined as

{ }
{ }
10 52 117 5 130 4 14 15 16 17 111
16 4 10 14 117 52
52 117
, , , , , , , , , ,
.
( , 0.2), ( , 0.4), ( , 0.5), ( , 0.7), ( , 0.9), ( ,1)
( , 0.1), (
X a b b c c f f f f f f
Let Fuzzy set A be the bomber class air craft and
Fuzzy set B be the fighter class air craft
A f f a f b b
B b b
=
=
=
{ }
4 14 16 10
, 0.2), ( , 0.8), ( , 0.9), ( ,1), ( , 0.5)
( )
( )
( )
( )
( ) ( )
( ) ( )
c
c
c
c
f f f a
Find a A B
b A B
c A
d B
e A B
f A B

30
Q4. The fuzzy sets A and B for the fast and slow
speed are represented as

{ }
{ }
( ) (100,1), (80, 0.8), (60, 0.6), (40, 0.4), (20, 0.2)
( ) (100, 0.2), (80, 0.4), (60, 0.6), (40, 0.8), (20,1)
Pr 1. '
2.
.
3.
A fast
B Slow
ove the De Morgan s Laws
Law of excluded middle does not apply to
fuzzy sets
Law of Contradiction does no
=
=

.
t apply to
fuzzy sets
31
Q5. Given the three fuzzy set A, B and C.

{ }
{ }
1 2 3 4
1 2 3 4
( , 0.4), ( , 0.8), ( , 0.3), ( ,1)
( , 0.9), ( , 0.2), ( , 0.8), ( , 0.1)
Pr ( ) ( ) ( )
( ) ( )
( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) (
A x x x x
B x x x x
ove a A B C A B C
b A A B A
c A A B A
d A B C A B A C
e A B C A B A C
f A
=
=
=
=
=
=
=
) ( ) B C A B C =
32
Crisp Relations
Cartesian Product: of two sets A and B is the set of
ordered pairs, the first element of the pair
belongs to A and the second element belongs to
B. It is represented as AxB.

{ }
{ } { }
{ }
( , / ,
.
:
, 1, 2
( ,1) ( ,1) ( , 2) ( , 2)
A B a b a A b B
A B B A provided if A B and Aand B are non empty
Example
If A a b B
then A B a b a b
= e e
= =
= =
=
33
Other Crisp Relation: If the sets are finite, then n- ary
relation can be expressed in n- dimensional
relation matrix.
{ }
{ }
{ }
{ }
:
1, 2, 3
(1,1)(1, 2)(1, 3)(2,1)(2, 2)(2, 3)(3,1)(3, 2)(3, 3)
( , ) / 1, ,
(1, 2)(2, 3)
Re
1 2 3
1 0 1 0
2 0 0 1
3 0 0 0
Example
Given X
X X
Let therelation Rbedefined as
R x y y x x y X
Therefore R
lation Matrix Ris givenby
R
=
=
= = + e
=
(
(
=
(
(

34
Operations on Relations
:
1. : ( , ) max( ( , ), ( , ))
2. sec : ( , ) min( ( , ), ( , ))
3. : ( , ) 1 ( , )
Let two realtions R and S represented by relation materices
defined on X Y then their operations are
Union R S R S x y R x y S x y
Inter tion R S R x y R x y S x y
Complement R R x y R x y

=
=
=
35
4. Re :
,
,
,
( , ) / ( , )
( , ) ( , )
max min :
Composition of lations R S
if R is the relation defined on X Y
and S is the relation defined on Y Z
thencomposition of relation R S on X Z defined as
x y x y X Z
R S
y Y such that x y R and y z S
composition
e

=
`
- e e e
)

( , ) max(min( ( , ), ( , )))
is defined as
T R S
T x z R x y S y z
=
=
36
{ } { }
{ } { }
{ } { }
:
(2, 2)(2, 4)(2, 6)(4, 2)(4, 4)
2, 4, 6 2, 4, 6
(4, 6)(6, 2)(6, 4)(6, 6)
( , ) / 2 , ( , ) / 4
(2, 4)(4, 6) (2, 6)
2 4 6 2 4 6
2 0 1 0
4 0 0 1
6 0 0 0
Example Let Rand S be defined on the sets
R x y y x S x y y x
R S
Hence the relation matercies are
R

=
`
)
= = + = = +
= =
(
(
=
(


2 0 0 1
4 0 0 0
6 0 0 0
max min .
2 4 6
2 0 0 0
4 0 0 0
6 0 0 0
.
S
By composition
R S
that indicates no composite relation
(
(
=
(
( (

(
(
=
(
(

37
Fuzzy Relations
Fuzzy Relation: is a fuzzy set defined on Cartesian product of
crisp sets (X
1
,X
2
,,Xn) where n-tuples (x1,x2,x3,xn) may have
varying degree of membership with in relation.



{ }
{ }
1 2 3
1 2
1 2
1
2
3
( , ) ( , ) min( ( ), ( ))
( , 0.3), ( ,1), ( , 0.9)
( , 0.8), ( , 0.1)
0.3 0.1
0.8 0.1
0.8 0.1
R B A B A
R A B X Y
the membership function of R is given by
x y x y x x
Example
if A x x x
B y y
y y
x
R A B x
x

= c
= =
=
=
(
(
= =
(
(

38
Operations on Fuzzy Relations
1. : ( , ) max( ( , ), ( , ))
2. sec : ( , ) min( ( , ), ( , ))
3. : ( , ) 1 ( , )
c
R R S S
R R S S
R R
Let R and S be fuzzy relations defined on X Y
Union x y x y x y
Inter tion x y x y x y
Complement x y x y


=
=
=
39
{ } { }
1 2 3 1 2
4. :
,
,
( , ) max(min( ( , ), ( , )))
: , , ,
R R S S
Composition of relations
if R is the fuzzy relation defined on X Y and
S is the fuzzy relation defined on Y Z then R S is
a fuzzy relation on X Z is defined as
x y x y y z
Example X x x x Y y y Z z

=
= = =
{ }
1 2 3
1 2 1 2 3
1
1
2
2
3
1 2 3
1
2
3
, ,
0.5 0.1
0.6 0.4 0.7
0.2 0.9
0.5 0.8 0.9
0.8 0.6
0.5 0.4 0.5
0.5 0.8 0.9
0.6 0.6 0.7
z z
y y z z z
x
y
R x S
y
x
z z z
x
R S x
x
(
(
(
= =
(
(

(

(
(
=
(
(

40
Fuzzy Systems
41

Crisp Logic v/s Fuzzy Logic

Crisp Logic: It is science of reasoning which is build on
two state truth value (True/False).

Example: 1. Water freezes at 50
o
C (False)
2. Sky is blue (True)

Fuzzy Logic: It is science of reasoning which is based on
multistate truth value.

Example: True/False/Partly True/Very False, etc.

42
Crisp Logic
Proposition: It is a statement representing agreement
or disagreement of crisp logic.
It can either be true or false but not both.
It is represented by upper case letters as P, Q, R and
so on.

Example: P: Water freezes at 50
o
C
Q: Sky is blue.

These are simple propositions.


43
Connectives or Operators: These are used to
connect propositions to represent complex
information.
There are five major operators.

1. .
2. .
3. .
4. .
5. .
Operator Symbol Use Description
and P Q P and Q are True
or P Q Either P or Q is True
not or P P is not true
implication P Q P implies Q is true
Equality P Q P and Q are equal is true
. .
v v


= =
44
Table below represents truth table for all five
operators.

_______________________________________________
P Q P Q P Q P P Q P Q
F F F F T T T
F T F T T T F
T F F T F F F
T T T T F T T
. v =








45
Tautology and Contradiction

A logical formula consisting n propositions will
have 2n interpretations in truth table.

Tautology: A logical formula which has its all
interpretations true is known as tautology.

Contradiction: A logical formula which has its all
interpretations false is known as contradiction.
46
Example: For the formula draw the truth table.
Check the tautologyof the relation.
______________________________________________
P Q P
P Q P Q P P Q P
F F F T
F T T T
T F T F
T T T F
T
T
F
F
v
v v


Thegiven formula is not a tautology since its all interpretations
are not true.

47
Example: Show that ( ) ( ) Check the tautologyof the relation.
Truth Table
______________________________________________
: ( ) :( )
P Q P Q
P Q A P Q P B P Q A B
F F T T T T
F T T T T T
T F F F F T
T T T F T T
= v
v =


Thegiven formula is a tautology since its all interpretations
are not true in the last column.

48
From the previous example it is proved that ( ) ( )
If P and Q are the propositions and A and B are defined in X,
such that
:
:
.
P Q P Q
P x A
Q x B
Here Pand Qaretrueif x A and x B respectively
Similarly P and Q are tru
= v
-
e
e
e e
.
Hence ( ) can be interpreted as .
( ) : .
e if x A and x B respectively
P Q x A or x B
Therefore P Q x A or x B
e e
v e e
e e
49
If P and Q are the propositions and A and B are defined in two
different universe of course such that A X, and B Y
Then P is related to Q by a relation
R=(A B) (A Y)
So P Q is linguistically referred
-
c c

to as "IF A THEN B"
(P Q) (P S) is linguistically referred to as "IF A THEN B ELSE C"
Where P,Q and S are defined by the sets A, B,C
A X and B,C Y.
v
c c
50
Laws of Propositional Logic
1.Commutativity: (P Q)=(Q )
(P Q)=(Q )
2. Associativity: (P Q) R = P (Q R)
(P Q) R = P (Q R)
3. Distributivity: (P Q) R = (P R) (Q )

P
P
R
. .
v v
. . . .
v v v v
. v . v .
(P Q) R = (P R) (Q )
4.Identity: P False = P
P True = P
P False = False
P True = True
5. Negation:
R v . v . v
v
.
.
v
P P = False
P P = True
6. Idempotence: P P =P
P P =P
.
v
v
.
51
7. : ( )
( )
8. ' :
( )
( )
9. : ( )
tautology of
the above Laws.
Absorption P P Q P
P P Q P
DeMorgan s Law
P Q P Q
P Q P Q
Involution P P
Obtain the truth table and test the
. v =
v . =
v = .
. = v
=
52
Inference in Propositional Logic
Following three rules are used to infer facts in
propositional logic:

1. Modus Ponens

2. Modus Tollens

3. Chain Rule
53
1. Modus Ponens:



2. Modus Tollens:



3. Chain Rule:

Given P Q
and P to be true
Infers Q is true

Given P Q
and Q to be true
Infers P is true

Given P Q and Q R are true


Infers P R is true

54
Given (i) C D (ii) H (A B) (iii) (C D) H
(iv) (A B) (R S) are true.
Can (R S) be inferred to be true.
Since C D and (C D) H are t
Example:
Solut
rue.
Therefore
ion:
1.
H is also t (Mo rue.
v . v
. v
v
v v

H (A B) and (A B) (R S) are true.


Therefore H (R S) is true.
Since from 1. H is true and from 2. H (R S) is true.
Theref
dus Ponen)
2.
(
ore it is inferred that (R S) is al
Chai
so tru
n R
e.
ule)
3.
. . v
v
v
v (Modus Ponen)
55
Predicate Logic
Propositional logic have some shortcomings
1. It lacks the ability to symbolize quantification.
2. It only includes true and false values.
3. It has less logical capabilities.
e.g. P: All men are mortal
Q: Soctrates is a man
In the above example it is difficult to infer
Soctrates is mortal using propositional logic.

Hence some more tools are needed to increase
the logical abilities of propositional logic.
56
Predicate logic:
Apart from connectives and proposition of
propositional logic ,it comprises of
(i) Constants (ii) Variables (iii) Predicates
(iv)Quantifiers (v) Functions

(i) Constants: It represents the objects that do
not change values. e.g. Pen, Sahil,50 etc.

(i) Variables: Represents the values acquired by
the objects qualified by the quantifiers. e.g.
x,y,z etc.

57
(iii) Predicates: These represent the association between
the objects (constants or variables).
These acquire the truth values True or False.

e.g. Likes(Sahil,Coffee) (Sahil likes coffee)
Plays(Rita,chess) (Rita plays chess)

Here likes and plays are predicates.

If in the above example Sahil dislikes coffee, then
likes(sahi,coffee) acquires false value otherwise true.



58
(iv) Quantifiers: These are the symbols which
indicate two types of quantification namely
for all and for some.

is termed as universal quantifier and

is termed as existential quantifier.
Example: man(x) : x is a man
mortal(x) : x is mortal
Then All men are mortal is represented by














-

x (man (x) mortal(x))


59
(v) Functions:
These are similar to predicates in form and
their representation of association between
objects.
These do not acquire truth values like
predicates.
These only serve as object descriptors.
Example:
Plus(2,3) (2 plus 3 which is 5)

Here plus is a function which indirectly
represent 5.
60
Write the predicate logic statements for the following:
1. Ram likes all kinds of fruit.
2. Sita likes anything which Ram likes.
3. Raj likes those which Sita and Ram both like.
4. Ali li
Examp
kes
le:
aome of which Ram likes.
Let fruit(x) : x is fruit.
likes(x,y) : x likes y.
Then predicate logic statements of above are:
1. x (fruit(x) likes (Ram,(x
Solutio
))
2.
:
x
n


(likes (Ram,x) likes (Sita,(x))
3. x (likes (Ram,x) likes(Ram,x)) likes (Raj,(x)
4. x (likes (Ram,x) likes (Ali,(x))

.
-
61
Predicate Logic Formula Interpretations
The interpretations of the predicate logic
formula or statement depends on the
following:

1. Truth values of the predicates.

2. Nature of the quantifiers

3. Values acquired by the constants and
functions over a domain D.
62
{ }
Example:
true
Interpret the follwing predicate logic formulae over
the domain D= 1, 2 and where p(1) is and p(2) is .
1. x p(x)
2. x p(x)
1. x p(x) is true only if p(x
fal
) i
se
Solution
s true for all

:

-
values of x in the domain D.
Here p(x) is true only when x=1.
Therefore x p(x) is not true predicate logic over the given domain D.
2. x p(x) is true if the logic is true atleast for one value ox o

- ver the domin D.


Hence x p(x) is true because p(x) is true for one value of x over the domain D. -
63
Inference Rules (Predicate Logic)
The Inference rules and laws of predicate logic are
same as that of propositional logic with a pre-
condition.
i.e. Appropriately eliminate the quantifiers in the
predicate logic statements.
These are
1. Modus Ponens
2. Modus Tollens
3. Chain Rule
64
Given 1. All men are mortal.
2. Ram is a man.
Ram is mortal.
Predicate logic statements for the above can be written as:
1.
Exam
x(m
ple:
Prove:
Solu
an(x) mortal(
tion:
x))
2 an


. m

(Ram)
3. mortal (Ram)
In 1. tautology is qualified by universal quantifier for x=Ram
man (Ram) mortal (Ram)
man (Ram)= man (Ram) mortal (Ram) As P Q= P Q
man (Ram)= mortal (Ram) False

v v
v As man(Ram) is true
man (Ram)= mortal (Ram)
Hence, Ram is mortal has been proved.

65
Fuzzy Logic
Like Propositions or Predicates Logic, Fuzzy Logic is
not a two valued logic rather it is a multivalued logic.
This value ranges from 0 to1
This value is called as truth value and is numerically
equal to membership function associated with the
fuzzy set.
Fuzzy Propositions: It is a statement which acquires the
fuzzy truth value.


i.e. T(P)= ( ), 0 ( ) 1
P ,

T(P)
( ) .
A A
A
x x
Where is the fuzzy proposition is its
truthvalue and x is the value of membership function

s s
66




Fuzzy Connectives: Similar to Crisp logic fuzzy logic
supports the following connectives.


: .
: .
( ) 0.7, .
( ) 1 , .
Example Let P be the fuzzy proposition
P Ram is honest
T P if P is partly true
T P if P is absolutlytrue
=
=
1. min( ( ), ( ))
2. max( ( ), ( )).
3. (1 ( ))
4. max(1 ( ), ( ))
Operator Symbol Usage Description
Conjunction P Q T P T Q
Disjunction P Q T P T Q
Negation P T P
Implication P Q P Q T P T Q
. .
v v

v =
67
: , ( ) 0.8
: , ( ) 0.5
( ) : . ( ) 1 ( )
1 0.8 0.2
( ) : .
( ) min( ( ), ( ))
min(0.8, 0.5) 0.5
( ) :
: P Ram is honest T P
Q Sham is honest T Q
i P Ram is not honest T P T P
ii P Q Ram is honest and so is Sham
T P Q T P T Q
iii P Q Either Ram or Sh
Example =
=
=
= =
.
. =
= =
v .
( ) max( ( ), ( ))
max(0.8, 0.5) 0.8
( ) : .
( ) max(1 ( ), ( ))
max(0.2, 0.5) 0.5
amis honest
T P Q T P T Q
iv P Q If Ram is honest then so is Ram
T P Q T P T Q
v =
= =

=
= =
68
IF THEN ELSE STATEMENT
R
*Like crisp logic represents the
IF-THEN statement
and its equivalent relatio
IF x is A THEN y is B
R=(A B) (A Y)
n R is represented as
The relation
The Membership function of R is given by
(


R
, ) max(min( ( ), ( ),1 ( ))
IF x is A THEN y is B ELSE y is C,
R=(A B) (A )
( , ) max(min
*For the compound implication
The relation R is
The Membership function of R is given
(
by
B A A
x y x y x
C
x y

=

= ( ), ( ), min(1 ( ), ( ))
B A A C
x y x y
69
{ } { }
{ }
{ }
{ }
:
1, 2, 3, 4, 5 1, 2, 3, 4,
(1, 0.2), (2, 0.5), (3,1), (4, 0.3), (5, 0)
(1, 0), (2, 0.7), (3, 0.4), (4, 0.1)
(1, 0.2), (2,1), (3, 0.8), (4, 0)
Determine the implication r
Example Let fuzzy set A is defined on
X and fuzzy set Band ConY
A
B
C
= =
=
=
=
elations for
(i) IF is A THEN is B.
(ii) IF is A THEN is B ELSE C
Solution:
(i) R=(A B) (A Y)
1 2 3 4
1 0 0.2 0.2 0.1
2 0 0.5 0.4 0.1
A B , 3 0 0.7 0.4 0.1
4 0 0.3 0.3 0.1
5 0 0 0 0
x y
x y
A

(
(
(
( =
(
(
(

{ } (1, 0.8), (2, 0.5), (3, 0), (4, 0.7), (5,1)
1 2 3 4
1 0.8 0.8 0.8 0.8
2 0.5 0.5 0.5 0.5
A 3 0 0 0 0
4 0.7 0.7 0.7 0.7
5 1 1 1 1
Y
=
(
(
(
( =
(
(
(

70
1 2 3 4
1 0.8 0.8 0.8 0.8
2 0.5 0.5 0.5 0.5
R=(A B) (A Y) 3 0 0.7 0.4 0.1
4 0.7 0.7 0.7 0.7
5 1 1 1 1
( )
1 2 3 4
1 0 0.2 0.2 0.1
2 0 0.5 0
A B 3
4
R=(A B) ( )
5
A C ii
(
(
(
( =
(
(
(

{ }
{ }
.4 0.1
, (1, 0.8), (2, 0.5), (3, 0), (4, 0.7), (5,1) 0 0.7 0.4 0.1
0 0.3 0.3 0.1
0 0 0 0
(1, 0.2), (2,1), (3, 0.8), (4, 0)
1 2 3 4 1 2 3 4
1 0.2 0.8 0.8 0
2 0.2 0.5 0.5 0
A , 3 0 0 0 0
4 0.2 0.7 0.7 0
5 0.2 1 0.8 0
A
C
C R
(
(
(
( =
(
(
(

=
(
(
(
( = =
(
(
(

1 0.2 0.8 0.8 0.1
2 0.2 0.5 0.5 0.1
A B A 3 0 0.7 0.4 0.1
4 0.2 0.7 0.7 0.1
5 0.2 1 0.8 0
C
(
(
(
( =
(
(
(

71
Fuzzy Inference
Fuzzy inference is a computational procedures
used to evaluate linguistic descriptions.
There are mainly two inferring procedures:

1. Generalized Modus Ponens(GMP)


2. Generalized Modus Tollens (GMT)


72
Generalized Modus Ponens(GMP)

, , .
:
IF is A THEN is B
is
____________________
Let A B A and B are the fuzzy terms
TheGMP is stated as
x y
x A
y is B
The fuzzy linguistic statements above the line are
analytically known and the statement below the
' '
'
'
.
( , )
.
( , )
( ( ) max(min( ( ), ( , )))
( ) ,
( , )
B R A
A
R
line
is analytically unknown
Max MinComposition between A and R x y is used to
compute the value of B
B A R x y
y x x y
Where x is the membership function of A
x y is the mem

' '
'
'
'
' ' =
=
'
.
( ( ) .
B
bership function of implication relation
y is the membership function of B
'
'
73
Generalized Modus Tollens
, , .
:
IF is A THEN is B

____________________
is
Let A B A and B are the fuzzy terms
TheGMT is stated as
x y
y is B
x A
The fuzzy linguistic statements above the line are
analytically known and the statement below the
' '
'
'
.
( , )
.
( , )
( ) max(min( ( ), ( , )))
( ) ,
( , )
B R A
A
R
line
is analytically unknown
Max MinComposition between B and R x y is used to
compute the value of A
A B R x y
x y x y
Where x is the membership function of A
x y is the memb

' '
'
'
'
' ' =
=
'
.
( ) .
B
ership function of implication relation
y is the membership function of B
'
'
74
{ }
{ }
: ( ) ( )
(50, 0.1), (75, 0.5), (100, 0.7), (125, 0.9), (150,1)
(1,1), (2, 0.7), (3, 0.5), (4, 0.4), (5, 0.1)
( ) "
Example Given two fuzzy sets A temperature is high and B Voltage is low
A
B
i Deduce the relation IF temperature is high THEN vol
=
=
{ }
"
( ) (50, 0), (75, 0.2), (100, 0.4), (125, 0.6), (150,1)
:
( ) R=(A B) (A Y)
1 2 3 4 5 1 2 3 4 5
50 0.1 0.1 0.1 0.1 0.1
75 0.5 0.5 0.5 0.4 0.1
(A B) 100 0.7 0.7 0.5 0.4 0.1
125 0.9 0.7 0.5 0.4 0.1
150 1 0.7 0.5 0.4
tage is low
ii Find B if A
Solution
i
' ' =

=
50 0.9 0.9 0.9 0.9 0.9
75 0.5 0.5 0.5 0.5 0.5
, (A ) 100 0.3 0.3 0.3 0.3 0.3
125 0.1 0.1 0.1 0.1 0.1
0.1 150 0 0 0 0 0
1 2 3 4 5
50 0.9 0.9 0.9 0.9 0.9
75 0.5 0.5 0.5 0.5 0.5
R=(A B) (A Y) 100 0.7 0.7 0.5 0.4 0
125
150
Y
( (
( (
( (
( ( =
( (
( (
( (

=
{ }
.3
0.9 0.7 0.5 0.4 0.1
1 0.7 0.5 0.4 0.1
( ) R using max min .
(1,1), (2, 0.7), (3, 0.5), (4, 0.4), (5, 0.3)
ii B A composition
B
(
(
(
(
(
(
(

' ' =
' =
75
Fuzzy Rule Base
It is the description of the fuzzy system is made through
fuzzy IF-THEN rules. As

IF (a set of conditions) are satisfied
THEN (a set of consequents) can be inferred




1 1 2 2 1 1 2 2
( , ,......, ) ( , ,......., )
variables .
n n n n
i j i j
IF x is A x is A x is A THEN y is B y is B y is B
Where linguistic x and y take the value of fuzzy sets A and B
76
Defuzzification
It is the conversion of fuzzy set to single crisp value.
The widely used defuzzification methods are:

1. Centroid Method

2. Centre of Sum Method

3. Mean of Maxima Method
77
Centroid Method
This method is also known as Centre of gravity or the
Centre of Area Method.
It is obtained by calculating the centre of area
(x*)occupied by the fuzzy set.




1
1
( )
* .
( )
. ( )
* .
( )
n
i i
i
n
i
i
x x dx
x for a continuous membership function
x dx
x x
x for a discrete membership function
x

=
=
=
=
}
}

78
Centre of Sums Method
In centroid method overlapping area is counted once
whereas in centre of sums method the overlapping
area is counted twice.
The defuzzified value x* is given by:

1 1
1 1
. ( )
( )
var .
k
k
N n
i i
A
i k
N n
i
A
i k
x x
x here n is thenumber of fuzzy sets
x
and N is number of fuzzy iables

= =
= =
- =

79
Mean of Maxima Method
This is the simple defuzzification method.
The output is the crisp value with the highest degree
of membership function.
If more than one element are having maximum value
then men value of the maxima is taken.

{ }
* : ( )
.
i
i
x M
i i
x
x where M x x is equal to the height of the fuzzy set
M
M is the cardinality of the fuzzy set

e
= =

80


1 2 3
: , . Example Let A A and A are the three fuzzy sets as shownin fig
A1
A2
A3
81
Aggregated Fuzzy Set
0.3
0.5
1
1 2 3 4 5 6 7 8
1
2

3.6
3
4
5 6
7
8
9
5.5
82
1. Centroid Method:









Area
Seg.
No.
Area(A) Centroid x Ax
1 1/2x0.3x1=0.15 0.67 0.1005
2 2.6x0.3=0.78 2.3 1.794
3 0.3x0.4=0.12 3.8 0.456
4 1/2x0.4x0.2=0.04 3.8667 0.1546
5 1.5x0.5=0.75 4.75 3.5625
6 0.5x0.5=0.25 5.75 1.4375
7 1/2x0.5x0.5=0.125 5.833 0.729
8 1x1=1 6.5 6.5
9 1/2x1x1=0.5 7.33 3.665
18.353
* 4.9
3.715
AX
Therefore x
A
= = =

83
.
1 1 1
0.3 (3 5) 2.5 0.5 (4 2) 5 1 (3 1) 6.5
2 2 2
*
1 1 1
0.3 (3 5) 0.5 (4 2) 1 (3 1)
2 2 2
5
Since the maxima is havin
2. :
g
.
i
3 :
at po
In this method overlapping areas are counted
Centre of sums Method
Mean of Maxima Method
twice
x
+ + + + +
=
+ + + + +
=
nt 6 7.
6 7
* 6.5
2
and
Hence x
+
= =
84

You might also like