AIFA 22 Fuzzy Logic 050324

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

AIFA: Fuzzy Reasoning

05/03/2024

Koustav Rudra
Fuzzy Reasoning
• Based on Fuzzy set theory and consequently Fuzzy Logic

• We use terms, words that are imprecise in nature


• Example:
• It rains heavily
• The door is strong
• The color of the box is more or less red or reddish

• What is the problem?


• These terms do not find a direct mapping to any quantification like number
• Poses a difficulty when we try to compute with these things

• Fuzzy reasoning deals with such imprecise scenario


Types of Uncertainty and Modeling of Uncertainty

• Looks more or less like Abraham Lincoln

• How is it that we can certainly identify that this is figure of


Abraham Lincoln?

• The complexity of decisions from such subjective inputs to the


decision that we make in our mind is intriguing and often we do
not really understand in quantified manner
Types of Uncertainty and Modeling of Uncertainty

• Stochastic Uncertainty
• The probability of Hitting the target is 0.8

• We carried out a number of experiments and based on that


• We have seen 80% cases we would hit the target properly
Types of Uncertainty and Modeling of Uncertainty

• Lexical Uncertainty
• Uncertainty that creeps in from our usage of day-to-day
words
• Such words are subjective / ambiguous/ pre-imprecise

• “Tall men”, “Hot days”, “Stable currencies”

• We will probably have a successful business year

• The experience of expert A shows that B is likely to occur.


Expert C is convinced this is NOT True
Probability and Uncertainty
• “… a person suffering from hepatitis shows in 60% of all cases a
strong fever, in 45% of all cases yellowish colored skin, and in 30% of
all cases suffers from nausea …”

• 60% of all cases a strong fever è Probability + Fuzzy


• 45% of all cases yellowish colored skin è Probability + Fuzzy
• 30% of all cases suffers from nausea è Probability
Fuzzy Set Theory

Conventional (Boolean) Set Theory Fuzzy Set Theory

101.66oF 101.66oF

104.18oF 104.18oF 106.52oF


106.52oF
107.6oF 107.6oF

102.74oF
102.74oF
Strong Fever Strong Fever

Can we make such a crisp boundary? Boundary is gradually fading out

Either an element belong to the set or not Chance becomes less as the point moves further
Set and Logic: Connection

a
b
• belongs(a,X)
• belongs(b,X)
c
• ~belongs(d,X)

d
Fuzzy Logic
• Fuzzy Logic: Reasoning with qualitative information
• This is more realistic than predicate calculus
• Because in real life we need to deal with qualitative statements

• Examples:
• In process control: Chemical plant
• Rule: If the temperature is moderately high & the pressure is medium then turn the knob
slightly right
Fuzzy Logic
• Dealing with precise numerical information is often inconvenient, not suitable for humans

• Weather is sunny today

• It is very cold inside campus


Fuzzy Reasoning
• Form of many-valued logic

• Deals with reasoning that is approximate rather than fixed and exact

• Compared to traditional binary sets, fuzzy logic variables may have a truth value that ranges in
degree between 0 and 1

• Resembles human reasoning in its use of imprecise information to generate decisions

• Classical logic which requires a deep understanding of a system, exact equations, and precise
numeric values
Logic Types
• Bivalent Logic
• Classical logic, often described as Aristotelian logic
• True or false
• Bayesian Reasoning and probabilistic models
• Each fact is either True or false
• Often unclear whether a given fact is true or false

• Multivalent Logics
• Three-valued logic
• True , false, and undetermined
• 1 represents true, 0 represents false, and real numbers between 0 and 1 represent degree of
truth
Fuzzy Sets vs Traditional/Crisp Sets
• Traditional set, Crisp set
• Defined by the values that are contained within it
• A value is either within the set, or it is not
• e.g a set of natural number

• Fuzzy set
• Each value is a member of the set to some degree, or is not a member of the set to some degree
• Example:
• Bill is 7 feet tall
• John is 4 feet tall
• Jim is 5 feet tall
Crisp Set: Membership
• Membership/ Characteristics/ Discriminative Predicate
• Example:
• S = {2,3,5,a,b,c}
• X = universe = {1,2,3,…,10,a,b,c,…,z}
• 1 ∉ 𝑆 (𝑑𝑜𝑒𝑠 𝑛𝑜𝑡 𝑏𝑒𝑙𝑜𝑛𝑔)
• 𝑎 ∈ 𝑆 (𝑏𝑒𝑙𝑜𝑛𝑔𝑠)

• U = {Set of all integers}


• X = {1,2,3,4,7,9}
• Membership of u∈ 𝑋 is either 1 (belongs to) or 0 (does not belong)

• Fuzzy set differs from Crisp set in terms of membership


Fuzzy Set Theory: Basics
• Generalization of crisp set theory
• Fundamental observation:
• 𝜇! 𝑥 = 𝑛𝑜 𝑙𝑜𝑛𝑔𝑒𝑟 0/1
• 𝜇! 𝑥 is between [0,1], both included

