Introduction to Fuzzy Logic Fuzzy Sets Shadi T. Kalat Session number 03/18/2016
Fuzzy Sets Fuzzy sets Crisp sets: In mathematics, fuzzy sets are sets whose elements have degrees of membership Crisp sets: In a crisp set, an element is either a member of the set or not.
Fuzzy Sets Characteristic function Membership function 𝜇(𝑥) characteristic function of a subset A of some set X, maps elements of X to the range {0,1}, the function that indicates membership in a set Membership function 𝜇(𝑥) 𝐴= 𝑥, 𝜇 𝐴 𝑥 𝑥∈𝑋} Membership grade 𝑛∈[0, 1]
Fuzzy Sets Discrete Universe Continuous Universe Membership Grade X=Age X= Number of children
Fuzzy Sets A fuzzy set (A) could be written in two forms: 𝐴= 𝑥 𝑖 ∈𝑋 𝜇 𝐴 ( 𝑥 𝑖 )/ 𝑥 𝑖 Discrete Universe 𝐴= 𝑋 𝜇 𝐴 (𝑥)/𝑥 Continuous Universe
Fuzzy Sets Support Height Core Support and Core Membership Grade Support and Core Support Height Core 𝑆𝑢𝑝𝑝𝑜𝑟𝑡 𝐴 ={𝑥∈𝑋| 𝜇 𝐴 𝑥 >0} 𝐻𝑒𝑖𝑔ℎ𝑡 𝐴 =𝑀𝑎𝑥 𝜇 𝐴 𝑥 ∀𝑥∈𝑋 𝐶𝑜𝑟𝑒 𝐴 ={𝑥| 𝜇 𝐴 𝑥 =1}
Fuzzy Sets 𝛼−cut Level set Crossover point Crossover points 𝐴 𝛼 ={𝑥∈𝑋| 𝜇 𝐴 𝑥 >𝛼} Height ∧ 𝐴 ={𝛼| 𝜇 𝐴 𝑥 =𝛼} Core 𝐶𝑟𝑜𝑠𝑠𝑜𝑣𝑒𝑟 𝐴 ={𝑥| 𝜇 𝐴 𝑥 =0.5} α-cut
Fuzzy Sets Convexity 𝜇 𝐴 𝜆 𝑥 1 + 1−𝜆 𝑥 2 ≥ min 𝜇 𝐴 𝑥 1 , 𝜇 𝐴 𝑥 2 𝜆∈[0,1] Convex Non-convex
Fuzzy Sets Scalar Cardinality 𝐴 = 𝑥 𝑖 ∈𝑋 𝜇 𝐴 ( 𝑥 𝑖 )
Membership Functions Triangular membership function 𝑇𝑟𝑖𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑥,𝑎,𝑏,𝑐 =max( min 𝑥−𝑎 𝑏−𝑎 , 𝑐−𝑥 𝑐−𝑏 ,0) Membership Grade
Membership Functions Trapezoidal membership function 𝑇𝑟𝑎𝑝𝑒𝑧𝑜𝑖𝑑𝑎𝑙 𝑥,𝑎,𝑏,𝑐,𝑑 =max( min 𝑥−𝑎 𝑏−𝑎 , 𝑑−𝑥 𝑑−𝑐 ,0) Membership Grade
Membership functions Gaussian membership function Membership Grade
Membership functions Generalized bell membership function 𝑔𝑏𝑒𝑙𝑙 𝑥,𝑎,𝑏,𝑐 = 1 1+ 𝑥−𝑐 𝑎 2𝑏 Membership Grade
Operations on fuzzy sets Equivalence Fuzzy subset Fuzzy negation 𝜇 𝐴 𝑥 = 𝜇 𝐵 𝑥 𝑥∈𝑋 Membership Grade 𝜇 𝐴 𝑥 ≤ 𝜇 𝐵 𝑥 𝐴⊆𝐵 𝜇 𝐴 𝑥 = 1−𝜇 𝐴 𝑥 Membership Grade
Operations on fuzzy sets Sugeno’s complement Yager’s complement 𝑁 𝑠 𝑎 = 1−𝑎 1+𝑠𝑎 𝑠>−1 𝑁 𝑤 𝑎 = 1− 𝑎 𝑤 1 𝑤 𝑤>0
Operations on fuzzy sets Fuzzy sets A and B Fuzzy set NOT A Fuzzy sets A OR B Fuzzy sets A AND B
2D fuzzy set 𝑅= 𝑋×𝑌 𝜇 𝑅 (𝑥,𝑦) (𝑥,𝑦) Membership Grade
T-Norm (Triangle norm) 𝑇:𝐼×𝐼⟶𝐼 𝜇 𝐴∩𝐵 𝑥 =𝑇 𝜇 𝐴 𝑥 , 𝜇 𝐵 𝑥 = 𝜇 𝐴 (𝑥)× 𝜇 𝐵 (𝑥) 𝑇 0,0 =0 𝑇 𝑎,1 =𝑇 1,𝑎 =𝑎 𝑇 𝑎,𝑏 =𝑇 𝑏,𝑎 𝑇(𝑇 𝑎,𝑏 ,𝑐)=𝑇(𝑎,𝑇 𝑏,𝑐 ) 𝐼𝑓 𝑎≤𝑏 𝑇 𝑎,𝑐 ≤𝑇 𝑏,𝑐
T-norms Min Algebraic product Bounded product Drastic product 𝑇 𝑎𝑝 𝑎,𝑏 =𝑎𝑏 𝑇 𝑏𝑝 𝑎,𝑏 = max 𝑎+𝑏−1,0 =0∧(𝑎+𝑏−1) 𝑇 𝑑𝑝 𝑎,𝑏 = 𝑎 𝑖𝑓 𝑏=1 𝑏 𝑖𝑓 𝑎=1 0 𝑖𝑓 𝑎,𝑏<1
T-norms Min A&B Algebraic product
T-norms Bounded product Drastic product
T-norms 𝐻𝑎𝑚𝑎𝑐ℎ𝑒𝑟: 𝑎𝑏 𝛾+(1−𝛾)(𝑎−𝑏−𝑎𝑏) 𝛾≥0 𝐻𝑎𝑚𝑎𝑐ℎ𝑒𝑟: 𝑎𝑏 𝛾+(1−𝛾)(𝑎−𝑏−𝑎𝑏) 𝛾≥0 𝐷𝑜𝑚𝑏𝑖:1− min 1−𝛼 𝜓 + 1−𝑏 𝜓 1 𝜓 ,1 𝜓>0
S-norms 𝑆:𝐼×𝐼→𝐼 S 1,1 =1 S 𝑎,0 =𝑆 0,𝑎 =𝑎 S 𝑎,𝑏 =𝑆 𝑏,𝑎 𝐼𝑓 𝑎≤𝑏 𝑇 𝑎,𝑐 ≤𝑇 𝑏,𝑐
S-norms Max Algebraic sum Bounded sum Drastic sum 𝑇 𝑎𝑠 𝑎,𝑏 =𝑎+𝑏−𝑎𝑏 𝑇 𝑏𝑠 𝑎,𝑏 = min 𝑎+𝑏,1 𝑇 𝑑𝑠 𝑎,𝑏 = 𝑎 𝑖𝑓 𝑏=0 𝑏 𝑖𝑓 𝑎=0 1 𝑖𝑓 𝑎,𝑏<0
S-norms Max A&B Algebraic sum
S-norms Bounded sum Drastic sum
Fuzzy Rules Extension Principle F, y, x belong to a crisp set 𝑦=𝑓(𝑥) 𝑥=𝐴 𝑦=𝑓 𝐴 F, y, x belong to a crisp set
Fuzzy Rules Assume A is a fuzzy member of X 𝑦=𝑓(𝑥) 𝑥=𝐴 𝑦=𝑓 𝐴 =𝐵 𝑦=𝑓(𝑥) 𝑥=𝐴 𝑦=𝑓 𝐴 =𝐵 𝜇 𝐵 𝑦 = 𝜇 𝐴 (𝑥) 𝜇 𝐵 𝑦 = 𝜇 𝐴 ( 𝑓 −1 (𝑦)) 𝜇 𝐵 𝑦 ≜𝑚𝑎𝑥 𝜇 𝐴 (𝑥) 𝑥= 𝑓 −1 (𝑦)
Example 𝐴= 0.1 −3 + 0.2 −6 + 0.3 −8 𝑆𝑚𝑎𝑙𝑙= 1 1 + 1 2 + 0.8 3 + 0.6 4 + 0.4 5 𝑦=|𝑥| 𝑦= 𝑥 2 𝐵= 0.1 3 + 0.2 6 + 0.3 8 𝑆𝑚𝑎𝑙 𝑙 2 = 1 1 + 1 4 + 0.8 9 + 0.6 16 + 0.4 25
Cylindrical extension 𝐶 𝐴 = 𝑥×𝑦 𝜇 𝐴 𝑥 (𝑥,𝑦) Cylindrical extension of A Base fuzzy set A Membership Grade Membership Grade
Projections of fuzzy sets 𝑅 𝑥 = [ max 𝑦 𝜇 𝑅 (𝑥,𝑦)]/𝑥 𝑅 𝑦 = [ max 𝑥 𝜇 𝑅 (𝑥,𝑦)]/𝑦 2-D Membership Function Projection onto X Projection onto Y
Fuzzy relations 𝑅= 𝑥×𝑦 𝜇 𝑅 𝑥,𝑦 (𝑥,𝑦) 𝜇 𝑅 𝑥,𝑦 = 𝑦−𝑥 𝑥+𝑦+2 𝑥<𝑦 0
Fuzzy Relations Max-Min Composition Max-Dot Product 𝑣∈𝑉, 𝑥∈𝑋, 𝑦∈𝑌 𝜇 𝑅 𝑥,𝑦 =𝑚𝑎𝑥 𝜇 𝑅1 𝑥,𝑣 , 𝜇 𝑅2 𝑣,𝑦 𝑣∈𝑉, 𝑥∈𝑋, 𝑦∈𝑌
Fuzzy Relations 𝑅1:𝑋 𝑖𝑠 𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑜𝑛 𝑉 𝑅1 𝑑𝑒𝑓𝑖𝑛𝑒𝑑 𝑖𝑛 𝑋×𝑉 𝑎𝑛𝑑 𝑅2 𝑖𝑛 𝑉×𝑌 𝑅2:𝑉 𝑖𝑠 𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑜𝑛 𝑌 𝑋={1,2,3} 𝑉={𝛼,𝛽, 𝛾, 𝛿} 𝑌={𝑎,𝑏} 𝑅2= 0.9 0.2 0.5 0.1 0.3 0.6 0.7 0.2 𝑅1= 0.1 0.3 0.5 0.4 0.2 0.8 0.6 0.8 0.3 0.7 0.9 0.2
Fuzzy Relations Max-Min Max-Dot 𝜇 𝑅1.𝑅2 2,𝑎 = max 0.4∧0.9,0.2∧0.2,0.8∧0.5,0.9∧0.7 = max 0.4,0.2,0.5,0.7 =0.7 𝜇 𝑅1.𝑅2 2,𝑎 = max 0.4×0.9,0.2×0.2,0.8×0.5,0.9×0.7 = max 0.36,0.4,0.4,0.63 =0.63
Linguistic Variables Primary terms: Young, old, … Negation: Not young, Not old Hedge: Very old, Extremely young, more or less old
Linguistic Variables Concentration (very) Dilation (more or less) Not Contrast Intensification 𝐶𝑜𝑛 𝐴 = 𝐴 2 Contrast intensifier effect 𝐷𝑖𝑙 𝐴 = 𝐴 0.5 Membership Grade 𝑁𝑜𝑡 𝐴 =−𝐴 𝐼𝑛𝑡 𝐴 = 2 𝐴 2 0≤ 𝜇 𝐴 𝑥 ≤0.5 2 𝐴 2 0.5≤ 𝜇 𝐴 𝑥 ≤1