Applications of in Decision Making

Amira Suliman Haron Ibrahim

B.Ed.(Honor) in Mathematics and physics, University of Gezira (2011) Post graduate Diploma in Mathematical ,University of Gezira (2013)

A Dissertation

Submitted to the University of Gezira in Partial Fulfillment of the Requirements for the Award of the Degree of Master of Science in

Mathematics

Department of Mathematics

Faculty of Mathematical and Computer Sciences

February / 2015

1 2

Declaration

This is to certify that I was completed my research by my self ,my effort and using references , without taking any information from others .This research was taken under supervision of my advisors.

Name: Amira suliman Haron

3 iii

DEDICATION

To My father The light that illuminates the path of success.

To My mother(Aziza) Which provide me with tenderness and love .

To My brothers AND My sister.

iv

4

ACKNOWLEDMENT

First thank to Allah for giving me the ability to do this work .I would like to thank my main supervisor Dr. Abdulla Habila for his advise and did not stingy any information for me . Thank to the Co. supervisor Uz. Bakhit Osman Bakhit and all the staff in the faculty of Mathematical and computer sciences .I grateful to every one who helped me in preparing this study. Thanks to my family for their help and support.

v

5 Applications of Fuzzy Logic in Decision Making Amira Suliman Haron Ibrahim Abstract

Logic is a small part of the human thinking capability. It's can help us to organize words and make a clear sentences. From this perspective, it is clear that fuzzy logic is a method to formalize the human capability of imprecise thinking and it is a generalization of classical logic. It is considered a form multi-values logic derived from the theory. The fuzzy logic introduced in 1965 by the Iranian scholar Lotfi Zadeh, and it allows the definition of the intermediate values between the conventional evaluations like true/false. The fuzzy logic focuses on inferences through indefinite expressions and lingual pronunciations; therefore it solves the marginality problem. The scientific purpose of the fuzzy logic is to solve the problem of the representation of the approximate or indefinite information and to provide the required instrument to utilize knowledge and human expertise. The fuzzy logic importance is represented by its ability to deal with unclear information and controlling unstable systems which assists in finding solutions for many of the problems in engineering applications that cannot be solved by the classical logic. That will be done by attributing the variable degree from the real field [0,1] instead of {0,1}. The concept of the fuzzy set is considered one of the supportive principles in studying the fuzzy logic. Also, one of the important concepts is the fuzzy relations and the base. It has many applications in our work lives, most of which we find in things like artificial intelligence or the advanced electronic devices. In this research it has been applied in medical diagnosis and the decision making process will be presented. As the concept of fuzzy rule base was utilized in the diagnosis of diseases because it contributes in organizing inferences when facts are not precise which assists doctors in determining the amount of the appropriate drug dose. Although the symptoms that the patients reports like high body temperature, high blood pressure cannot be taken by fuzzy values because the patient may exaggerate them in accordance with his/her feelings , however the analysis results are in most cases fuzzy. The values of investigation results are into logical equations to obtain fuzzy results. Fuzzy logic has also contributed in the decision making process by enabling individuals to take the optimal decision in issues characterized by ambiguity. It has effective results in linear programming. Two problems which cannot be directly solved by classical linear programming were solved. This shows its preference over the classical logic in engineering applications and in day-to-day life. It has other usages like whether identification, taking fair decision in competitions, in some electronic home appliances such as electric washing logic machines, ventilation, etc. The study recommends more concern with further studying fuzzy and striving for its development and expanding its usages.

vi

6

تطبيقات المنطق الضبابي في صنع القرار أميرة سليمان هارون إبراهيم ملخص الدراسة المنطق هو جزء صغير من قدرة اإلنسان على التفكير. إنه يمكن أن يساعدنا في تنظيم الكلمات لجعللا الجمللا ةا للضح. ةا لل مللن هلللا المنظللور المنطللق الضللءااي هللو ري للح إل للفاء الطللاا الرسللمي علللى قللدرة اإلنسللان علللى التفكيللر ديللر الللدقيق ةهللو تعملليم للمنطللق الك سلليكي. ةيعتءللر صورة لمنطق ال يم المتعددة المشت ح من نظريح المجموع الضءاايح. ةقد الدأ المنطلق الضلءااي فلي عللا 1965 مللن قءللا العللالم اإليرانللي لطفللي يادة ةأنلله يسللم اتعريلل ال لليم المتوسللطح اللين ال لليم الت ليديح مثا صضي /خا ئ. ةيركز المنطق الضءااي على االستنتاج من خل التعلااير ةافلفلا اللغويح دير المضددة، لللك يعالج مشكلح الضديح، إن الغرض العلمي من المنطق الضءااي هلو للا مشللكلح تمثيللا المعلومللات الت ريءيللح أة ديللر المضللددة ةتللوفير اتليللح ال يمللح السللت دا المعللار ةال ءرات الءشريح. تتمثلا أهميتله فلي قدرتله عللى التعاملا مل المعلوملات الغامضلح ةاللتضكم فلي افنظمح دير المست رة، مما ساعد في إيجاد الضلو لكثير من المسائا في التطءي ات الهندسيح التي ال يمكن للها االمنطق الك سيكي ةذلك اإسناد درجح المتغير من المجا الض ي لي [1,0 ]الدال ملن {0,1} .يعللد مفهللو المجموعللح العائمللح مللن افسلل الداعمللح فللي دراسللح المنطللق الضللءااي ةمللن المفاهيم المهمح أيضا الع قلات الضلءاايح ةأسلال ال اعلدة الضلءاايح. لله العديلد ملن التطءي لات فلي لياتنللا العمليللح يالتللي ادلءهللا نجللدء فللي افكللياء مثللا اللللكاء االصللطناعي أة افجهللزة اإللكترةنيللح المت دمح .في هلا الءضث ُءق في التش يص الطءي ةعمليح ات اذ ال رار يليث تم است دا مفهلو أسال ال اعدة الضلءاايح فلي تشل يص افملراض ةذللك فنله يسلهم فلي تنظليم االسلتنتاجات عنلدما تكون الض ائق دير مضءو ح مما يساعد الطءيب في تضديلد م لدار جرعلح اللدةاء المناسلءح الالردم ملن أن افعلراض التلي يللكرها الملريل مثلا درجلح للرارة الجسلم. لغي اللد ال يمكلن أخللها اال يم الضءاايح فن المريل قد يءالغ فيها لسب كعورء إال أن نتائج التضاليا هلي أليانلا لءاايح. ةيتم إدخا قيم الفضوصات من معادالت منط يح للضصو على نتائج ءاايح. ةقلد سلاهم أيضلا في عمليح ات اذ ال رار اتمكين اففراد من ات اذ الضا افمثا في المسلائا التلي يعتريهلا الغملوض. ةله نتائج فعالح في الءرمجح ال طيح ةتم لا مسألتين ال يمكن للهما االءرمجح ال طيلح الك سليكيح مءاكرة، مما أ هر أفضليته على المنطق العادي في التطءي ات الهندسيح ةفلي الضيلاة اليوميلح. ةلله اسلت دامات أخللرث مثللا تضديللد الط لل ي ات للاذ ال للرار العللاد فللي المسللاا اتي فللي اعللل افجهللزة اإللكترةنيللح المنزليللح مثللا الغسللاالت الكهرايللح ةالتكييلل .. الللة. توصللي الدراسللح ااالهتمللا أكثللر ادراسته ةالسعي في تطويرء ةتوسي است داماته .

vi

7 Table of Contents Chapter One Fuzzy set 1.1 Introduction…………………………………………..…1 1.2 Classical set Theory ………………………………….....1 1.3 Fuzzy Set Theory…………………………………….….4 1.4 Properties of fuzzy set operation……………….……...10 Chapter Two Fuzzy Logic 2.1 Classical Logic…………………………………….……19 2.2 Fuzzy Logic……………………………………..……….25 2.3 Fuzzy Logic and Approximate reasoning………….…...29 2.4 Fuzzy Relation…………………………………….…….33 Chapter Three Fuzzy Rule Base 3.1 Rules…………………………………………………...39 3.2 Inference and Knowledge Representation…………....41 3.3 Structure of Fuzzy Rule Base………………….……..48 Chapter Four Some applications of Fuzzy Logic 4.1 Introduction…………………………………...... 54 4.2 Health Monitoring Fuzzy Diagnostic System…...... 54 4.3 Fuzzy Decision Making………………………..…….60 Chapter Five Conclusion and Recommendations…………...…………..73

vii

8 List of Tables Chapter One Fuzzy set Table 1.1 Properties of Classical Set Operation …..……..... 2 Chapter Two Fuzzy Logic Table 2.1 Boolean Operations……………………………..21 Table 2.2 Properties of the Boolean Algebra…………...….22 Table 2.3 A Three – valued logic…………………………...24 Chapter Three Fuzzy Rule Base Table 3.1 Interpretation of Fuzzy IF-THEN Rules………...50

viii

9 List of Figures Chapter One

Figure 1.1 Fuzzy sets representing" young" and "very young"……………....6

Figure 1.2 A membership function for a positive and large real number….7 Figure 1.3 Subset…………………………..……………………………...…12 Figure 1.4 Two membership functions……………………………………...13 Figure 1.5 The -cut of the membership function

 (x) Sx …………………....14 Figure 1.6 The resulting membership function of Example 1.4…..…….15 Figure 1.7 Two membership functions for example 1.6…………………..17 Figure 1.8 The resulting membership function of Example 1.6…………..18 Chapter Two Fig 2.1 Linguistic variable "Age"…………………………………………28 Chapter Four Figure 4.1Definitions and membership functions of body temperatures, blood pressure and heart rate………………………………………....60 Figure 4.2 Fuzzy goal and constraint………………………………...64

10 ix Chapter One Fuzzy Set Theory

1.1 Introduction The classical set theory is built on the fundamental concept of “set” of which an individual is either a member or not a member. A sharp, crisp, and unambiguous distinction exists between a member and a nonmember for any well-defined “set” of entities in this theory, and there is a very precise and clear boundary to indicate if an entity belongs to the set. In other words, when one asks the question “Is this entity a member of that set?” The answer is either “yes” or “no.” This is true for both the deterministic and the stochastic cases. Many real-world application problems cannot be described and handled by the classical set theory. In order to introduce the concept of fuzzy sets, we first review the elementary set theory of classical mathematics. 1.2 Classical Set Theory, 1.2.1 Fundamental Concepts Let S be a nonempty set, called the universe set below, consisting of all the possible elements of concern in a particular context. Each of these elements is called a member, or an element, of S. A union of several (finite or infinite) members of S is called a subset of S. To indicate that a member s of S belongs to a subset S of S, we write s  S.

If s is not a member of S, we write s ∉ S. To indicate that S is a subset of S, we write S S. The difference of two subsets A and B is defined by

A B = { c | c A and c ∉B }.

In particular, if A = S is the universe set, then S B is called the

11 complement of B, and is denoted by B i.e., = S B. Obviously,

= B, = , and  S. Let r R be a real number and A be a subset of R. Then the multiplication of r and A is defined to be r A = { r a | a A }. The union of two subsets A and B is defined by A ∪B = B∪ A = { c | c A or c B }. Thus, we always have A ∪ = S, A∪ A, and A ∪ = S. The intersection of two subsets A and B is defined by A∩B = B∩A = { c | c A and c B }. Obviously, A∩S = A, A∩= , and A ∩ = . Two subsets A and B are said to be disjoint if A ∩B = . Basic properties of the classical set theory are summarized in Table 1.1, where A ⊆S and B ⊆ Table 1.1 Properties of Classical Set Operation