• Example:
• Crisp set, 𝑆" = {2,4,6,8,10}
• 𝜇!! 𝑥 is a predicate which denotes x to be an even number less than or equal to 10
• Given any ‘a’ which is a number, the 𝜇!! 𝑥 question produces 0/1
Fuzzy Set Theory: Basics
• 𝑥 ∈ 𝐻𝑒𝑖𝑔ℎ𝑡
• Fuzzy set: 𝑀𝑒𝑑𝑖𝑢𝑚 ⊆ 𝐻𝑒𝑖𝑔ℎ𝑡
#.% #.& #.( "
• 𝑀𝑒𝑑𝑖𝑢𝑚 = { , , , }
&" '"" &" &"" &" )"" &" "#""
* (,)
• 𝑀𝑒𝑑𝑖𝑢𝑚 = { # }
,
Fuzzy Set
• Fuzzy set membership function

• Fuzzy set A is defined by membership function 𝜇!

• Choose entirely arbitrarily, reflect a subjective view on the part of the author

• A list of pairs for representing fuzzy set in computer like


• 𝐴 = { 𝑥", 𝜇! 𝑥" , 𝑥#, 𝜇! 𝑥# , … , (𝑥$ , 𝜇! (𝑥$ ))}
Basic Concept of Fuzzy Logic

Boolean Logic Fuzzy Logic


Fuzzy Sets
• Boolean/Crisp set A is a mapping for the elements of S to the set {0,1}
• 𝐴: 𝑆 → 0,1
• Characteristic Function:
1 𝑖𝑓 𝑥 ∈ 𝐴
• 𝜇. 𝑥 = I
0 𝑖𝑓 𝑥 ∉ 𝐴

• Fuzzy set F is a mapping for the elements of S to the interval [0,1]


• 𝐴: 𝑆 → 0,1
• Characteristic Function: 0 ≤ 𝜇/ ≤ 1
• 1 means Full Membership
• 0 means No Membership
• Anything in between e.g., 0.5 is called Graded Membership
Example: Crisp Set Tall
• Crisp set Tall can be defined as
• {x| height x >1.8 meters}

• But what about a person with height 1.79 meters


• What about 1.78 meters
• What about 1.52 meters
Example: Fuzzy Set Tall
• In a Fuzzy set a person with a height of 1.8 meters would be
considered tall to a high degree

• A person with a height of 1.7 meters would be considered tall


to a lesser degree

• The function can change for different domains (Basketball


player, Women, …)
Fuzzy Terms: Conceptualizing
1

“Loan About 600”

N
0 500 600 700

• One representation for the


fuzzy number “about 600”
Fuzzy Set Definitions
• Discrete Definitions:
• 𝜇/ 350 𝐶 = 0 𝜇/ 380 𝐶 = 0.1 𝜇/ 410 𝐶 = 0.9
• 𝜇/ 360 𝐶 = 0 𝜇/ 390 𝐶 = 0.35 𝜇/ 420 𝐶 = 1
• 𝜇/ 370 𝐶 = 0 𝜇/ 400 𝐶 = 0.65 𝜇/ 430 𝐶 = 1

• Continuous Definitions:
1

0 35! 36! 37! 38! 41! 42! 43!


39! 40!
Describing a Set
• A set is derived in one of the two ways:
• By Extension
• Requires listing
• S1 is {2,4,6,8,10} --- needs finiteness
• X = {6,7,8,…}

• By Intension
• Needs a closed form expression related to properties
• X = {x| x≥6}
Fuzzy Set Representation

• A finite set of elements:


* * *
• 𝐹 = ! + $ + ⋯+ %
,! ,$ ,%
• + means Boolean set union

# # #." #.& #.(


• 𝑇𝑎𝑙𝑙 = { , , , , }
".# ".1 ".' ".) ".(

How do we represent a Fuzzy Set in Computer?


Fuzzy Set Representation
• Age = {5, 10, 20, 30, 40, 60, 80}
𝜇

5 1 0

10 1 0

20 1 0 Age

30 0.6 0
𝜇

40 0.5 0.2

60 0.01 0.5

80 0.02 0.9 Age


Profile of Tall
1

𝜇 !"## (ℎ)

0
1 2 3 4 5 6 7 8 9
Height
Shapes of Profiles
• Shapes of profiles are obtained from experiments or expert judgement

• Statistically obtained by % count

• Profile itself is somewhat “vague”


Membership Function
05/03/2024

Koustav Rudra
Membership Function
• A membership function for a fuzzy set A on the universe of discourse X is defined as 𝜇. : 𝑋 →
0,1 ,

• where each element of X is mapped to a value between 0 and 1

• This value, called membership value or degree of membership,


• quantifies the grade of membership of the element in X to the fuzzy set A
Membership Function
• Simple functions are used to build membership functions
• As we are defining fuzzy concepts, using more complex functions does not add more precision

• These are some membership functions


• Triangular function
• Trapezoidal function
• Gaussian function
Triangular Function
It is defined as a lower limit a, an upper limit b,
and a value m, where a < m < b

0, 𝑥≤𝑎
𝑥−𝑎
, 𝑎<𝑥≤𝑚
𝜇! (𝑥) = 𝑚 − 𝑎
𝑏−𝑥
, 𝑚<𝑥<𝑏
𝑏−𝑚
0, 𝑥≥𝑏
Trapezoidal Function
• It is defined by
• a lower limit a,
• an upper limit d,
• a lower support limit b, and
• an upper support limit c,
• where a < b < c < d

0, 𝑥 < 𝑎 𝑜𝑟 𝑥 > 𝑑
𝑥−𝑎
, 𝑎≤𝑥≤𝑏
𝜇! (𝑥) = 𝑏−𝑎
1, 𝑏≤𝑥≤𝑐
𝑑−𝑥
, 𝑐≤𝑥≤𝑑
𝑑−𝑐
Trapezoidal Function: R Function
Trapezoidal Function: L Function
Gaussian Function
• It is defined as
• a central value m and
• a standard deviation k > 0
• The smaller k is, the narrower the “bell” shape

(,23)$
2
𝜇. 𝑥 = 𝑒 14 $
Example
Crisp Set Fuzzy Set

• Cold • Very cold


• Hot • Cold
• Normal
• Hot
• Very hot
Temperature: Membership Computation

• Very cold: a<0, b<=0, c=7, d=10 • X = 29℃


• Compute membership value for Normal and Hot?
• Cold: a=7, b=10, c=16, d=20 • Normal
• 𝑐<𝑥<𝑑
• Normal: a=16, b=20, c=26, d=30 • 𝑐 = 26, 𝑑 = 30
'() +,(-. 0
• 𝜇!"#$%& 𝑥 = = = = 0.25
• Hot: a=26, b=30, c=36, d=40 '(* +,(-/ 1
• Hot
• Very Hot: a=36, b=40, c=46, d>46 • 𝑎<𝑥<𝑏
• 𝑎 = 26, 𝑏 = 30
)(% -.(-/ +
• 𝜇2"3 𝑥 = = = = 0.75
4(% +,(-/ 1
Membership Function: S-function
• The S-function could be used to define
Fuzzy sets
0 𝑓𝑜𝑟 𝑥 ≤ 𝑎
WXY [
2( ) 𝑓𝑜𝑟 𝑎 ≤ 𝑥 < 𝑏
• 𝑆 𝑥, 𝑎, 𝑏, 𝑐 = ZXY
!"# %
\X[( ) ]^_ `aWbZ
#"$
\ ]^_ WcZ
Membership Function: Close to a

1
𝜇$#%&'+ 𝑥 =
1 + (𝑥 − 𝑎)(

1 1
𝜇$#%&', −1 = = = 0.5
1 + (−1 − 0)( 2

1 1
𝜇$#%&', 2 = = = 0.2
1 + (2 − 0)( 5
Membership Function: Close to a

1
𝜇$#%&'+ 𝑥 =
1+ 𝑥−𝑎

• Explicit representation of Fuzzy set: Table


• Implicit representation of Fuzzy set: Function
Linguistic Variable
05/03/2024

Koustav Rudra
Linguistic Variable
• Ravi is tall (adjective)
• Set of tall people is Fuzzy

• Europeans are mostly (adverb) rich (adjective)

• A linguistic variable is
• The predicate of a sentence
• Typically is an adjective (often qualified by adverb)

• A linguistic variable to be amenable to Fuzzy Logic, must have an underlying numerical quantity

• A Fuzzy set is always defined over a crisp set and said to be subset of that crisp set
Linguistic Variable
• Terms, Degree of Membership, Membership Function, Base Variable, …
Low Temp Normal Raised Temperature Raised Temperature
1

𝜇(𝑥)

0
36! 𝐶 37! 𝐶 38! 𝐶 39! 𝐶 40! 𝐶 41! 𝐶 42! 𝐶

Over the same crisp set we can define different Fuzzy sets based on variable
Hedges
• Hedges are entities to deal with adverb
• John is tall
• Jack is very tall
• Jill is somewhat tall
• Very à squaring the 𝜇 function
• Somewhat àtaking square root of 𝜇 function
Hedges

𝜇 !"## (ℎ) Somewhat Tall

Very

0
1 2 3 4 5 6 7 8 9
Height
Concentration and Dilation Operator
• 𝜇34566 ℎ = (𝜇 4566 (ℎ))#
• 𝜇74566 ℎ = 𝜇 4566 (ℎ)
1

𝜇 !"## (ℎ) Somewhat Tall

Very

0
1 2 3 4 5 6 7 8 9
Height
Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy