1、模糊理論模糊理論Fuzzy Theory淡江大學 資訊管理系所侯永昌教科書:Timothy J.Ross(2004),Fuzzy Logic with Engineering Applications,2nd Edition,John Wiley&Sons,Ltd.新月圖書代理淡江大學 資訊管理系所 侯永昌1Preface Fuzzy logic has come a long way since it was first subjected to technical scrutiny in 1965,when Dr.Lotfi Zadeh published his seminal work
2、 Fuzzy sets in the journal Information and Control.Unfortunately,fuzzy logic did not receive serious notice in this world until the last decade.The attention currently being paid to fuzzy logic is most likely the result of present popular consumer products employing fuzzy logic.淡江大學 資訊管理系所 侯永昌2Prefa
3、ce Over the last several years,the Japanese alone have filed for well over 1000 patents in fuzzy logic technology,and they have already grossed billions of U.S.dollars in the sales of fuzzy logic-based products to consumers the world over.The integration of fuzzy logic with neural networks and genet
4、ic algorithms is now making automated cognitive systems a reality in many disciplines.淡江大學 資訊管理系所 侯永昌3Preface the reasoning power of fuzzy system,when integrated with the learning capabilities of artificial neural networks and genetic algorithms,is responsible for new commercial products and process
5、es.The marketing research firm of Frost&Sullivan projected that fuzzy logic,with an annual growth rate of 20 percent,would be one of the worlds 10 hottest technologies going into the twenty-first century.淡江大學 資訊管理系所 侯永昌4Chapter 1Introduction 淡江大學 資訊管理系所 侯永昌5Uncertainty and Impression 愈複雜的系統,就愈不容易精確的
6、表現淡江大學 資訊管理系所 侯永昌6Uncertainty and Impression Probability theory:研究的是語意清楚,但是行為(outcome)不確定(random)的事件,也就是對於事件的出現與否,完全沒有把握。The occurrences arise by chance 例如:擲骰子、Fuzzy theory:研究的是outcome明確,但是其語意不確定(vagueness,impression)的事件,也就是一個現象是否符合這一個模糊概念,不能只用一個單一的yes or no來回答 例如:高矮、美醜、大小、淡江大學 資訊管理系所 侯永昌7Uncertaint
7、y and Impression Uncertainty in Information:The source of impression is the absence of sharply defined criteria of class membership rather than the presence of random variable.淡江大學 資訊管理系所 侯永昌8Uncertainty and ImpressionBy chance在學校中學的多為理想狀況;而在真實世界中,確定的資料是不多的。Inability to perform adequate measurementL
8、ack of knowledgeFuzziness inherent in our natural language淡江大學 資訊管理系所 侯永昌9Fuzzy logic is most successful in very complex model where understanding is strictly limited or quite judgmental.processes where human reasoning,human perception,or human decision making are inextricably involved.Because:Human
9、 use linguistic variables,rather than quantitative variables to represent imprecise concepts.Human reasoning is based largely on imprecise intuition or judgment,more precision entails higher cost.淡江大學 資訊管理系所 侯永昌10Uncertainty and Impression淡江大學 資訊管理系所 侯永昌11Uncertainty and Impression淡江大學 資訊管理系所 侯永昌12U
10、ncertainty and Impression淡江大學 資訊管理系所 侯永昌13Fuzzy logic is most successful in focusing and image stabilization:Fisher,Sanyo air conditioner:Mitsubishi washing machine:Matsushita subway automatic system controller:Sendai,Hitachi automatic transmission/anti-skid braking system:Nissan golf diagnostic sys
11、tem toaster rice cooker vacuum cleaner pattern recognition and classification:US DOD space docking control:NASA stock-trading portfolio:Japan 淡江大學 資訊管理系所 侯永昌14Fuzzy Set and Membership 針對一個crisp set A:某一個元素x,要就完全屬於集合A,要就完全不屬於集合A 但是對於Fuzzy set A:某一個元素x,是否屬於集合A,is a matter of degree and is relative A(x
12、)0,1 AxAxxA01)(淡江大學 資訊管理系所 侯永昌15Fuzzy Set and Membership 例如:height around 6 feet 多少有點自由心証,但是至少他要滿足:normal、monotonicity、symmetry 淡江大學 資訊管理系所 侯永昌16Fuzzy Set and Membership probability provides knowledge about relative frequencies fuzzy membership function represents similarities of objects to ambiguou
13、s properties 淡江大學 資訊管理系所 侯永昌17Chance versus Ambiguity 例:two persons:1.95%chance of being over 7 feet tall 2.high membership in the set of very tall people 例:two glasses of water:1.95%chance of being healthful and good 2.0.95 membership of being healthful and good Which one will you choose?淡江大學 資訊管理系
14、所 侯永昌18Chance versus Ambiguity The prior probability of 0.95 in each case becomes a posterior probability of 1.0 or 0.0.However,the membership value of 0.95 remains 0.95 after measuring or testing!Fuzziness describes the ambiguity of an event,whereas randomness describes the uncertainty in the occur
15、rence of the event.淡江大學 資訊管理系所 侯永昌19Chance versus Ambiguity 例:口語的不精確性 淡江大學 資訊管理系所 侯永昌20Chance versus Ambiguity 例:213expbabaC淡江大學 資訊管理系所 侯永昌21Chance versus Ambiguity 例:What is the probability of randomly selecting a circle from a bag?fuzziness:above which membership value,say 0.85,we would be willing
16、 to call the shape a circle?randomness:the proportion of the shapes in the bag that have the membership value above the value(0.85)淡江大學 資訊管理系所 侯永昌22Chapter 2Classical Sets and Fuzzy Sets 淡江大學 資訊管理系所 侯永昌23Chance versus Ambiguity Fixed set,random pointFixed point,random set淡江大學 資訊管理系所 侯永昌24Classical S
17、ets Set:a collection of objects all having the same characteristics x A=x belongs to A x A=x does not belong to A Cardinality:The total number of elements in a universe X is called its cardinal number,denoted nx finite infinite 淡江大學 資訊管理系所 侯永昌25Classical Sets whole set:Collection of all elements in
18、the universe empty set():The set containing no element power set(P(X):All possible sets of a universe Example 2.1:X=a,b,c P(X)=,a,b,c,a,b,b,c,a,c,a,b,c np(x)=2nx=23=8淡江大學 資訊管理系所 侯永昌26Operations on Classical Sets A B=A is fully contained in B(if x A,then x B)A B=A is contained in or is equivalent to
19、B A=B=A B and B A Union:A B=x|x A or x B Intersection:A B=x|x A and x B Complement:(or)A=x|x A,x X Difference:|(or-)A|B=x|x A and x B 淡江大學 資訊管理系所 侯永昌27Properties of classical crisp sets Commutativity 交換律交換律 A B=B AA B=B A Associativity 結合律結合律 A (B C)=(A B)C A (B C)=(A B)C Distributivity 分配律分配律 A (B
20、C)=(A B)(A C)A (B C)=(A B)(A C)Idempotency 自身律自身律 A A=AA A=A Involution 反身律反身律(A)=A淡江大學 資訊管理系所 侯永昌28Properties of classical crisp sets Identity 單位元素單位元素 A=A,A=,AX=X,AX=A Transitivity 遞移律遞移律 If A B and B C,then A C Excluded middle laws排中律排中律 Law of the excluded middle A A=X Law of the contradiction A
21、 A=De Morgans laws(A B)=A B(A B)=A B淡江大學 資訊管理系所 侯永昌29Mapping of Classical Sets to Functions If x X corresponds y Y,it is called a mapping from X to Y.or f:X-Y The characteristic function A is defined byA(x)=1,x A =0,x A where A expresses membership in set A for the element x in the universe.This is
22、a mapping :X-Y,where y is 0 or 1淡江大學 資訊管理系所 侯永昌30Mapping of Classical Sets to Functions Example 2-4:A universe with three elements,X=a,b,c A mapping from the elements of the power set of X,i.e.,P(X)=,a,b,c,a,b,a,c,b,c,a,b,c,to a universe,Y=0,1 The value set determined from the mapping are V P(X)=0,0
23、,0,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1 淡江大學 資訊管理系所 侯永昌31Mapping of Classical Sets to Functions 因此我們可以將Set 的運算重新用Function 的形式來表示:UnionAB AB(x)=A(x)B(x)=max(A(x),B(x)IntersectionAB AB(x)=A(x)B(x)=min(A(x),B(x)ComplementAA(x)=1-A(x)ContainmentA BA(x)B(x)where is the max operator and is the min op
24、erator淡江大學 資訊管理系所 侯永昌32Fuzzy Sets A fuzzy set is a set containing elements that have varying degrees of membership in the set-0,1 Fuzzy set can be expressed by the set of pairsA=(x,)|x X or,A=where X is discrete and finite,or)(xA)(xAiiixxxxxx)(.)()(2211淡江大學 資訊管理系所 侯永昌33Fuzzy Sets A=where X is contin
25、uous and infinite 此處之除號,加號或積分符號都不是真正的做數學運算,只是一種方便的表示法 Example:U=a,b,c,d,e,A=圓形物 A=xxA)(edcba02.04.09.01淡江大學 資訊管理系所 侯永昌34Fuzzy Sets Example:U=年齡=0,200 Q=年老=Y=年輕=200505502150001uifuuif200255252125011uifuuif淡江大學 資訊管理系所 侯永昌35Fuzzy Sets Example:A=integer close to 10 =Example:real number close to 10 A=(x,
26、)|=1+(x-10)2-1 =)(xA)(xARxx21011131.0125.0118.010198.085.071.0淡江大學 資訊管理系所 侯永昌36Fuzzy Sets Example:Vertical line =if|tan|1=0 otherwise Example:Straight line =if r a =0 otherwise)(xAFear)1(Fe|tan1|1)(xA淡江大學 資訊管理系所 侯永昌37Fuzzy Sets Example:Circles =r/R,or=4A/L2,or=where)(xC1111Feniiarannrai淡江大學 資訊管理系所 侯
27、永昌38Fuzzy Set Operations The fuzzy set operations for A,B,and C on the universe X.UnionAB(x)=A(x)B(x)IntersectionAB(x)=A(x)B(x)ComplementA(x)=1-A(x)淡江大學 資訊管理系所 侯永昌39Fuzzy Set Operations 淡江大學 資訊管理系所 侯永昌40Fuzzy Set Operations Any fuzzy set A defined on a universe X is a subset of X,因此 A X=A(x)X(x)1 Fo
28、r all x X,empty set,(x)=0,whole set,X(x)=1 Based on the fact that all fuzzy sets can be overlap,the cardinality of the fuzzy power set is always infinite;that is,nP(X)=,no matter the cardinality of X is finite or not 淡江大學 資訊管理系所 侯永昌41Properties of Fuzzy Sets Fuzzy sets follow the same properties as
29、crisp sets,such as:Commutativity 交換律 A B=B AA B=B A Associativity 結合律 A (B C)=(A B)C A (B C)=(A B)C Distributivity 分配律 A (B C)=(A B)(A C)A (B C)=(A B)(A C)淡江大學 資訊管理系所 侯永昌42Properties of Fuzzy Sets Idempotency 自身律 A A=AA A=A Identity 單位元素 A =AA =A X=XA X=A Transitivity 遞移律 If A B and B C,then A C Inv
30、olution 反身律 (A)=A淡江大學 資訊管理系所 侯永昌43Properties of Fuzzy Sets DeMorgans laws for classical sets also hold for fuzzy sets,(A B)=A B(A B)=A B But the excluded middle laws do not hold for fuzzy sets;that is,A A X A A 淡江大學 資訊管理系所 侯永昌44Properties of Fuzzy Sets淡江大學 資訊管理系所 侯永昌45淡江大學 資訊管理系所 侯永昌46Sets as Points
31、 in Hypercubes 淡江大學 資訊管理系所 侯永昌47Sets as Points in Hypercubes 頂點即代表 Crisp set 之 characteristic value,因此其集合即代表 Power set。而中間之點即代表Fuzzy set 之 membership value,而中間之點有無限多個,因此其 Power set 之 cardinality 為 infinite 中間是代表最 Fuzzy 的一點,愈靠兩邊愈可以清楚的區分淡江大學 資訊管理系所 侯永昌48Sets as Points in Hypercubes The centroids of ea
32、ch of the diagrams in Fig.2.25 represent single points where the membership value for each element in the universe equals 1/2.This midpoint in each of the three figures is a special point-it is the set of maximum fuzziness“A membership value of 1/2 indicates that the element belongs to the fuzzy set
33、s as much as it does not.In a geometric sense,this point is the location in the space that is farthest from any of the vertices and yet equidistant from all of them.淡江大學 資訊管理系所 侯永昌49Summary In this chapter,we introduce:basic definitions,properties,and operations on crisp sets and fuzzy sets the diff
34、erence of set membership between crisp and fuzzy sets is an infinite-valued as opposed to a binary-valued quantity the basic axioms not common to both crisp and fuzzy sets are the two excluded middle laws the idea that crisp sets are special forms of fuzzy sets was illustrated graphically as geometr
35、ic points 淡江大學 資訊管理系所 侯永昌50Chapter 3Classical Relations and Fuzzy Relations 淡江大學 資訊管理系所 侯永昌51Relations Relations are intimately involved in logic,approximate reasoning,rule-based systems,nonlinear simulation,classification,pattern recognition,and control.There are only two degrees of relationship be
36、tween elements of the sets in a crisp relation:completely related and not related,in a binary sense.However,fuzzy relations describe the relationship between elements of two or more sets to take on an infinite number of degrees of relationship between the extremes of completely related and not relat
37、ed.淡江大學 資訊管理系所 侯永昌52Cartesian Product For crisp sets A1,A2,.Ar,the set of all r-tuples(a1,a2,a3,.ar),where a1 A1,a2 A2,.,and ar Ar,is called the Cartesian product of A1,A2,.Ar,and is denoted by A1 A2 .Ar.When all the Ar are identical and equal to A,the Cartesian product A1 A2 .Ar can be denoted as A
38、r.Cartesian product is a means of producing ordered relationships among sets淡江大學 資訊管理系所 侯永昌53Cartesian Product Example 3.1 A=0,1,B=a,b,c A B=(0,a),(0,b),(0,c),(1,a),(1,b),(1,c)B A=(a,0),(a,1),(b,0),(b,1),(c,0),(c,1)A A=A2=(0,0),(0,1),(1,0),(1,1)B B=B2=(a,a),(a,b),(a,c),(b,a),(b,b),(b,c),(c,a),(c,b),
39、(c,c)淡江大學 資訊管理系所 侯永昌54Crisp Relations The Cartesian product of two universes X and Y is determined asX Y=(x,y)|x X,y Y which forms an ordered pair of every x X with every y Y,forming unconstrained matches between X and Y.That is,every element in universe X is related completely to every element in u
40、niverse Y.淡江大學 資訊管理系所 侯永昌55Crisp Relations When the matches between elements of two universes are constrained on only part of elements of two universes are related,we call a binary relation R from X to Y.R(x,y)=1,(x,y)R complete relationship=0,(x,y)R no relationship r-nary relation can be represente
41、d by an r-dimensional relation matrix.淡江大學 資訊管理系所 侯永昌56Crisp Relations Example:X=1,2,3,Y=a,b,c X Y=(1,a),(1,b),(1,c),(2,a),(2,b),(2,c),(3,a),(3,b),(3,c)XY1a R=2b3c Example:R=(1,a),(2,b),R X Y111111111321cba淡江大學 資訊管理系所 侯永昌57Crisp Relations Example:A=0,1,2 identity relation IA=universal(complete)relat
42、ion EA=null relation OA=100010001111111111000000000淡江大學 資訊管理系所 侯永昌58Crisp Relations Example 3.3 R=(x,y)|y 2x,x X,y Y R(x,y)=1,if y 2x=0,if y RS(x,y)RS(x,y)=max(R(x,y),S(x,y)IntersectionRS-RS(x,y)RS(x,y)=min(R(x,y),S(x,y)ComplementR-R(x,y)=1-R(x,y)Containment R S-R(x,y)S(x,y)Identity(O and X E)淡江大學 資
43、訊管理系所 侯永昌61Properties of Crisp Relations The properties of commutativity,associativity,distributivity,involution,idempotency,De Morgans laws,and the excluded middle laws all hold for crisp relations just as they do for classical set operations.淡江大學 資訊管理系所 侯永昌62Composition If R:X-Y,and S:Y-Z Whether
44、we can find a relation T:X-Z?YES!The max-min composition is defined by T=R S T(x,z)=yY(R(x,y)S(y,z)The max-product composition is defined byT=R ST(x,z)=yY(R(x,y)S(y,z)淡江大學 資訊管理系所 侯永昌63Composition Example 3.4:max-min T(x1,z1)=maxmin(1,0),min(0,0),min(1,0),min(0,0)=0T(x1,z2)=maxmin(1,1),min(0,0),min(1
45、,1),min(0,0)=100001000100010000010000101321214321213214321xxxzzTyyyyzzSxxxyyyyR淡江大學 資訊管理系所 侯永昌64Composition Example 3.4:max-minX1X2X3Y1Y2Y3Y4Z1Z2淡江大學 資訊管理系所 侯永昌65Fuzzy Relations A fuzzy relation R is a mapping from the Cartesian space X Y to the interval 0,1,where the strength of the mapping is expr
46、essed by the membership function of the relation for ordered pairs from the two universes.Since the cardinality of fuzzy sets on any universe is infinity,the cardinality of a fuzzy relation between two or more universes is also infinity.淡江大學 資訊管理系所 侯永昌66Operations on Fuzzy Relations Let R and S be f
47、uzzy relations on the Cartesian space X Y UnionRS-RS(x,y)RS(x,y)=max(R(x,y),S(x,y)IntersectionRS-RS(x,y)RS(x,y)=min(R(x,y),S(x,y)ComplementR-R(x,y)=1-R(x,y)Containment R S-R(x,y)S(x,y)淡江大學 資訊管理系所 侯永昌67Properties of Fuzzy Relations The properties of commutativity,associativity,distributivity,involuti
48、on,idempotency,and De Morgans laws hold for fuzzy relations just as they do for crisp relations.However,the excluded middle laws does not hold.R R E,where E:complete relation R R O,O:null relation淡江大學 資訊管理系所 侯永昌68Fuzzy Cartesian Product and Composition Fuzzy Cartesian product and composition can be
49、defined just as they are for crisp relations.R=A B X Y R(x,y)=A B(x,y)=min(A(x),B(y)T=R S The max-min composition is defined by T(x,z)=yY(R(x,y)S(y,z)The max-product composition is defined by T(x,z)=yY(R(x,y)S(y,z)It should be pointed out that neither crisp nor fuzzy compositions have converses in g
50、eneral;that is,R S S R 淡江大學 資訊管理系所 侯永昌69Fuzzy Cartesian Product Example 3.5 X=x1,x2,x3 :代表三種溫度 Y=y1,y2 :代表兩種壓力 A:代表周圍的溫度=B:代表周圍的氣壓=R=A B=32115.02.0 xxx219.03.0yy9.05.02.03.03.02.09.03.015.02.0淡江大學 資訊管理系所 侯永昌70Fuzzy Composition Example 3.6 T(x1,z1)=maxmin(0.7,0.9),min(0.5,0.1)=0.7T(x2,z2)=max(0.8*0.6