Involutive law A  A Commutative law A  B = B  A A  B = B  A Associative law (A  B)  C = A  (B  C) (A  B)  C = A  (B  C) Distributive law A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C)

12 A  A = A A  A = A A  (A  B) = A A  (A  B) = A

A  (A  B)  A  B A  (A  B)  A  B A  S  S A   

A   A A  S  A A  A  

A  B  A  B De Morgan’s law A  B  A  B 1.2.2 Classical Set Theory Formulated in Terms of Characteristic Functions One way of defining a set A is in terms of its characteristic function

μA(x). A point x belongs to set A if and only if μA(x)=1. A characteristic function is a function from some universal set U to the binary set {0,1}. The set operations of union, intersection and complementation are defined in terms of characteristic functions as follows.

 Union:

μA∪B(x) = max(μA(x),μB(x))  Intersection:

μA∩B(x) = min(μA(x),μB(x))

 Complement:

µ notA(x) = 1-μA(x)

13 1.3 Fuzzy set theory The concept of a Fuzzy Set is well established as an important and practical construct for modeling. Moreover, Zadeh's formulation makes one realize how artificial is the classical black-white formulation of Aristotelian logic (Is A or Is Not-A). The purpose of the material here is to present the mathematical structure of the concept of Fuzzy Set. This generalization is achieved by way of the concept of the characteristic function for a set.

1.3.1 A Fuzzy Set as a Generalization of a Regular (Crisp) Set

As indicated above a characteristic function is a mapping from the universal set U to the set {0,1}. A fuzzy set is defined in terms of a membership function which is a mapping from the universal set U to the interval [0,1]. A characteristic function is a special case of a membership function and a regular set is a special case of a fuzzy set. Thus the concept of a fuzzy set is a natural generalization of the concept of standard set theory. Fuzzy sets model the gradual change in the membership degree seen in the many real world predicates like tall, warm Etc… 1.3.1.1 Expression for Fuzzy set

Membership function µA in crisp set maps whole in members universal set X to set {0,1}.

µA : X →{0, 1}. Definition (Membership function of fuzzy set) In fuzzy sets, each elements is mapped to [0,1] by membership function.

µA : X →[0, 1] where [0,1] means real numbers between 0 and 1 (including 0,1). Consequently, fuzzy set is ‘vague boundary set’ comparing with crisp set.

14 Example 1.1 Consider fuzzy set ‘two or so’. In this instance, universal set X are the positive real number. X = {1, 2, 3, 4, 5, 6, ….} Membership function for A =’two or so’ in this universal set X is given as follows:

µA(1) = 0, µA(2) = 1, µA(3) = 0.5, µA(4) = 0… Usually, if elements are discrete as the above, it is possible to have membership degree or grade as A = {(2, 1.0), (3, 0.5)} or A = 1.0/2 + 0.5/3 be sure to notice that the symbol ‘+’ implies not addition but union. More generally, we use

A = {(x, µA(x))} Or A= Suppose elements are continuous, then the set can be represented as follows:

A = µA (x ) /x . For the discrimination of fuzzy set with crisp set, the symbol is frequently used. Example 1.2 We consider statement "Jenny is young". At this time, the term "young" is vague. To represent the meaning of "vague" exactly, it would be necessary to define its membership function as in Fig 1.1. When we refer "young", there might be age which lies in the range [0,80] and we can account these "young age" in these scope as a continuous set. The horizontal axis shows age and the vertical one means the numerical

15 value of membership function. The line shows possibility (value of membership function) of being contained in the fuzzy set "young". For example, if we follow the definition of "young" as in the figure, ten year-old boy may well be young. So the possibility for the "age ten” to join the fuzzy set of "young is 1. Also that of "age twenty seven" is 0.9. But we might not say young to a person who is over sixty and the possibility of this case is 0. Now we can manipulate our last sentence to "Jenny is very young". In order to be included in the set of "very young", the age should be lowered and let us think the line is moved leftward as in the figure. If we define fuzzy set as such, only the person who is under forty years old can be included in the set of "very young". Now the possibility of twenty-seven year old man to be included in this set is 0.5. That is, if we denote A= "young" and B="very young",

µA(27) = 0.9 ,µB (27) = 0.5 .

Figure 1.1 Fuzzy sets representing" young" and "very young"

The fuzzy set theory is taking the same logical approach as what people have been doing with the classical set theory: in the classical set theory, as soon as the two-valued characteristic function has been defined and adopted, rigorous mathematics follows; in the fuzzy set case, as soon as a

16 multi-valued characteristic function (the membership function) has been chosen and fixed A fuzzy subset thus consists of two components: a subset and a membership function associated with it. This is different from the classical set theory, where all sets and subsets share the same (and the unique) membership function: the two-valued characteristic function mentioned above. Example 1.3. Let S be the (universe) set of all real numbers, and let

Sf = { s  S | s is positive and large }.

This subset, Sf, is not well-defined in the classical set theory because, although the statement “s is positive” is precise, the statement “s is large” is vague. However, if we introduce a membership function that is reasonable and meaningful for a particular application for the characterization or measure of the property “large,” say the one shown in Figure 1.2 quantified by the function

0 if s  0,  (s)  S f  s 1 e if s  0, then the fuzzy subset Sf, associated with this membership function μSf(s), is well defined. Similarly, a membership function for the subset

Figure 1.2 A membership function for a positive and large real number

17 1.3.2 Fuzzy Set Operations A fuzzy set operation is an operation on fuzzy set. These operations are generalization of crisp set operations. There is more than one possible generalization. The most widely used operations are called standard fuzzy set operations. There are three operations: fuzzy complements ,fuzzy intersections , and fuzzy unions. 1.3.2.1 Standard fuzzy set operations Let A and B be fuzzy sets that A,B ∈ U, u is an element in the U universe. Standard complement  (u) 1  (u) A A Standard intersection

AB (u)  min{A (u), B (u)} Standard union

AB (u)  max{A (u), B (u)} 1.3.2.1.1 Fuzzy complements A(x) is defined as the degree to which x belongs to A. Let cA denote a fuzzy complement of A of type c. Then cA(x) is the degree to which x belongs to cA, and the degree to which x does not belong to A. (A(x) is therefore the degree to which x does not belong to cA.) Let a complement cA be defined by a function c : [0,1] → [0,1] c(A(x)) = cA(x) 1.3.2.1.2 Fuzzy intersections The intersection of two fuzzy sets A and B is specified in general by a binary operation on the unit interval, a function of the form i:[0,1]×[0,1] → [0,1]. (A ∩ B)(x) = i[A(x), B(x)] for all x.

18 1.3.2.1.3 Fuzzy unions The union of two fuzzy sets A and B is specified in general by a binary operation on the unit interval function of the form u:[0,1]×[0,1] → [0,1]. (A ∪ B)(x) = u[A(x), B(x)] for all x 1.3.2.2 Theoretic operations for Fuzzy sets: The operations with fuzzy sets are defined via the membership function 1.3.2.2.1 Intersection

The membership function µc(x) of the intersection c=A B is point wise defined by µc(x) =Min[µA(x), µB(x)] xX. 1.3.2.2.2 Union Membership value of member X in the unions takes the greater value of membership between A and B µ A ∪ B (x) =Max[µA(x), µB(x)] xX . 1.3.2.2.3 Complement

The membership function µA(x) of the complement of a fuzzy set A

, (x) is defined by (x) =1- µA(x) xX.

19 1.4 properties of fuzzy sets operation 1.4.1 Basic properties of fuzzy sets operation

In the analysis below let µA, µB and µC be the membership functions for the fuzzy sets A, B, and C respectively. Furthermore, for any element of the universal set p, x = µA(p), y = µB(p), and z = µC(p). The associativity and commutativity of fuzzy set union and intersection follow from the definition and the associativity and commutativity of the maximum and minimum functions; i.e., max(x,max(y,z)) = max(max(x,y),z) min(x,min(y,z)) = min(min(x,y),z) The distributivity properties also follow from properties of the maximum and minimum functions but the proof is a bit longer. The right-hand side of the first distributivity relation is (A ∩ B) ∪ (A ∩ C) which for fuzzy sets involves the evaluation of w= max(min(x,y),min(x,z)). If x is less either y or z then w = x. If x is between y

20 1.4.1.1 α-Cut Set

Definition (-cut set) The α -cut set A is made up of members whose membership is not less than .

A = {x  X | µA(x)  } note that  is arbitrary. This -cut set is a crisp set . Example 1.3 The -cut set is derived from fuzzy set “young” by giving 0.2 to 

Young0.2 = {12, 25, 35, 45} this means “the age that we can say youth with possibility not less than 0.2”.

If =0.4, Young0.4 = {25, 35, 45}

If =0.8, Young0.8 = {25, 35}. 1.4.2 Subset of fuzzy set Suppose there are two fuzzy sets A and B. When their degrees of membership are same, we say “A and B are equivalent”. That is,

A=B iff µA(x) = µB(x), x  X If the following relation is satisfied in the fuzzy set A and B, A is a subset of B(Fig 1.3).

µA(x) ≤ µB(x), x  X This relation is expressed as A  B. We call that A is a subset of B. In addition, if the next relation holds, A is a proper subset of B.

µA(x) < µB(x), x  X

21

Fig1. 3. Subset

1.4.3 Fuzzy Numbers and Their Arithmetic For a normal fuzzy subset, where the membership function is convex and achieves the maximum number 1 with a convex fuzzy subset, if its weak α-cut (α level-set) is a closed interval, then it is called a fuzzy number. Hence, a fuzzy number is a convex fuzzy subset, which has a normalized membership function and represents an interval of confidence. For the arithmetic of fuzzy numbers, there is a general rule.

The General Rule. Let S~x and S ~y be two fuzzy subsets of the universe set S, Z R , and consider a two-variable extended function

F: Sx × Sx → Z.

Let S~ be the image of F, which is a fuzzy subset of Z, and  (x) , z S~x

 (y)and  (z) be the associate membership functions. Given  (x) S~y Sz S~x and  (y), we define S~y

 (z)  { (x)   (y)} Sz sup Sx S y zF (x,y)

22 The reason for choosing the smaller value in this definition is that when one has two different degrees of confidence about two events, then the confidence about both events together is lower. Using the α-cut notation, this is equivalent to the following:

(S ) ~  F((S ) ~ ,(S ) ~ ) z  x  y   {z  S z / z  F(x, y), x (S x )~ , y (S y )~ } Now, given two fuzzy numbers and , which are two normal and convex fuzzy subsets S~ and S ~ with membership functions  and x y S~x

 respectively, consider a two-variable function S ~y F: X × Y → Z defined by z = F(x,y), x , y , via the general operation rule. We only discuss the fuzzy number arithmetic for addition, subtraction and multiplication operations. (1) Addition Let z=F(x,y) = x+y = { z Z | z = x + y, x  , y  }

and  (z)  { (x)   (y)} Sz sup Sx S y zx y In the α-cut notation:

(Sz )  (Sx )  (Sy ) Example 1.4. Let ~x and ~y be such that = [–5,1], = [–5,12],

Figure 1.4 Two membership functions

23 x 5   5  x  2, 3 3  S (x)   x x 1   ,  2  x  1,  3 3 and  0  5  y  3,   y 3  (y)    3  y  4, S y  7 7  y 12   4  y  12,  8 8

Then, by the general operation rule we have

S z  S x  S y  [5,1][5,12]  [10,13] and, by comparing  (x) and  (y) point wise, we obtain Sx S y

 (z)  { (x)   (y)} Sz sup Sx S y zx y

 0, 10  z  8,   z 8    ,  8  z  2, 10 10  z 13   , 2  z  13.  11 11

 (x) Figure 1.5 The -cut of the membership function Sx

(S x )  [3  5,3 1] (S~y )  [7  3,8 12],

24 So that

(S z )~  (S~x )~  (S ~y )~  [10 8,11 13]

Setting z1 = 10 - 8 and z2 = -11+ 13 gives  = z1/10 + 8/10 and

=-z2/11+12/11, which yield the membership function| shown in Figure

1.4 . Taking S z  [10,13]into account, we finally arrive at

 0, 10  z  8,   z 8  (z)   ,  8  z  2, S~z  10 10  z 13   , 2  z  13.  11 11

Figure 1.6 The resulting membership function of Example 1.4

(2)Subtraction. Let z = F(x, y) = x – y. Then ~z  ~x  ~y with

S~z  {z  Z | z  x  y, x  S~x , y  S~y }

and  (z)  { (x)   (y)}. S~z sup S~z S y zxy

In the -cut notation:

(S z )~  F((S~x )~ ,(S ~y )~ )  (S~x )~  (S ~y )~ Example 1.5. Let ~x and ~y be such that

S~x  [0,20], S~y [0,10],

25 With the membership functions

0, 0  x  7,  x  1, 7  x  14, 7  S~ (x)   z x 19   , 14  x  19,  5 5  0, 19  x  20 and

 0, 0  y  3,   y 3  (x)   , 3  y  5, S ~y  2 2  y   2, 5  y  10,  5 Then we have, via the interval arithmetic

S ~z  S~x  S ~y  [10,20], With 0, 10  z  3,  z 3    3  z  9, 12 12  S (z)   z z 16   9  z  16,  7 7  0, 16  z  20. (2) Multiplication. Let z = F(x, y) = x. y. then ~z  ~x.~y with

S~z  {z  Z | z  xy, x  S~x , y  S ~y } and

  (z)  sup{ ~ (x)   ~ (y)} S ~z Sx S y zx.y

In the -cut notation:

(S~z )~  F((S~x )~ ,(S ~y )~ )  (S~x )~ .(S ~y )~ Example 1.6. let ~x and ~y be such that

S~x  [2,5], S ~y  [3,6],

26

With membership functions

Figure 1.7 Two membership functions for example 1.6

x  2, 2  x  3,  S (x)   x 5 x   , 3  x  5,  2 2 and  y 3   , 3  y  5,  (y)  Sx 2 2  y  6, 5  y  6, and shown in Figure 1.7 in the -cut notation, for any  value, letting x 5  = x – 2 and     2 2 gives x1 =  + 2 and x2 = -2 + 5, so that

(S x )  [  2, 2  5] Similarly

(S ~y )  [2  3,  6] It then follows that

S~z  [6,30]

27 and

(S~z )  (S~x ) .(S ~y )  [  2,2  5].[2  3,  6]  [ p(), p()],

Where p()  min{2 2  7  6, 2  4 12,4 2  4 15,2 2 17  30},

p()  max{2 2  7  6, 2  4 12,4 2  4 15,,2 2 17  30},

Hence, p()  2 2  7  6 , and p()  2 2 17  30 , so that

(S~z )  [ p(), p()]

 [2 2  7  6,2 2 17  30].

Let, moreover, z  2 2  7  6, 1 2 z2  2 17  30,

We solve them for , subject to ≤  ≤1,and obtain

 7  1 8z  6  z  15,  4  S (z)   z 17  49  8z  15  z  30,  4

Figure 1.8 The resulting membership function of Example 1.6

28 Chapter two Fuzzy Logic 2.1 Classical Logic In classical logic, a simple proposition p is a linguistic statement contained a universe of element ,say x that can be identified as being a collection of elements in x, which are strictly true or strictly false . The veracity (truth)of an element in the proposition p can be assigned a binary truth value, called T(p) . Just as an element in a universe is assigned a binary quantity to measure its membership in a particular set .For binary (Boolean)classical logic T(p) is assigned a value of 1(truth) or 0(false). In logic we need to postulate the boundary conditions of truth value Justas we do for sets ; that is, in function _theoretic terms, we need to define the truth value of a universe Y of discourse .For a universe Y and the null set. We define the following truth values: T(y)=1 and T()=0 . 2.1.1 (Proposition) As in our ordinary informal language, “sentence” is used in the logic. Especially, a sentence having only “true (1)” or “false (0)” as its truth value is called “proposition”. Example 2.1. The followings are not propositions. He hits 5 home runs in one season. x + 5 = 0 x + y = z In the first example, we do not know who is “He” and thus cannot determine whether the sentence is true (1) or false (0). If “He” is replaced by “Tom”, we have Tom hits 5 home runs in one season.

2.1.2 Logic Function

29 The “logic function” is a combination of propositional variables by using connectives. Values of the logic function can be evaluated according to the values of propositional variables and the truth values of connectives. As we know, a logic function having only one propositional variable has two kinds of values: true and false. A logic function containing two variables has 4 (=22) different combination s of values:(true, true), (true, false), (false, true), (false, false). If a logic function has one or two prepositional (logic) variables, it is By called a “logic primitive” . using the logic primitive, we can represent an (algebraic) expression which is called a “logic formula”. 2.1.2.1 Definition (Logic formula) The logic formula is defined as following : i) Truth values 0 and 1 are logic formulas ii) If v is a logic variable, v and are a logic formulas iii) If a and b represent a logic formulas, a  b and a  b are also logic formulas. iv) The expressions defined by the above (i), (ii), and (iii) are logic formulas. Any logic formula defines a logic function, some of important logic formulas are their values are given in the following: (1) Negation = 1 - a (2) Conjunction a b = Min (a , b) (3) Disjunction a b = Max(a , b) (4) Implication a → b = b 2.1.2.2 Quantifier The phrase “for all” is called the “universal quantifier” and is denoted symbolically by . The phrase “there exists”, “there is a”, or “for some” is called the “existential quantifier” and is denoted symbolically by . The universal quantifier is kind of an iterated conjunction. The existential

30 quantifier is kind of an iterated disjunction. Of course, if the number of individuals is infinite, such an interpretation of the quantifier is not possible, since infinitely long sentences are not allowed. According to De Morgan’s laws, the symbol ~ represents the negative operator. This suggests the possibility of defining the existential quantifier from the universal quantifier. We shall do this; xP(x) will be an abbreviation for ~x P(x). Of course we could also define the universal quantifier from the existential quantifier; xP(x) has the same meaning as ~ x~P(x). 2.1.3 The Boolean Algebra 2.1.3.1 Basic Operations of the Boolean Algebra An algebra of the two-valued logic is the Boolean algebra, named after the nineteenth-century English mathematician and logician George Boole. In this algebra, there are only three basic logic operations: negation , and , and or . For ease of algebraic operations, it is common to use symbols –, , and +, as summarized in Table 2.1. Table 2.1 Boolean Operations Name Symbol Example Meaning AND  a  b Both a and b must be true for the entire formula to be true OR  a + b If either a or b, or both ,is true then the entire formula to be true. NOT  If a is true then the entire formula is false ,if a is false then the entire formula is true.

2.1.3.2. Basic Properties of the Boolean Algebra Basic and useful properties of Boolean algebra are summarized in Table 2.2, in which not all properties are necessary for an axiomatic characterization of the Boolean algebra. It is important to note that some

31 rules of the Boolean algebra are the same as those of the ordinary algebra, such as a . 0 = 0, a . 1 = a, and a + 0 = a . but some are quite different, e.g., a + 1 = 1. Table 2.2 Properties of the Boolean Algebra Laws Formulas Characteristics

Commutative Law

Associative Law

Distributive Law Idempotence

Negation Inclusion

Absorptive Law

Reflective Law

Consistency

De Morgan's Laws

32 2.1.4 Multi-Valued Logic

2.1.4.1 Three-Valued Logic The classical two-valued logic can be extended to a three-valued logic in various ways, each having In a typical three-valued logic, we denote the truth, falsity, and indeterminacy by values of 1, 0, and 1/2, respectively. A commonly used three-valued logic is shown in Table 2.3 Comparing the three-valued logic shown in Table 2.3 with the two valued logic, one can see that the only new operations are those involving the new truth value 1/2. It should also be clear that the three-valued logic does not satisfy many basic operation laws of the two-valued logic, such as a = 0 and a = 1. 2.1.4.2 n-Valued Logic Once a three-valued logic is accepted as a meaningful and useful tool for Applications. The commonly used n-valued logic, particularly in fuzzy set and fuzzy systems theories, is the Lukasiewicz-Zadehn-valued logic. Lukasiewicz developed an n-valued logic in the 1930s, using only the negation − and the implication logical operations. Based on that, one can define a b = ( a b ) b , a b = a b = ( a b ) ( b a ). The fuzzy set theory was developed by Zadeh in 1960s, which has been thoroughly studied in Chapter 1. To develop an n-valued logic, with 2 ≤ n ≤ ∞, Zadeh modified the Lukasiewicz logic and established an infinite- valued logic, by defining the following primary logic operations: = 1− a, a b = min{ a, b }, a b = max{ a, b },

33 a b = min{ 1, 1 + b − a }, It has been shown, in logic theory, that all these logical operations become the same as those for the two-valued logic when n = 2, and the same as those for the three-valued logic shown in Table 2.3 when n = 3.

Table 2.3 A Three – valued logic a b     0 0 0 0 1 1 0 1/2 0 1/2 1 1/2 0 1 0 1 1 0 1/2 0 0 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1 1 1/2 1 1/2 1 1 1/2 1 0 0 1 0 0 1 1/2 1/2 1 1/2 1/2 1 1 1 1 1 1

2.2 Fuzzy logic

34 2.2.1 Introduction

The restriction of classical propositional calculus to a two – valued logic has created many interesting paradoxes over the ages. Perhaps we should have asked fruit that is not a vegetable because in this case the concepts fruit and vegetable can fuzzy. For example, tomatoes and cucumbers are technically fruits ….but most people (and cooks )label them vegetables . Fuzzy logic generalizes classical two –value logic by allowing the truth values of a proposition to be any number in the interval [0,1]. In the previous section we first review some basic concepts and principles in classical logic . 2.2.2 Fuzzy expression In the fuzzy expression(formula), a fuzzy proposition can have its truth value in the interval [0,1]. The fuzzy expression function is a mapping function from [0,1] to [0,1]. f : [0,1] → [0,1] In the fuzzy logic, the operations such as negation (~ or ), conjunction ( ) and disjunction ( ) are used as in the classical logic. 2.2.3 Definition (Fuzzy logic) Then the fuzzy logic is a logic represented by the fuzzy expression (formula) which satisfies the followings. i) Truth values, 0 and 1, and variable (xi [0,1], i = 1, 2, …, n) are fuzzy expressions. ii) If f is a fuzzy expression, ~f is also a fuzzy expression. iii) If f and g are fuzzy expressions, f g and f g are also fuzzy expressions.

2.2.4 Operators in Fuzzy Expression There are some operators in the fuzzy expression such as (negation),

