http://expertsys.4t.com Fuzzy Expert Systems Lecture 3 (Fuzzy Logic) As far as the laws of mathematics refer to reality, they are not certain, and so far as they are certain, they do not refer to reality. Albert Einstein With thanks to Dr. Jan Jantzen from technical university of Denmark and Dr. J.-R. Roger Jang from Tsing Hua Univ., Taiwan
Fuzzy Logic As a way of representing uncertainty In the classical Boolean logic, every statement is either TRUE or FLASE. It is common to show the truth value of a statement with either 0 or 1 (two valued logic) Crisp Logic يک گزاره در منطق دو ارزشی ارزش درستی (صحت) Examples: 1+1=2 1 2 is a greater than 5 0 John is 25 years old 1
However, in many of the real world situations, there exist statements which can not be easily regarded as TRUE or FALSE statements. As a matter of fact, there is uncertainty in assigning a truth value to this statements. This problem arouse when we encounter some vague and rough concepts which are mainly used in natural language (NL) propositions and can not be tolerated in classical logic
Examples: 5 is much greater than 2 John is an old person The weather is cold Fuzzy Logic associates a more generalized degree of truth to each statement. This degree of truth is indeed a real number which can take any values between 0 and 1
Fuzzy Versus Crisp Logic Exact (crisp) 0 1 Approximate (Fuzzy) 0 1 : Allowed truth values Fuzzy logic is an extension to crisp logic, consequently, the laws of the classical logic can be extended and applied in fuzzy logic as well.
The real world is not a Black an White World. Black Dark grey Grey Light grey white Yes Yes with degree 0.7 Yes with degree 0.5 Yes with degree 0.3 No at all Is this box Black??
The Father of Fuzzy Logic Lotfi A. Zadeh Born of an Iranian Azerbaijani father and a Russian mother in 1921, Baku, Azerbaijan Alumnus of the university of Tehran, MIT and Columbia university Currently is a Professor Emeritus in University of California Berkeley Introduced Fuzzy Logic in his seminal paper entitled Fuzzy sets in 1965
About his nationality! L. A. Zadeh: "The question really isn't whether I'm American, Russian, Iranian,, Azerbaijani, or anything else, "I've been shaped by all these people and cultures and I feel quite comfortable among all of them." http://http.cs.berkeley.edu/people/faculty/homepages/zadeh.html
Conventional Crisp Set A set is any collection of objects which can be treated as a whole. A set can be described by its members such that an item from a given universe named universe of discourse is either member or not. The set theory developed by G. cantor (1845-1918) 1918) is the basis of the classical crisp mathematics.
In other words, a membership function µ A (x) can be defined such that µ A (x) is either zero or one for every x U. A={(x, x,µ A (x)) x U, µ A (x)=1 If x A, Example µ A (x)=0 If x A} U={1,2,..}=N Natural numbers A={2,5,7,11} A crisp set 2 A => µ A (2)=1, 3 A =>µ A (3)=0 A={(1,0), (2,1),, (3,0), (4,0), (5,1),.. }
Fuzzy Set Many sets have more than an either-or criterion for membership evaluation. Any element x in the universe of discourse U belongs to a Fuzzy set A to a certain degree µ (x). A A ={ (x,µ (x)) A x U x U, 0 0 µ (x) A 1} The value µ (x) A is the grade of membership
Example: The set of young peoples Suppose that U={4,12,32,50,70} A=the set of young people in the universe of peoples having ages indicated in U A={(4,1),(,1),(12,0.9),(32,0.6),(50,0.2),(70,0)} Alternatively 4 A = { 1, 12 0.9, 32 0.6, 50 0.2 70, } 0
Sets with fuzzy boundaries A = Set of tall people Crisp set A Fuzzy set A 1.0 1.0.9.5 Membership function 5 10 Heights 5 10 6 2 Heights From: Slides for fuzzy sets,, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang
Fuzzy Sets do not have an exact Crisp Set boundary Fuzzy Set In a fuzzy set, the transition between membership and non membership is gradual rather than exact. (L. A. Zadeh)
Representing a fuzzy set: Membership Function The grade of membership for elements of the fuzzy set can be represented graphically as well as mathematically in a membership function Characteristics of MFs: Subjective measures Not probability functions
How to define the membership function (MF)? NOTE: The Fuzzy theory does not give a formal basis for how to determine the grade of membership The grade of an object in a fuzzy set is a subjective matter. L. A. Zadeh
Example: The fuzzy set of tall peoples MFs tall in Asia.8.5.1 tall in the US tall in NBA 5 10 Heights Figure From: Slides for fuzzy sets,, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang
Universe Elements of a fuzzy set are taken from a universe of discourse. The universe contains all elements that can come into consideration. The universe depends on the context. An application of the universe is to suppress faulty measurement data outside of the possible range
Fuzzy Sets with Discrete Universes Fuzzy set C = desirable city to live in U = {SF, Boston, LA} (discrete and nonordered) C = {(SF, 0.9), (Boston, 0.8), (LA, 0.6)} Fuzzy set A = sensible number of children U = {0, 1, 2, 3, 4, 5, 6} (discrete universe) A = {(0,.1), (1,.3), (2,.7), (3, 1), (4,.6), (5,.2), (6,.1)}
Fuzzy Sets with Cont. Universes Fuzzy set B = about 50 years old X = Set of positive real numbers (continuous) B = {(x, µ B (x)) )) x in X} µ B ( x ) = 1 + x 1 50 10 2 From: Slides for fuzzy sets,, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang
Alternative Notation A fuzzy set A can be alternatively denoted as follows: X is discrete X is continuous A = µ A ( xi) / x x i X A= µ ( x )/ x X A i Note that Σ and integral signs stand for the union of membership grades; / stands for a marker and does not imply division. From: Slides for fuzzy sets,, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang
Most Common Types of Fuzzy Sets Triangular MF Slides for fuzzy sets,, J.-s. Roger Jang Trapezoidal MF Gaussian MF Generalized bell MF
Membership functions 1 0.8 0.6 0.4 0.2 0 trapm f gbellm f trim f gaussm f gauss2m f sm f 1 0.8 0.6 0.4 0.2 0 zmf psigmf dsigmf pimf sigmf
MF Formulation Slides for fuzzy sets,, J.-s. Roger Jang Triangular trimf ( x ; x a a, c x b, c ) max min = b a, c b, 0 Trapezoidal MF trapmf ( x ; a, x a b, d x c, d ) max min = b a,, d c, 1 0 Gaussian MF gaussmf ( x ; a, b, c ) = e 1 2 x c σ 2 Generalized bell MF gbellm f ( x ; a, b, c ) = x c 1 + 1 b 2 b
Sigmoidal MF: Extensions: MF: 1 sigmf ( x ; a, b, c ) = ( c ) 1 + e a x Abs. difference of two sig. MF Product of two sig. MF Slides for fuzzy sets,, J.-s. Roger Jang
L-R R MF: LR x c ( ;, α, β ) = F F L R c x x α c β, x <, x c c Example: FL ( x ) = max( 0, 1 x ) 2 FR ( x ) = exp( x ) 3 c=65 a=60 b=10 c=25 a=10 b=40 Slides for fuzzy sets,, J.-s. Roger Jang
Singleton Strictly speaking, a fuzzy set is a collection of ordered pairs A={(x, x,µ (x)) A ))} A single pair (x, x,µ (x)) A )) is called a fuzzy singleton. Thus the whole set can be viewed as the union of its corresponding singletons.
Linguistic Variable متغير زبانشناختی A linguistic variable is variable that takes words or sentences as values The set of values that it can take is called its term set. its term set Each value in the term set is a fuzzy variable defined over a defined over a base variable. Base variable defines the universe of discourse for all the fuzzy variables in the term set
Example Let x be the linguistic variable with the label Temperature Term set={very cold, cold, hot, very hot} Base variable : the scale from -30 to 30 o c Very_cold Very_hot cold hot
Fuzzy Partitioning Partitioning of the base variable with fuzzy sets Fuzzy partitions formed by the linguistic values young, middle aged,, and old
MF Terminology MF 1.5 α 0 Core Crossover points α -cut Support X Slides for fuzzy sets,, J.-s. Roger Jang
Convexity of Fuzzy Sets تحدب A fuzzy set A is convex if for any λ in [0, 1], µ ( λx + ( 1 λ ) x ) min( µ ( x ), µ ( x )) A 1 2 A 1 A 2 Alternatively, A is convex is all its α-cuts are convex. Slides for fuzzy sets,, J.-s. Roger Jang
Set-Theoretic Operations Subset: Complement: Union: Intersection: A B µ A µ B A= X A µ ( x) = 1 µ ( x) C = A B µ ( x) = max( µ ( x), µ ( x)) = µ ( x) µ ( x) c A B A B C = A B µ ( x) = min( µ ( x), µ ( x)) = µ ( x) µ ( x) c A B A B A A Slides for fuzzy sets,, J.-s. Roger Jang
Some set operations, Graphical representation complement Subset Intersection Union Slides for fuzzy sets,, J.-s. Roger Jang
References 1. Lotfi Zadeh short Biographical Sketch Azerbaijan International (2.4) Winter 1994. 2. Lotfi A. Zadeh Biography, university of zaragoza, 1998. 3. Tutorial on Fuzzy Logic,, Jan Jantzen, Technical University of Denmark, Technical report no 98-E E 868, 1999 4. Slides for fuzzy sets,, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang 5. Lecture Notes by A. H. Meghdadi,, soft computing class, Ferdowsi university of Mashhad