35 (conjunction), (disjunction), and → (implication). The operators are defined as follows for a, b [0,1]. (1) Negation = 1 – a (2) Conjunction a b = Min (a, b) (3) Disjunction a b = Max (a, b) (4) Implication a → b = Min (1, 1+b – a) 2.2.5 Some Examples of Fuzzy Logic Operations In this section, we have one examples of classical logic operation and one example of fuzzy logic operation. In these examples, we will see that the fuzzy logic operation is a generalization of the classical one. Example 2.2 When a = 1, b = 1 i) = 0 ii) a b = Min(1,1) = 1 iii) a b = Max(1,1) = 1 iv) a → b = Min(1, 1+1-1) = 1 Example 2.3 When a = 0.6, b = 0.7 i) = 0.4 ii) a b = Min(0.6,0.7) = 0.6 iii) a b = Max(0.6, 0.7) = 0.7 iv) a → b = Min(1, 1+0.7 - 0.6) = Min(1, 1.1) = 1 2.2.6 Linguistic Variable When we consider a variable, in general, it takes numbers as its value. If the variable takes linguistic terms, it is called “linguistic variable”. Definition (Linguistic variable)The linguistic variable is defined by the following quintuple. Linguistic variable = (x, T(x), U, G, M) x: name of variable T(x): set of linguistic terms which can be a value of the variable U: set of universe of discourse which defines the characteristics of the

36 variable G: syntactic grammar which produces terms in T(x) M: semantic rules which map terms in T(x) to fuzzy sets in U. Example 2.4 Let’s consider a linguistic variable “X” whose name is “Age” U=[0,100]. Term for X are “old” “ middle-age” “young …..The base variable U is the age in year. M is the definition in terms of fuzzy sets of the value of X. G is the fuzzy matching (interpretation)of U. The fuzzy linguistic terms often consist of two parts: (1) Fuzzy predicate(primary term): expensive, old, dangerous, good ,etc (2) Fuzzy modifier: very, almost impossible, extremely unlikely, etc (3) Fuzzy quantifier: many, few, almost, all, usually, etc. 2.2.7 Fuzzy Predicate Definition (Fuzzy predicate) .A fuzzy predicate is a predicate whose definition contains ambiguity Example 2.5 “ z is expensive ” “ w is young ” The term “ expensive” and “ young” are fuzzy terms. There fore the sets “expensive(z)” and “ young (w) ” are fuzzy sets. When a fuzzy predicate “ x is p” is given , we can interpret it in two ways. 1) p(x) is a fuzzy set. The membership degree of x in the set p is

defined by the membership function µp(x) .

2) µp(x) is the satisfactory degree of x for the property p. Therefore the truth value of the fuzzy predicate is defined by the membership

function Truth value = µp(x) 2.2.8 Fuzzy Modifier A new term can be obtained when we add the modifier “very” to a primary term.

37 Example 2.6. Let’s consider a linguistic variable “Age” .Linguistic terms “young” and “very young” are defined in the universal set U. U={u/u[0,100] }. T(Age)={young, very young ,very very young ,..}

The term young is represented by a membership function µyoung (u).When we represent the term “very young” ,we can use the square of µyoung (u) as follows.

2 . µ very young(u) =( µyoung (u))

Fig 2.1 Linguistic variable "Age"

2.3 Fuzzy Logic and Approximate Reasoning Fuzzy logic is a logic; its ultimate goal is to provide foundations for approximate reasoning using imprecise propositions based on fuzzy set theory. To introduce this notion, we first recall how the classical reasoning works, using only precise propositions and the two-valued logic. The following syllogism is an example of such reasoning in linguistic terms:

38 Everyone who is 40 years old or older is old. (ii) David is 40 years old and Mary is 39 years old. (iii) David is old but Mary is not. This is a very precise deductive inference, correct in the sense of the two valued logic. In this classical (precise) reasoning using the two-valued logic, when the (output) logical variable represented by a logical formula is always true regardless of the truth values of the (input) logical variables, it is called a tautology. If, on the contrary, it is always false, then it is called a contradiction. The four frequently used inference rules in classical reasoning are: modus ponens: (a ( a b ) ) b; modus tollens: ( ( a b ) ) ; syllogism: (a b ) ( b c ) ( a c ); contraposition: (a b ) ( b ). These inference rules are very easily understood and, indeed, have been commonly used in one’s daily life. We now consider the following example of approximate reasoning in linguistic terms that cannot be handled by the classical (precise) reasoning using two-valued logic: (i) Everyone who is 40 to 70 years old is old but is very old if he (she) is 71 years old or above; everyone who is 20 to 39 years old is young but is very young if he (she) is 19 years old or below. (ii) David is 40 years old and Mary is 39 years old. (iii) David is old but not very old; Mary is young but not very young. This is an example of what is called approximate reasoning. In order to deal with such imprecise inference, fuzzy logic can be employed. Briefly, fuzzy logic allows the imprecise linguistic terms such as: • fuzzy predicates: old, rare, severe, expensive, high, fast

39 • fuzzy quantifiers: many, few, usually, almost, little, much • fuzzy truth values: very true, true, unlikely true, mostly false. To describe fuzzy logic mathematically, we introduce the following concepts and notation. Let S be a universe set and A fuzzy set associated with a membership function, μA(x), x S. If y = μA(x0) is a point in [0,1], representing the truth value of the proposition “x0 is a,” or simply “a,” then the truth value of “not a” is given by

= μA(x0 is not a) = 1 − μA(x0 is a) = 1 − μA(x0) = 1 − y.

Consequently, for n members x1, ..., xn in S with n corresponding truth values yi= μA(xi) in [0,1], i = 1,...,n, by applying the extension principle the truth values of “not a” is defined as

= 1 − yi, i=1,...,n. Here, we note that, actually, n = ∞ is allowed. With n > 3, following logic theory we define the logical operations and, or, not, implication, and equivalence as follows: for any a, b S,

μA(a b) = μA(a) μA (b) = min{ μA (a), μA (b) };

μA (a b) = μA (a) μA (b) = max{ μA (a), μA (b) };

μA ( ) = 1 − μA (a);

μA (a b) = μA (a) μA (b) = min{ 1, 1 + μA (b) - μA (a) };

μA (a b) = μA (a) μA (b) = 1 − | μA (a) − μA b) |. In the classical two-valued logic, for instance in the modus ponens, the inference rule is ( a ( a b ) ) b. In terms of membership values, this is equivalent to the following: IF μ(a) = 1 AND μ(a b) = min{ 1, 1 + μ(b) – μ(a) } = min{ 1, μ(b)} = 1 THEN μ(b) = 1. Otherwise, it will contradict either μ(a) = 1 or μ(a b) = 1. In fuzzy logic, the inference rule reads the same: for the modus ponens, we have( a ( a b ) ) b.

40 But in terms of membership values, we have IF μ(a) > 0 AND μ(a b) = min{ 1, 1 + μ(b) – μ(a) } > 0 THEN μ(b) > 0. This fuzzy logic inference can be interpreted as follows: IF a is true with a certain degree of confidence AND “IF a is true with a certain degree of confidence THEN b is true with a certain degree of confidence” THEN b is true with a certain degree of confidence. All these “degrees of confidence” can be quantitatively evaluated by using the corresponding membership functions. This example is a generalized modus ponens, called fuzzy modus ponens. Example 2.7 . In the classical two-valued logic, the modus tollens is ( ( a b ) ) . The following is a simple case: Premise David cannot work Implication If David is young then he can work Conclusion David is not young This example does not make much sense, of course, since it implies also that David cannot work at all. But two-valued logic can only describe “young or old,” “can or cannot,” etc., and this is the best one can do for this example using two-valued logic. In contrast, the fuzzy modus tollens has the same rule: ( ( a b ) ) . but provides a much more meaningful inference as follows, which only implies that David cannot work so hard:

Premise David cannot work much Implication If David is much young then he can work

41 more Conclusion David is not so young

Premise David cannot work much Implication If David is much younger then he can work more Conclusion David is not so young In such examples, one only needs to select reasonable membership functions to describe “young, very young, old, very old, much, much more, hard, very hard,” etc., such that they are meaningful and practical for the applications in consideration.

2.4 Fuzzy Relations

2.4.1 Definition Fuzzy Relation

Let S be a universe set, and A and B be subsets of S.A fuzzy relation is a relation between elements of A and elements of B, described by a membership function µA×B(a,b), a A and bB. Fuzzy relation has degree of membership whose value lies in [0,1].

µR=A [0,1] , R={(x , y) , µR(x ,y)  0 , x  A, y B) Fuzzy relation generalizes classical relation into one that allows partial membership and describes a relationship that holds between two or more objects.

42 Example 2.8: a fuzzy relation “Friend” describe the degree of friendship between two persons. Cardinality of fuzzy relation: 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. 2.4.2 Operation on Fuzzy Relations Let R and S be fuzzy relations on the Cartesian space X Y. Then the following operations apply for the membership values for various set operations .

Union (x,y) =max( µR(x,y) ,µS(x,y) )

Intersection (x,y) =min(µR(x,y) ,µS(x,y) )

Complement (x,y) = 1- µR(x,y)

Containment R  S µR(x,y) ≤ µS(x,y) 2.4.3 Properties of Fuzzy Relations The properties of commutativity ,a ssociativity , distributivity, involution and idempotency all add for fuzzy relations . Moreover, De Morgan‘s principles hold for fuzzy relations ,and the null relation O ,and the complete relation ,E, are analogous to the null set and the whole set in set _theoretic form , respectively . Fuzzy relations are not constrained, excluded middle axioms for fuzzy relations do not result in general , in the null relation ,O, or the complete relation , E, hence, R ≠ E . R O . 2.4.4 Fuzzy Cartesian Product Let A be a fuzzy set on universe X ,and B be a fuzzy set on universe Y , then A B = R  X Y

43 Where the fuzzy relation R has membership function

µR(x,y) = (x,y) = min( µA(x), µB(y) ) Example 2.9 Let

A defined on a universe of three discrete temperatures, X = {x1,x2,x3}, and

B defined on a universe of two discrete pressures, Y = {y1,y2} Fuzzy set A represents the “ambient” temperature and Fuzzy set B the “near optimum” pressure for a certain heat exchanger, and the Cartesian product might represent the conditions (temperature- pressure pairs) of the exchanger that are associated with “efficient” operations. For example, let

0.2 0.5 1  y1 y2 A     x1 x2 x3 x1 0.2 0.2  and A  B  R  x 0.3 0.5  2   0.3 0.9  x 0.3 0.9 B    2   y1 y2 

2.4.5 Fuzzy composition: Suppose R is a fuzzy relation on the Cartesian space X Y, S is a fuzzy relation on the Cartesian space Y Z, T is a fuzzy relation on the Cartesian space X Z; then fuzzy max- min and fuzzy max-product composition are defined as ~ ~ ~ T  R  S max  min

T (x, y)  v ( R (x, y)   g (y, z)) yY max  product

T (x, z)  v ( R (x, y)   g (y, z)) yY

Example 2.10 Let S=R , A={a1,a2,a3,a4}={1,2,3,4} and

44 B={b1,b2,b3}= {0,0.1,2}.Let be the fuzzy relation ''a is considerably larger than b'' defined by the following table :

0.6 0.6 0.0 0.8 0.7 0.0

0.9 0.8 0.4

1.0 0.9 0.5

Let be the fuzzy relation ''a is considerably close to b''defined by the following table : 0.2 0.2 0.5

0.1 0.1 1.0 0.0 0.0 0.3 0.0 0.0 0.5

Then, and are given by the following two tables , respectively:

0.6 0.6 0.5

0.8 0.7 1.0

0.9 0.8 0.4 1.0 0.9 0.5

0.2 0.2 0.0

0.1 0.1 1.0 0.0 0.0 0.4 00 0.0 0.5

45 Now we can state the following basic properties of the max –min composition of fuzzy relations. Theorem 2.1 Let , etc. be fuzzy relations defined on the som product set A A , and let '' ''be the max- main composition operation for these fuzzy relations. Then (1) The max- min composition is associative: ( ) ( ) (2) If is reflexive and is arbitrary, then (a,b) ≤ (a,b) for a, b A , and (a,b) ≤ (a,b) for a, b A . (3) If and are reflexive , then so are and (4) If and are symmetric then so is = ,then is symmetric .In particular , If issymmetric then so is (5) If is symmetric and transitive, then (a,b) ≤ (a,a) for a, b A . (6) If is reflexive and transitive, then

(7) If and are transitive and = ,then is transitive. Example 2.11 Let S={1,2,3,4} and A={1,2,3,4} with the following membership function for fuzzy description ''small''. 1.0 ifa  1,  0.7 ifa  2  A (a)   0.3 ifa  3 0.0 ifa  4 Let be a fuzzy relation between two members in A, meaning '' approximately equal'' ,defined by the following table :

46

1.0 0.5 0.0 0.0

0.5 1.0 0.5 0.0

0.0 0.5 1.0 0.5

0.0 0.0 0.5 1.0

Suppose thate we want to perform the following fuzzy logic infernce(approxmait reasoning)

Primes a is small Implication a and b are approximately equal Conclusion a is somewhat small

Then we can apply the max-min composition of the fuzzy relation as following:

(i) ''a is small '': µA(a) is available; (ii) ''a and b approximately equal'': (a,b) is given by the table;

(iii) Let µB(b) is the membership function for the conclution(a fuzzy modus ponens);

B (b)  ma x{min{A (a),  ~ (a,b)}},bB  A aA R The result ,for b=2,say is

 B (2)  ma x{min{ A (a),  ~ (a,2)}} aA R  max{min{1.0,0.5},min{0.7,1.0},min{0.3,0.5},min{0.0,0.0}}  max{0.5,0.7,0.3,0.0}  0.7

Similarly, One can evaluate µB(1),µB(3),µB(4). The final result is

47 1.0 ifb  1,  0.7 ifb  2  B (b)   0.5 ifb  3 0.3 ifb  4

48 Chapter Three Fuzzy Rule Base 3.1 Rules Rules are used to represent inferential relationships among pieces of knowledge. They are used to implement knowledge. Based systems Exampleof rules Mapping among propositions If (apple is red) Then (apple is ready) Mapping among patterns If (a is apple) AND (a is red) THEN (a is ready) We can infer (apple is ready) Rules are used to infer new knowledge from known facts. 3.1.1 Fuzzy Rule: A Fuzzy rule is a rule whose clauses have the shape (V is L) Where V is a linguistic variable and L is a label, a value for V associated to a Fuzzy set. This is a linguistic clause. Usually, clause in the antecedent are only related by the AND operator. The antecedent is usually matched against facts that are represented as values of real-valued variables corresponding to the linguistic variables. The consequent may be one of two types… 3.1.2 Linguistic rules Linguistic rules (Momdain): the consequent is a conjunction of linguistic clauses IF (A is LA) AND (B is LB) AND … THEN (U is LU) AND ……

Example 3.1

49 IF (Distance is Far) AND (Ball Direction is Front) THEN (speed is High) AND (Direction is Abead). This can be considered as a mapping between the interpretation of an input configuration and A symbolic description of the desired out put. 3.1.3 Model rules To the linguistic interpretation of its applicability conditions

IF (A is LA) AND (B is LB) AND …THEN V is f(A,B) Example 3.2 IF(Temperature is High) AND (pressure is High) THEN Heating = 2000 – 3T – 7P This can be considered as a mapping between the interpretation of an input configuration and a model to be applied to the input real values to obtain the output. 3.1.4 Fuzzy rule as a relation If x is A the y is B “x is A” ,“y is B”-Fuzzy predicates A(x), B(y) if A(x) then B(y) can be represented as a relation R(x, y) : A(x)  B(y) Where R(x, y) can be considered a Fuzzy set with 2-dimentional membership function

R(x,y) = f(A(x), B(y)) Where f is a Fuzzy implication function

3.2 Inference and Knowledge Representation In general, the “inference” is a process to obtain new information by using existing knowledge. The representation of knowledge is an

50 important issue in the inference. The following rule type “if - then” is the most popular form “If x is a, then y is b” The rule is interpreted as an implication and consists of the “antecedent (if part)” and “consequent (then part)” based on the above discussion, we can summarize two types of “reasoning”. (1) Modus Ponens Fact : x is a Rule: if x is a, then y is b Result : y is b (2) Modus tollens Fact: y is b Rule: if x is a, then y is b Result: x is a The modus ponens is used in the forward inference and the modus tollens is in the back ward one. 3.2.1 Representation of Fuzzy Predicate by Fuzzy Relation In this section, we will see how the Fuzzy predicate is used in Fuzzy inference. We know also a Fuzzy relation is one type of Fuzzy sets, and thus we can represent a predicate by using a relation. “R(x) = P” P is a Fuzzy set and R(x) is a relation that consists of elements in P. the membership function of the predicate is represented by P(x) (x) which shows the membership degree of x in P. The predicate represented by a relation will be used in the representation of Fuzzy rule and premise. 3.2.2 Representation of Fuzzy Rule When we consider Fuzzy rules, the general form is given in the following. If x is A, then y is B.

51 The Fuzzy rule may include Fuzzy predicates in the antecedent and consequent, and it can be rewritten as in the form. If A(x) , then B(y) This rule can be represented by a relation R(x, y). R(x, y): If A(x), then B(y) or R(x, y): A(x)  B(y) If there are a rule and facts involving Fuzzy sets, we can execute two types of reasoning. (1) Generalized modus Ponens (GMP) Fact: x is A' Rule: If x is A then y is B : R(x, y)

Result: y is B' : R(y) = R(x)  R(x,y) (2) Generalized modus tollens (GMT) Fact : y is B' :R(y) Rule: If x is A then y is B : R(x,y)

Result: x is A' : R(x) = R(y) R(x,y) 3.2.3 Fuzzy IF – THEN Rules Human knowledge is represented in terms of Fuzzy IF – THEN rules. A fuzzy IF – THEN rule is a conditional statement expressed as IF < Fuzzy proposition > THEN < Fuzzy proposition > Therefore, in order to understand Fuzzy IF – THEN rules. We first must know what are Fuzzy propositions. 3.2.3.1 Fuzzy Propositions There are two types of fuzzy propositions: atomic fuzzy proposition, and compound fuzzy proposition. An atomic Fuzzy proposition is a single statement x is A Where x is a linguistic variable, and A is a linguistic value of x.

52 A compound Fuzzy proposition is a composition of atomic Fuzzy proposition using the connectives “and”, “or” and “not” which represent Fuzzy intersection Fuzzy union, and Fuzzy complement. Respectively. For example, if x is represents the speed of the care, then the following are Fuzzy propositions x is S x is M x is F x is S or x is not M x is not S and x is not F (x is S and x is not F) or x is M Where S,M, and F denote the Fuzzy sets “slow” “medim” and “fast” respectively. 3.2.4 Fuzzy Logic Rule Base 3.2.4.1 Fuzzy If – Then rule In this section, we take a closer at the implication relation a  b and it is application in Fuzzy logic rules. The implication relation a  b can be interpreted in linguistic terms, as “IF a is true THEN b is true”. Of course, this is valid for both the classical (two-valued) logic and the Fuzzy (multi valued) logic. For Fuzzy logic per formed on a Fuzzy subset A, we have a membership function A describing the truth values of a  A and b  A. in this case, a more complete linguistic statement would be

“IF a  A is true with a truth value A(a) THEN b  A is true with a truth value A(b) has truth value. A(a  b) = min {1 , 1 + A(b) - A(a)}”. In most cases, however the implication relation a  b performed an Fuzzy subsets A and B; where a  A and b  B, is simply defined in

53 linguistic terms as “IF a  A is true with a truth value A(a) THEN be B is true with a truth value B(b).” A Fuzzy logic implication statement of this form is usually called a Fuzzy IF – THEN rule.

To be more general, let A1, A2,…,An and B be Fuzzy subset with membership functions  , and  respectively. A1 A2 B

Definition: A general Fuzzy IF – THEN Rule has the form “IF a1 is A1

AND … AND an is An THEN b is B” using the Fuzzy logic AND operation, this rule is implemented by the following evaluation formula  (a )...  (a )   (b), A1 1 An n B

Where  (a )   (a )  min{ (a ),  (a )} Ai i Aj j Ai i Aj j 1  I . j  n, and , therefore.  (a )...  (a )  min{  (a ),  (a )} A1 1 An n A1 i Aj j About this general Fuzzy IF – THEN rule and its evaluation a few issues have to be clarified: (i) There is no Fuzzy logic OR operation in a general Fuzzy IF – THEN rule. What should we do if a Fuzzy logic implication statement involves the OR operation? (ii) There is no Fuzzy logic NOT operation in a general Fuzzy IF – THEN rule. What should we do if a Fuzzy logic implication statement involves the NOT operation? (iii) How do we interpret a Fuzzy IF-RHEN rule in a particular application? Is this interpretation unique? We provide answers to these question in the next two subsections.

3.2.4.2 Fuzzy Logic Rule Base We first consider questions (i) and (ii). Let us first discuss, for example the following Fuzzy IF – THEN rule containing an OR operation:

54 “IF a1 is A1 AND a2 is A2 OR a3 is A3 AND a4 is A4 THEN b is B” by convention , this is understood in logic as

“(IF a1 is A1 AND a2 is A2) OR (IFa3 is A3 AND a4 is A4) THEN (b is B))” Hence, the Fuzzy logic OR operation is not necessary to use: it may shorten a statement of a Fuzzy IF-THEN rule. As to the Fuzzy logic NOT operation, although may have a negative statement like “IF a is not A” we can always interpret this negative statement by a positive one “IF a is A ” or “IF a is A ”. Example 3.3 Given a Fuzzy logic implication statement

“IF a1 is A1 AND a2 is not A2 OR a3 is not A3 THEN b is B” How can we rewrite it as asset of equivalent general Fuzzy IF – THEN rules in the unified form? We may first drop the Fuzzy logic OR operation by rewriting the given statement as

(1) “IF a1 is A1 AND a2 is notA2 THEN b is B”

(2) “IF a3 is not A3 THEN b is B” Also w drop the Fuzzy logic NOT operation as

(1’) “IF a1 is A1 AND a2 is A2 THEN b is B”

(2’) “IF a3 is A3 THEN b is B” Finally these two general Fuzzy IF THEN rules can be evaluated as follows:  (a )   (a )   (b), A1 1 A2 2 B

Where  (a ) 1  (a ), and A2 2 A2 2  (a )   (b) A3 3 B

Where  (a ) 1  (a ) A3 3 A3 3 Therefore, we only need two general Fuzzy IF – THEN rules

55 (1’) and (2’) and the three membership values

 (a ) ,  (a )and (a ), to infer the conclusion “b is B”. A2 2 A 1 1 A3 3 Finite Fuzzy logic implication statement can always be described by a set of general Fuzzy IF – THEN rules containing only the Fuzzy logical AND operation in the form

(1) “IF a11 is A11 AND …AND a1n is A1n THEN b1 is B1”

(2) “IF a21 is A22 AND …AND a2n is A2n THEN b2 is B2” ։

(m) “IF am1 is Am1 AND …AND amn is Amn THEN bm is Bm” This family of general Fuzzy IF – THEN rules is usually a Fuzzy logic rule base. One can also verify that such a general form of a Fuzzy logic rule base includes the non Fuzzy case and the un conditional case (with only the Fuzzy logical AND operation in the condition part) also coverse many unusual Fuzzy logic implication statements, such as the one show in the next example. Example 3.4 Given a Fuzzy logic implication statement

“b is B unless a1 is A1 AND …AND an is An” Which is under stood in logic as

“(b is B unless (a1 is A1 AND …AND an is An)” One can first convert it by using the Fuzzy logic NOT and OR operations as follows:

“IF a1 is A1 OR …OR an is An THEN b is B” and then replace all the OR operations by a Fuzzy logic rule base of the form:

(1) “IF a1 is THEN b is B”

(2) “IF a2 is A2 THEN b is B”

56 ։

(n) “IF an is An THEN b is B” This rule base is in the general format.

3.3 Structure of Fuzzy Rule Base 3.3.1 Structure of Fuzzy IF – THEN Rules A Fuzzy rule base consists of a set of Fuzzy IF – THEN rules. It is the heart of the Fuzzy system in the sense that all other components. The Fuzzy rule base comprises the following Fuzzy IF – THEN rules:

Ru: IF x1 is A1 and …and xn is An, THEN y is B (1) where A and B are Fuzzy sets in U  R and V  R. We call the rules in the form of above canonical Fuzzy IF - THEN rules because they include many other types Fuzzy rules and Fuzzy

propositions as special cases, as shown Pn the following lemma. Lemma 3.1 The canonical Fuzzy IF – THEN rules in the form of ( 1) include the following as special cases: (a) “Partial rules”:

IF x1 is A1 and …and xm is Am, THEN y is B where m < n (2) (b) “Or rules”

IF x1 is A1 and … and xm isAm Or x m+1is Am+1 and …and xn is An THEN y is B (3) (c) single Fuzzy statement:

57 y is B (4) (d) “Gradual rules” for example: The smaller the x, the bigger the y (5) (e) Non – Fuzzy rules (that is, conventional production rules). Proof: The partial rule ( 2 ) is equivalent to

IF x1 is A1 and … and xm is Am and xm+1 is I and xn is I THEN y is B. (6)

Where I is a Fuzzy set in R with I(n) = 1 for all x  R. The preceding rule is in the form of ( 1 ): this proves (a). Based on intuitive meaning of the logic operator “or” the “ore rule” is equivalent to the following two rules:

IF x1 is A1 and …and xm is Am, THEN y is B (7)

IF xm+1 and …and xn is An, THEN y is B (8) From (a) we have that the two rules ( 7) and ( 8) are special cases of ( 1 ) this proves ( b ). The Fuzzy statement is equivalent to

IF xn is I and …and xn is I, THEN y is B' (9) which is in the form of ( 1 ); this proves (c). For (d), let S be a Fuzzy set representing “smaller”

For example, S(x) = 1/(1 + exp(5(x + 2))), and B be a Fuzzy set representing “bigger” for example,

B (y) = 1/(1 + exp(-5(y – 2)), then the “Gradual rule” is equivalent to IF x is S, THEN y is B Which is a special case of (1); this proves (d). finally, if the membership functions of A and B can only take values 1 or O, then the rules become none – Fuzzy rules. 3.3.2 Interpretation of Fuzzy IF-THEN Rules

58 Now, we return to question (iii) there after: how do we interpret a Fuzzy IF – THEN rule a particular application, and is such an interpretation unique? In the classical two –valued logic, the IF-THEN rule can be easily interpreted, namely, “IF a is A THEN b is B ” Is itself clear: the condition “b is B”. for example, the statement “IF a is positive THEN b is negative” is crisp, non vague, and absolute. In Fuzzy multi valued logic, however, both A and B are

Fuzzy subset a associated with Fuzzy membership functions A and

B. both the condition “a is A” and the conclusion “b is B” can have various interpretations. Table 3.1 lists some interpretations of Fuzzy IF-THEN rules, where the fist and the last ones are classical logic implication rules that are special cases of Fuzzy logic rules.

Table 3.1 Interpretation of Fuzzy IF-THEN Rules Premise (IF) Conclusion (THEN) a is A b is B a is very A b is very B a is very A b is B a is more or less A b is more or less B a is more or less A b is B a is not A b is unknown a is not A b is not B

59 In the following, we rewrite (IF < Fuzzy proposition > THEN < Fuzzy proposition > ) as IF < FP1> THEN < FP2> where FP1 and FB are

Fuzzy propositions. We assume that FP1 is a Fuzzy relation defined in

U = U1 … UA FP2 isa Fuzzy relation defined in V = V1 … Vm, and x end y are linguisticvariables (vectors) in U and V, respectively.

3.3.2.1 Dienes – Rescher Implication: If we replace the logic operators – and V in PVq by the basic Fuzzy complement and union, then we obtain the so-called Dienes-Rescher implication the Fuzzy IF – THEN rule is interpreted as a Fuzzy relation QP in U  V with the membership function  (x, y)  max[1  (x),  (y)] QP Fp11 Fp 2 3.3.2.2 Lukasiewicz Implication:

The Fuzzy IF-THEN rule IF THEN < FP2> is interpreted as a

Fuzzy relation Ql in U  V with the membership function  (x, y)  min[1,1  (x)   (y)] Q1 Fp1 Fp 2 3.3.2.3 Zadeh Implication

Here the Fuzzy IF-THEN rule is interpreted as a Fuzzy relation QZ in U  V with the membership function  (x, y)  max[min(  (x),  (y)),1  (x)] Qz Fp1 Fp 2P Fp11 3.3.2.4 Mamdani Implications

The Fuzzy IF-THEN rule is interpreted as a Fuzzy relation Qm is U  V  (x, y)   (x) (y) QPP FP1 FP2 Example 3.5 Let U = {1, 2, 3, 4} and V = {1,2,3}, suppose we know that x  U is some what inversely propositional to y  V.

60 To the formulate this knowledge, we may use the following Fuzzy IF- THEN rule: IF x is large, THEN y is small Where the Fuzzy sets “large” and “small” are defined as Large = 0/1 + 0.1/2 + 0.5/3 + 1/4 Small = 1/1 + 0.5/2 + 0.1/3 If we use the Dienes-Rescher implication, then the Fuzzy IF-THEN rule is interpreted as the following Fuzzy relation

QD = 1/(1,1) + 1/(1,2) + 1/(1,3) + 1/(2,1) + 0.9/(2,2) + 0.9/(2,3) + 1/(3,1) + 0.5/(3.2) + 0.5/(3,3) + 1/(4,1) + 0.5/(4,2) + 0.1/(4,3). (a) If we use the Lukasiewicz implication the rule becomes

Ql= 1/(1,1) + 1/(1,2) + 1/(1,3) + 1/(2,1) + 1/(2,2) + 1/(2,3) + 1/(3,1) + 1/(3,2) + 0.6/(3,3) + 1/(4,1) + 0.5/(4,2) + 0.1/(4,3) (b) For the Zadeh implication

Qz = 1/(1,1) + 1/(1,2) + 1/(1,3) + 0.9/(2,1) + 0.9/(2,2) + 0.9/(2,3) + 0.5/(3,1) + 0.5/(3.2) + 0.5/(3,3) + 1/(4,1) + 0.5/(4,2) + 0.1/(4,3) (c) Finally if we use the Mamdani implication, then the Fuzzy IF-THEN rule becomes

QMP = 0/(1,1) + 0/(1,2) + 0/(1,3) + 0.1/(2,1) + 0.05/(2,2) + 0.01/(2,3) + 0.5/(3,1) + 0.25/(3.2) + 0.05/(3,3) + 1/(4,1) + 0.5/(4,2) + 0.1/(4,3) (d) From (a) –(d) we see that for the combination not covered by the rule that is pairs (1,1), (1,2) and (1,3) (because arg e (1)  0) QD, QL and Q2 give full membership values to them, but Qmp give zero membership value. 3.3.3 Evaluation of Fuzzy IF-THEN Rules In this subsection, we discuss the problem of evaluating a Fuzzy IF-THEN rule

AB(a, b)= A(a) B(b) , a  A, b  B For the classical two – valued logic, this evaluation is simple

61 1 if  A (a)  1,  B (b)   0 if  A (a)  0, That is , “a  A  b B” for Fuzzy logic, we have the following options for the IF – THEN rule“A(a) B(b)”

(a)  AB (a,b)  min A (a), B (b)};

(b)  AB (a,b)   A (a).B (b)};

(c) ab (a,b)  maxmin{ A (a), B (b)},1  A (a)};

(e)  AB (a,b)  max1  A (a), B (b)}; (f) goguen's formula:

1 if  A   B (b)   AB (a,b)    (b) B if (a)   (b)  A B   A(a) We remark that all evaluation formulas are valid for the fuzzy logic inference purpose, provided that one uses consistently the same formula for the implication relation .Obviously formulas (a) and (b) are very simple to use but they are the same as the logical AND operation .We also remark that for the following general fuzzy IF –THEN rule

“IF a1 is A1 AND……. AND an is An THEN b is B” We can evaluate the condition by

µA(a1,a2,……,an) = min{µA1,……,µA2} and then evaluate

µA(a1,a2,……,an)  µB(b) =min {1,1+ µB(b) - µA(a)}.

62 Chapter Four Some applications of Fuzzy Logic

4.1 Introduction This chapter introduces some applications of fuzzy logic. The purpose of this introduction is mainly to illustrate workability and applicability of fuzzy logic in real-life situations. Two main applications are introduced in the following order: a fuzzy rule-based expert system for a health care diagnostic system monitoring vital signs of a human patient,and a fuzzy set for decision making.

4.2 HEALTH MONITORING FUZZY DIAGNOSTIC SYSTEMS Diagnostic systems are used to monitor the behavior of a process and identify certain pre-defined patterns that associate with well-known problems. These problems, once identified, imply suggestions for specific treatment. Most diagnostic systems are in the form of a rule-based expert system: a set of rules is used to describe certain patterns. In general, the diagnostic systems are used for consultation rather than replacement of human expert.Therefore, the final decision is still with the human expert to determine the cause and to prescribe the treatment. Most current health monitoring systems only check the body’s temperature, blood pressure, and heart rate against individual upper and lower limits and start an audible alarm should each signal move out of its predefined range (either above the upper limit or below the lower limit). Then, human experts (nurses or physicians) will have to examine the patient and probe the patient’s body further for additional data that lead to proper diagnosis and its corresponding treatment.

63 Other more complicated systems normally involve more sensors that provide more data but still follow the same pattern of independently checking individual sets of data against some upper and lower limits. The warning alarm from these systems only carries a meaning that there is something wrong with the patient. Thus, attending staff would have to wait for the physician to make a diagnostic examination before they could properly prepare necessary equipment for a corresponding treatment. The health monitoring system is playing two roles in every space mission: to monitor the health of the astronaut, and to aid in determining if a mission should be continued or aborted (due to serious illness). This section presents a simple implementation of a health monitoring expert system utilizing fuzzy rules for its rule base. This health monitoring expert system consists of a set of sensors monitoring three vital signs of a patient: body temperature, blood pressure, and heart rate. 4.2.1 Fuzzy Rule-Based Health Monitoring Expert Systems In this system, we will implement a fuzzy rule-based expert health monitoring system with three basic sensors: body temperature, heart rate, and blood pressure. Note that the blood pressure is measured in two readings:systolic pressure (the maximum pressure that the blood exerts on the blood vessel, i.e., the aorta, when the pumping chamber of the heart contracts), and diastolic pressure (the lowest pressure that remains in the small blood vessel when the pumping chamber of the heart relaxes).For simplicity of discussion, only diastolic pressure is used. The expert system will check for combinations of data instead of individual data and thus will identify twenty-seven different scenarios instead of three in the conventional system. Individual sensors can identify three isolated cases: (i) high body temperature indicates high fever normally associated with the body fighting against some infectious virus or bacteria, some hormone disorder

64 such as hyperthyroidism, (ii) high blood pressure indicates hypertension normally associated with some kidney disease, hormonal disorder such as hyperaldoteronism; and (iii) high heart rate indicates rapid heartbeat normally associated with an increase in adrenaline . In addition, three more cases can be identified: (iv) low body temperature indicates hypothermia; (v) low blood pressure normally associates with excess bleeding, muscle damage, heart valve disorder, and (vi) low heart rate normally associates with abnormal pacemaker or with the blockage between the pacemaker and the atria where pacemaker signal is received to stimulate heartbeats. However, the three individual sensors, each with three settings (normal, high, and low), can be combined to give 27 different scenarios.

Let x1 be the body temperature, x2 the (systolic) blood pressure, x3 the heart rate, and y the diagnostic statement. Let Li, Ni, and Hirepresent the three sets of low range, normal range, and high range for sensor data xi, where i = 1, 2, or 3. Furthermore, let C0, C1, C2, ..., C26 be the individual scenarios that could happen for each combination of the different data sets. The low range for the body temperature can be defined as below 98F. Similarly, the normal range is 98F, and high range is above 98F. One can define three ranges and three membership functions. These functions have the mathematical representation as follows:

 1 if    x1  96 F,   (x )  (98  x ) / 2 if 96 F  x  98 F, L1 1  1 1   0 if 98 F  x1  ,

65   (x1  96) / 2 if 96 F  x1  98 F,   (x )  (100  x ) / 2 if 98 F  x  100 F, N1 1  1 1 0 else   0 if    x1  98 F,   (x )  (x  98) / 2 if 98 F  x  100 F, H1 1  1 1 1 if 100F  x    1

1 if    x2  100Hg,   (x )  (120  x ) / 20 if 100Hg  x  120Hg, L2 2  2 2 0 if 120Hg  x    2

(x2 100) / 20 if 100Hg  x2  120Hg   (x )  (140  x ) / 20 if 120Hg  x  140Hg, N 2 2  2 2  0 else

0 if    x2  120Hg,   (x )  (x 120) / 20 if 120Hg  x  140Hg, H 2 2  2 2  1 if 140Hg  x2  ,

1 if    x3  40Hz,   (x )  (70  x ) / 30 if 40Hz  x  70Hz, L3 3  3 3  0 if 70Hz  x3  ,

(x3  40) / 30 if 40Hz  x3  70Hz   (x )  (100  x ) / 30 if 70Hz  x  100Hz, N3 3  3 3  0 else

0 if    x3  70Hz,   (x )  (x  70) / 30 if 70Hz  x  100Hz, H3 3  3 3  1 if 100Hz  x3  , From this knowledge, four basic rules can be defined as follows:

(0) R : IFx1 is N1 AND x2 is N2 AND x3 is N3 THEN y is C0 (1) R : IFx1 is H1 AND x2 is N2 AND x3 is N3 THEN y is C1 (2) R : IFx1 is N1 AND x2 is H2 AND x3 is N3 THEN y is C2 (3) R : IFx1 is N1 AND x2 is N2 AND x3 is H3 THEN y is C3 Provides data that are lower than the lower limit: (4) R : IFx1 is L1 AND x2 is N2 AND x3 is N3 THEN y is C4 (5) R : IFx1 is N1 AND x2 is L2 AND x3is N3 THEN y is C5 (6) R : IFx1 is N1 AND x2 is N2 AND x3 is L3 THEN y is C6.

66 It can be seen that C0 corresponds to normal condition, C1 high fever, C2 hypertension, C3 rapid heart rate, C4 hypothermia, C5 low blood pressure, and C6 low heart rate. The remaining 20 cases can be defined as follows: (7) R : IFx1 is L1 AND x2 is L2 AND x3 is L3 THEN y is C7 (8) R : IFx1 is L1AND x2 is L2 AND x3 is N3 THEN y is C8 (9) R : IFx1 is L1AND x2 is L2 AND x3 is H3 THEN y is C9 (10) R : IFx1 is L1AND x2 is N2 AND x3 is L3 THEN y is C10 (11) R : IFx1 is L1AND x2 is N2 AND x3 is H3 THEN y is C11 (12) R : IFx1 is L1AND x2 is H2 AND x3 is L3 THEN y is C12 (13) R : IFx1 is L1AND x2 is H2 AND x3 is N3 THEN y is C13 (14) R : IFx1 is L1AND x2 is H2 AND x3 is H3 THEN y is C14 (15) R : IFx1 is N1 AND x2 is L2 AND x3 is L3 THEN y is C15 (16) R : IFx1 is N1 AND x2 is L2 AND x3 is H3 THEN y is C16 (17) R : IFx1 is N1 AND x2 is H2 AND x3 is L3 THEN y is C17 (18) R : IFx1 is N1 AND x2 is H2 AND x3 is H3 THEN y is C18 (19) R : IFx1 is H1 AND x2 is L2 AND x3 is L3 THEN y is C19 (20) R : IFx1 is H1 AND x2 is L2 AND x3 is N3 THEN y is C20 (21) R : IFx1 is H1 AND x2 is L2 AND x3 is H3 THEN y is C21 (22) R : IFx1 is H1 AND x2 is N2 AND x3 is L3 THEN y is C22 (23) R : IFx1 is H1 AND x2 is N2 AND x3 is H3 THEN y is C23 (24) R : IFx1 is H1 AND x2 is H2 AND x3 is L3 THEN y is C24 (25) R : IFx1 is H1 AND x2 is H2 AND x3 is N3 THEN y is C25 (26) R : IFx1 is H1 AND x2 is H2 AND x3 is H3 THEN y is C26. Physicians can provide their knowledge in medical science to label individual cases Cifor i = 7, 8, ..., 26. For example, the condition C26 with high body temperature, high blood pressure, and high heart rate might indicate hyperthyroidism; or the condition C20 with high body temperature, low blood pressure, and normal heart rate might indicate heat stroke

67 (a condition associated with prolonged exposure to heat). The membership function for a rule is calculated as a minimum of the membership of individual conditions, i.e., the membership functions of rules R(0), R(1), R(2) ,and R(3) are:

 (0) (x , x , x ) = min { (x ),  (x ),  (x )}, R 1 2 3 N1 1 N2 2 N3 3

 (1) (x , x , x ) = min {  (x ),  (x ),  (x )}, R 1 2 3 H1 1 N2 2 N3 3

 (2) (x , x , x ) = min {  (x ),  (x ),  (x )}, R 1 2 3 N1 1 H 2 2 N3 3

 (3) (x1 , x 2 , x 3 ) = min {  N (x1 ),  N (x2 ),  H (x3 )}, R 1 2 3 The membership functions for rules R(4) through R(26 )can be similarly establish according to their corresponding rules given earlier.

68

Figure 4.1 Definitions and membership functions of body temperatures, blood pressure and heart rate

4.3 Fuzzy Decision Making 4.3.1 General Discussion

69 Making decision is undoubtedly one of the most fundamental activities of human beings. We all are faced in our daily Life with verities of alternative actions available to as and, at least in some instance,decisionmaking has evolved into a respectable and rich field of study. The contain literature on decision making, based largely on theories and methodsdeveloped in this century, is enormous.The subject of decision making is, as the name suggests, the study of how decisions- arc actually made and how they can be made better or more successful. Applications of fuzzy sets within the field of decision making have, for the most part, consisted of fuzzifications of the classical theories of decision making. While decision making under conditions of risk have been modeled by probabilistic decision theories and game theories. Fuzzy decision theories attempt to deal with the vagueness and no specificity inherent in human formulation of preferences, constrains, and goals. Classical decision making generally deals with a set of alternative states of nature (outcomes, results), a set of alternative actions that are available to the decision maker, arelation indicating the state or outcome to be expected from each alternative action. Several classes of decision-making problems are usually recognized. According to one thereon, decision problems are classified as those involving a single decision maker and those which Involve several decision makers. These problem classes are referred to as individual decision making. 4.3.2 Individual Decision Making Fuzziness can be introduced into the existing models of decision models in various ways. In the first paper on fuzzy decision making, BelIm2n and Zadeh [1970) suggest a fuzzy model of decision making in which relevant goals and constraints are expressed in terms of fuzzy

70 sets, and a decision is determined by an appropriate aggregation of these fuzzy sets. Adecise situation in this model is characterized by the following components:  a set a of possible actions:

 a set of goalsGi (i ∈Nn), each of which is expressed in terms of a fuzzy set defined on A;

 a set of constraints Cj (j ∈Nn), each of which is also expressed by a fuzzy set defined on A.

Let be fuzzy sets defined on sets Xi and Yj respectively ,where iNn and j N . Assume that these fuzzy sets represent goals and constraints meaning of actions in set A in terms of sets Xi and Yj by functions gi : A → Xi ,

ci: A → Yi ,

And express goals Gi and constraints Ci by the composition of gi with

and the compositions of ci and that is ,

Gi (a)= (gi (a)),

Cj(a) = ( cj(a)) For each aA

Given a decision situation characterized by fuzzy sets A, Gi (i ∈Nn) and

Cj (j∈Nm) a fuzzy Decision D is conceived as a fuzzy set on A that simultaneously satisfies the given goals Gi and constraints Cjthat is ,

D(a) = min [ Gi(a) , Cj(a) ]

For all a A ,provided that the standard operator of fuzzy intersection is employed . Once a fuzzy decision has been arrived at, it may be necessary to choose the best single crisp alternative from this fuzzy set.

71 Since this method ignores information concerning any of other alternatives. Let us illustrate how it works by one simple example. Example 4.1 Suppose that an individual needs to decide which of four possible Jobs a1,a2,a3,a4 to choose his or her goal is to choose a job that offers a high salary under the constraints that the Job is interesting ,and close driving distance . In this case, A= { a1,a2,a3,a4} and the fuzzy sets involved represent the concepts of high salary , interesting job , and close driving distance . This concepts are highly subjective and context-dependent, and be defined by the individual h in a given context. The goal is expressed in monetary terms. According to our notation, we denote the fuzzy set expressing the goal by .A possible definitionof is given in Fig(a). To express the goal in termsof set A. we need a function g:A → R+, which assigns to each job the respective salary. Assume the following assignments:

g(a1) = S40.000,

g(a2) = S45.000,

g(a3) = S50.000,

g(a4) = S60.000.

72

Figure 4.2Fuzzy goal and constraint

This assignment is also shown in Fig4.2 .Composing now functions g and ,according to (4.2) we obtain the fuzzy set .

G= .11/a1+.3/a2+.48/a3+.8/a4 Which expresses the goal in terms of the available jobs in set A. The first constraint , requiring that the job be interesting is expressed directly in terms of set A is the identity function and C1 = Assume that the individual assigns to the four jobs in A the following membership grades in the fuzzy set of interesting jobs:

C1 = .4/a1+.6/a2+.2/a3+.2/a4

73 The second constraint , requiring that the deriving distance be close ,is expressed in terms of the deriving distance. We denote the fuzzy set expressing this constraint by .

C2(a1) = 27 miles,

C2(a2) = 75 miles,

C2(a3) = 12 miles,

C2(a4) = 2.5 miles.

By composing functions C2 and , we obtain the fuzzy set

C2 = .1/a1+.9/a2+.7/a3+1/a4 Which expresses the constrain in terms of fuzzy set A.We obtain the fuzzy set

D = .1/a1+.3/a2+.2/a3+.2/a4 Which represents a fuzzy characterization of the concept of desirable job.

4.3.3 Fuzzy Liner Programming The classical liner programming problem is fined the minimum or maximum values of a liner function under constraints represented by liner inequalities or equations . The most typicalliner programming problem is :

Minimize (or maximize) c1x1+c2x2+…..+cnxn

Subject to a11x1+a12x2+…..+a1nxn ≤ b1

a21x1+a22x2+…..+a2nxn ≤ b2 : :

am1x1+am2x2+……+amnxn ≤ bm

x1,x2,………xn 0 The function to be minimized (or maximized)is called an objective function ,let us denote it by z. The numbers ci (iNn )are called cost coefficients and the vector c =(c1,c2,…cn) is called cost vector .The matrix

A=[aij] where

74 I  Nm and jNn,is called a constraint matrix , and the vector b=

(b1,,...,bm) is called right –hand side simplified as Min Z=CX s.t AX ≤ b X  0 T Where X=(x1,x2,…xn) is a vector of variables and s.t stand for 'subject to ' The set of vectors X that satisfy all given constraints is called a feasible set . In many practical situations, it is not reasonable to require that the constraints or the objective function in linear programming problem be specified in precise , crisp terms, it is desirable to use some type of fuzzy liner programming . The most general type of fuzzy liner programming is formulated as follows .

n max Ci X j i1 n s.t Aij X i  Bi (i  N m ) i1

X j  0 (i  N n ),

Where Aij, Bi, Cj are fuzzy numbers, and Xj are variables whose states are fuzzy number we exemplify the issues involved by tow special cases of fuzzy linear programming problems. Case 1 . Fuzzy liner programming problems in which only the right –

Hand –Side numbers Biare fuzzy numbers:

n max ci x j j1 n s.t  aij xi  Bi (i  N m ) j1

x j  0 ( j  N n ),

75 Case 2 . Fuzzy linear programming problems in whish the right –hand side numbers Bi and the coefficient Aij of the constraint matrix are fuzzy numbers:

n max ci x j j1 n s.t Aij xi  Bi (i  N m ) i1

x j  0 ( j  N n ), In general fuzzy linear programming problems are first converted .(The final result s of a fuzzy linear programming) into equivalen crisp lineror non linear problems,which are then solved by standard methods.The final results offuzzy linear programming problemare thus real numbers,Which represent a compromise in terms of the fuzzy numbers involved.

In the first case fuzzy number Bi (i Nm) typically have the form

1 when x  bi  bi  pi  x Bi (x)   whenbi  x  bi  pi  pi  0 whenbi  pi  x1

Where x R for each vector x = (x1, x2,…xn), we first calculate the degree

Di(x), to which x statistics the ith constraint (I  Nm) by the formula

n Di (x)  Bi (aij x j ) j1

m n These degrees are Fuzzy sets on R , and their intersection,  Di , is a i1 fuzzy feasible set. Next, we determine the Fuzzy set of optimal values first. The lower bounds of the optimal values first. The lower bound of the optimal values, z1, is obtained by solving the standard linear programming problem:

76 max z  cx n s.taij x j  bi (i  Nm ) i1 X  0 ( j  N ), j n

The upper bound of the optimal values, zu is obtained by a similar linear programming problem in which each b, is replaced with bi+pi max z  cx n s.t a x  b  p (i  N )  ij j i i m i1

x j  0 ( j  Nn ), Then fuzzy set of optimal values, G, which is a fuzzy subset of Rn is defined by

1 when z  cx  u cx  zl G(x)   when zl  cx  zu  zu  zl 0 when cx  z  l

Now, the problem becomes the following classical optimization problem

max 

s.t. (zu  zl )  cx  zl n pi  aij x j  bi  pi (i  N m ) i1

x j  0 ( j  N n ) Example 4.2

Assume that a company makes two products. Product P1 has a S .40 per unit profit and productp2 has a S .30per unit profit . Each unit of product p1requires twice as many labor hours as each product p2. The total available labor hours are at least 500 hours per day and may possibly be extended to 600hours per day,due to special arrangements for overtime

77 work. The supply of material is at least sufficient for 400units of both products. P1 and P2 per day, but may possibly be extended to 500units per day according to previous experience. The problem is, how many units of products P1andP2 should be madeper day to maximize the total profit

Let x1,x2 denote the number of units of products p1,p2 made in one day,respectively

max z  .4x1  .3x2 ( profit) s.t.x  x  B (material) 1 2 1 2x1  x2  B2 (labor hours)

x1 , x2  0,

Where B1 is defined by 1 when x  400  500  x `B1 (x)   when 400  x  500  100 0 when500 x,

And B2 is defined by 1 when x  500  600  x B2 (x)   when500 x  600  100 0 when 600  x

First we need to calculate the lower and upper bounds of the objective function. By solving the following two classical linear programming problems, we obtain z1= 130 and zu = 160

78 (P1 ) max z  .4x1  .3x2

s.t x1  x2  400

2x1  x2  500 x , x  0 1 2 (P2 ) max z  .4x1  .3x2

s.t x1  x2  500

2x1  x2  600

x1 , x2  0 Then, the fuzzy linear programming problem becomes: max 

s.t.30-(.4x1 + .3x2)  -130

100 + x1 + x2 500

100 + 2x2 + x2 600

x1, x2,  0 solving this classical optimization problem we find that the maximum, ~ ~  = 0.5, is obtained x1 100, x2  350 . The maximum profit, z, is then calculated by ~ ~ ~ z  .4x1 .3x2 145 Let us consider now the more general problem of fuzzy linear programming defined. In this case, we assume that all fuzzy numbers are triangular. Any triangular fuzzy number A can be represented by three real numbers s,l,r whose meaning are defined. Using this representation, we write A= (s,l,r). the problem can then be rewritten as follows:

M max ci x j j1 n s.t. (sij ,lij ,ri )xij  (ti ,ui ,vi ) (i N m ) j1

x j  0 ( j  N n )

Where Aij = (Sij, lij, rij) and Bi = (ti, ui, vi) are fuzzy numbers. Summation and multiplication are operations on fuzzy numbers, and the partial order  is defined by A  B iff MAX (A, B) = B. It is easy to prove that for any

79 two triangular fuzzy numbers A = (S1, li. r1) and B = (S2, l2, r2), A  B iffS1 S2, S1 – l1 S2 – l2 and S1 + r1 S2 + r2. Moreover, (s1, l1, r1) + (S2, l2, r2) = (s1+ s2 ,l1 + l2, r1 + r2) and (S1, l1, r1)x = (s1x, lix,r1x) for any non negative real number x. then, the problem can be rewritten as

M max ci x j j1 n s.t.  sij x j  ti j1 n (Sij  I ij )x1  ti  u1 j1 n (Sij  rij )x1  ti  v1 (i  N m ) j1

x j  0 ( j  N n )

However, since all numbers involved are real numbers, this is a classical linear programming problem.

Example 4.3 Consider the following fuzzy linear problem:

max z = 5x1+4x2

s.t (4, 2, 1)x1+ (5, 3, 1)x2  (24,5,8)

(4, 1, 2)x1 + (1, .5, 1)x2  (12, 6, 3)

x1, x2 0 we can rewrite it as

max z = 5x2 + 4x2

s.t 4x1 + 5x2 24

4x1+x2 12

2x1 + 2x2 19

3x1 + 0.5x2 6

5x1 + 6x2 32

80 6x1 + 2x2 15

x1, x2 0.

Solving the problem we obtain xˆ1 1.5, xˆ2  3zˆ 19.5 Notice that if we defuzzified the fuzzy numbers in the constrains of the original problem by the maximum method we obtain another classical linear programming problem:

max z = 5x1 + 4x2

s.t 4x1 + 5x2 24

4x1 + x2 12

x1 , x2  0 A classical linear programming problem with a smaller number of constrains that the one converted from a fuzzy linear programming problem.

81

Chapter Five 5.1 Conclusion In this study , Fuzzy logic is very important in real life situations , and it's allows the imprecise linguistic terms such as fuzzy predicate , fuzzy quantifier…Etc.Compared to the real life applications for the medical device for measuring the blood pressure , heart rate and body temperature in one medical device, we describe it mathematically are

three variables as x1 ,x2 andx3. Fuzzy logic provide foundations for approximate reasoning using imprecise propositions based on fuzzy set theory. It’s also contributed in the decision making by enabling individuals to take the optimal decision.

82 5.2 Recommendation

The study recommended more concern with further studying fuzzy logic because it is very important in real live and striving for its development and expanding its usages.

83 REFERENCES

[1] G . chen and Trung Tat pham , ''Introduction to Fuzzy sets , Fuzzy Logic and Fuzzy control systems'',2001. [2] A . Kaufmann and M . M Gupta " Introduction Fuzzy arithmetic Theory and Applications ", (1991). [3] G . J . Klir , U . H . st . clair , and B. Yuan " Fuzzy set Throey Foundations and Applications " (1997). [4] C. R. Asfahl. Robots and Manufacturing Automation. New York,NY: Wiley (1985); and 2nd ed. (1992). [5] G. J. Klir, U. H. St.Clair, and B. Yuan. Fuzzy Set Theory: Foundations and Applications. Upper Saddle River, NJ: Prentice-Hall PTR (1997). [6] G. J. Klir and T. A. Folger. Fuzzy Sets, Uncertainty, and Information. Englewood Cliffs, NJ: Prentice-Hall (1988). [7] L. X. Wang. Adaptive Fuzzy Systems and Control: Design andStability Analysis. Englewood Cliffs, NJ: Prentice-Hall (1994). [8] H. J. Zimmermann. Fuzzy Set Theory and Its Applications (2ndEdition). Boston, MA: Kluwer Academic Publishers (1991). [9] K. Tanaka. An Introduction to Fuzzy Logic for PracticalApplications. New York, NY: Springer (1996).

84 75

[10] Kwang H . Lee " First Course on Fuzzy Theory and Applications " (2005). [11] Li – xin Wang " Acoursein Fuzzy Systems and Control " (1997). [12] Grorge J – Klir and Bo Yuan " Fuzzy sets and Fuzzy Logic Theory and Applications " (1995). [13] Timothy J- Roos" Fuzzy Logic with Engineering Applications " (2010). [14] Franck Dernon Court " Introduction Fuzzy Logic " (2013) [15]M. Canesh Introduction to Fuzzy Set and Fuzzy Logic 2006., [16] George.B.and Maria .Fuzzy Set, Fuzzy Logic Applications.(1995). [17] H.T.Nguyen and E.A.Walker.AFirst Course in Fuzzy Logic,(1997). [18] L.A Zedah ,Fuzzy Set Information and control,(1965). [19] Adom Hilger, Fuzzy Set and their Applications,(1989).

76

85