You are on page 1of 88
Artificial Intelligence (AEE 4950) Dr Eldaw Eldukhri (eeldukhri@ksu.edu.sa, Room $114) College of Applied Engineering, King Saud University Muzahimiyah Campus Semester 2, Academic Year 1445 (2023/24) Artificial Intelligence — AEE 4510 Course Information: * Course title and code: artificial Intelligence (AEE 4510) * Credit hours: 3(2,1,2) * Level at which the course is offered: 10" Level * The course is elective for both electrical and mechanical students. * Pre-requisite: “ Automatic Control (MEE 3520) Artificial Intelligence — AEE 4510 Learning Resources * Textbook: >The course spans a variety of Al topics. No single book exists to meet the needs. The course will, therefore, rely on selected topics in the form of handouts. * Recommended References: Internet reliable resources and professional sites in the area of Al. Artificial Intelligence — AEE 4510 Topics to be covered TOT Al definition Al motivational example applications ; 7 Fuzzy linguistic variables and operators 1 Fuzzy inference mechanism 1 The biological neuron 1 The artificial neuron/perceptron 1 Neural Networks architecture 1 RRAAA DOr Eldaw eldukhri(eldukhri@ksu edu-sa, htp://facksu edu sa/eelduktr, Room si) college of Artificial Intelligence — AEE 4510 Topics to be covered (continued) Topi INT Sa elu e-Lad of Weeks | Hours Supervised neural networks 1 4 Additional issues on neural network design and training a The Genetic Algorithm overview 1 4 GA operators 1 4 GA example 1 4 Artificial Intelligence — AEE 4510 Course Components: hours per week — 2hoursperweek hour perweek _ 5 hours per week Additional private studying/learning hours expected from the student: 6 hours/week Artificial Intelligence — AEE 4510 Schedule of Assessment et ets 7 uu Assignments (3 — average mark) End of weeks 3, 7 and 12 15% Quizzes (5 — average mark) Weeks 4, 6, 8, 10 and 13 15% Mid-term exam Week 9 30% Final exam As planned by the registry 40% Dr eldaw elduth (eldukhri@kcu ecu sa, http://fa keu.edu.s/eelduktr, Room $424) College of Applied Engineering, KSU, Musahimiyah campus 7 Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * The Fuzzy Logic, introduced in 1965 by Lotfi Zadeh, is a mathematical tool for dealing with uncertainty. * It offers the important concept of computing with “words”. * It provides a technique to deal with imprecision and information granularity. * The fuzzy theory provides a mechanism for representing linguistic constructs such as: >“many,” “low,” “medium, * In general, the fuzzy logic provides an inference structure that enables appropriate human reasoning capabilities. ‘often,” “few.” Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * On the contrary, the traditional binary set theory describes crisp events, > events that either do or do not occur. * It uses probability theory to explain if an event will occur, > measuring the chance with which a given event is expected to occur. * The theory of fuzzy logic is based upon the notion of relative graded membership and so are the functions of mentation and cognitive processes. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * The utility of fuzzy sets lies in their ability to model uncertain or ambiguous data. * Fig. 1.1 below is so often encountered in real life. imprecise data Vague statements Fig. 1.1 Decisions —> A fuzzy logic system which accepts imprecise data and vague statements such as low, medium, high and provides decisions. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * Zadeh was concerned with the rapid decline in information afforded by traditional mathematical models as the complexity of the target system increased. * As he stressed, with the increasing of complexity our ability to make precise and yet significant statements about the system’s behaviour diminishes. * Real-world problems (situations) are too complex, and the complexity involves the degree of uncertainty. » As uncertainty increases, so does the complexity of the problem. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * Traditional system modelling and analysis techniques are too precise for such problems (systems). * In order to make complexity less daunting we introduce: > appropriate simplifications, assumptions, etc. (i.e., degree of uncertainty or Fuzziness) to achieve a satisfactory compromise between: “the information we have and “the amount of uncertainty we are willing to accept. * In this aspect, fuzzy systems theory is similar to other engineering theories, because » almost all of them characterize the real world in an approximate manner. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions The Uses of Fuzzy Logic: * Fuzzy systems can be used for: > estimating, » decision-making, and » mechanical control systems such as: “eair conditioning, automobile controls, “smart” houses, as well as “sindustrial process controllers and a host of other applications. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * Fuzzy sets provide means to model the uncertainty associated with vagueness, imprecision, and lack of information regarding a problem or a plant, etc. * Consider the meaning of a “short person.” * For an individual X, the short person may be one whose height is below 4’2”. * For other individual Y, the short person may be one whose height is below or equal to 3’9”. * This “short” is called as a linguistic descriptor. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * The term “short” informs the same meaning to the individuals X and Y, but it is found that they both do not provide a unique definition. * The term “short” would be conveyed effectively, only when a computer compares the given height value with the pre-assigned value of “short.” * This variable “short” is called as linguistic variable, which represents the imprecision existing in the system. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * The uncertainty is found to arise: >from ignorance, >from chance and randomness, > due to lack of knowledge, >from vagueness (unclear), like the fuzziness existing in our natural language. * Zadeh proposed the set membership idea to make suitable decisions when uncertainty occurs. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * Consider the “short” example discussed previously. * If we take “short” as a height equal to or less than 4 feet, then: »3’9” would easily become the member of the set “short” and »4’2” will not be a member of the set “short.” * The membership value is: > “1” if it belongs to the set or »“O" if it is not a member of the set. * Thus membership in a set is found to be binary i.e., >the element is a member of a set or not. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions * It can be indicated as: 1xEA Xa) = {ox é a » Where X,(x) is the membership of element x (height) in set A and » A (short) is the entire set on the universe. * This membership was extended to possess various “degree of membership” on the real continuous interval [0,1]. * Zadeh formed fuzzy sets as the sets on the universe X which can accommodate “degrees of membership.” Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Conventional Sets: * Aset is any collection of objects which can be treated as a whole. * The terms set, collection and class are synonymous, just as the terms: > Item, element and member. * Almost anything called a set in ordinary conversation is an acceptable set in the mathematical sense. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Conventional Sets: Example 1: The following are well defined lists or collection of objects, and therefore entitled to be called sets: a) The set of non-negative integers less than 4, is a finite set with four members: 0, 1, 2 and 3. b) The set of live dinosaurs in the basement of the British Museum. This set has no members, and is called an empty set. c) The set of measurements greater than 10 volts/Newtons. Even though this set is infinite, it is possible to determine whether a given measurement is a member or not. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: * Zadeh generalized the idea of a crisp set by extending a valuation set {1, 0} (definitely in/definitely out) to >the interval of real values (degrees of membership) between 1 and 0 denoted as [0,1]. * Therefore, a fuzzy set, unlike conventional sets, includes all elements of the universal set of the domain but with varying membership values in the interval [0,1]. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 2 «lf “tall’ is a set defined as heights equal to or greater than 6 feet, >A computer would not recognize an individual of height 5’11.999” as being a member of the set “tall.” * But how do we assess the uncertainty in the following question: > Is the person nearly 6 feet tall? * The uncertainty in this case is due to the vagueness or ambiguity of the adjective nearly. *A5’11” person could clearly be a member of the set of “nearly 6 feet tall’ people. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 2 * The degree to which the person approaches a height of 6 feet is fuzzy. In reality, “tallness” is a matter of degree and is relative. * So, 6 feet can be tall in one context and short in another. In the real (fuzzy) world, the set of tall people can overlap with the set of not-tall people, > an impossibility when one follows the principles of classical binary logic. * This notion of set membership, then, is central to the representation of objects within a universe by sets defined on the universe. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 2 * Classical sets contain objects that satisfy precise properties of membership. * Fuzzy sets contain objects that satisfy imprecise properties of membership, i.e., >» membership of an object in a fuzzy set can be approximate. * For example, the set of: >heights from 5 to 7 feet is precise (crisp); > heights in the region around 6 feet is imprecise, or fuzzy. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 2 * Suppose set A is the crisp set of all people with 5.0 < x < 7.0 feet, shown in Fig. 2a. * A particular individual, x,, has a height of 6.0 feet. * The membership of this individual in crisp set A is equal to 1, or full membership, given symbolically as X,(x,) = 1. * Another individual, say, x2, has a height of 4.99 feet. * The membership of this individual in set A is equal to 0, or no membership, hence X,4(x2) = 0, also seen in Fig. 2a. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 2 «In these cases the membership in a set is binary, either an element is a member of a set or it is not. A ss 5 6 7 Fig. 2a Height membership function for a crisp set A. (a) Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: * Zadeh extended the notion of binary membership to accommodate various “degrees of membership” on the real interval [0, 1], where: >the endpoints of 0 and 1 conform to no membership and full membership, respectively. * However, the i ite number of values in between the endpoints can represent various degrees of membership for an element x in some set on the universe. * The sets on the universe X that can accommodate “degrees of membership” were termed by Zadeh as “fuzzy sets.” Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 3 * Continuing further on the example on heights, consider a set H consisting of heights near 6 feet. * Since the property near 6 feet is fuzzy, there is not a unique membership function for H. + Rather, the analyst must decide what the membership function, denoted Uy, Should look like. Plausible properties of this function might be: 1) normality (4,(6) = 1), 2) monotonicity (the closer H is to 6, the closer fy, is to 1), and 3) symmetry (numbers equidistant from 6 should have the same value of jj). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 3 * Such a membership function is illustrated in Fig. 2b. Fig. 2b Height membership function For a fuzzy set A. (b) Oa crisp set has a unique membership function, whereas, >a fuzzy set can have an infinite number of membership functions to represent it. * For fuzzy sets, the uniqueness is sacrificed, but > flexibility is gained because the membership function can be adjusted to maximize the utility for a particular application. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Comparison between Crisp Sets and Fuzzy Sets: * Crisp sets only handle Os and 1s. * Fuzzy sets handle all values between 0 and 1. * Crisp: >No, Yes. ° Fuzzy: >No, Slightly, Somewhat, Maybe, Small, Short, Low, >A Few, Mostly, Yes, Absolutely, Big, Tall, High. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 4 «In this example we want to describe the set of young people. i.e., >B = {set of young people]. * Since, in general age starts at 0, the lower range of this set is clear. * At a first attempt we set the upper range to, say, 20 years. * Therefore, we get B as a crisp interval, namely: > B=[0,20]. * Now, why someone right after his 20% birthday is not young? * A natural way to construct the set B would be to relax the strict separation between young and not young. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 4 * This is achieved as follows: * The membership function g(x = age) = [0,1] where: »0 means not young — element x is definitely not in the set B. »1 means young — element x is definitely in the set B. >All other values (x > 20) mean a gradual membership to the set B. * We now show graphically the representation of the fuzzy set of young people by its characteristic (membership) function yg. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 4 O 20 ___— Gradual membership - Fuzzy os| ° Ree It is obvious that a 25 years old person would still be young to a degree of 50%. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 5 X (Universe of Discourse) * From a two-dimensional perspective, > Point a in Fig. 3a is clearly a member of crisp set A; A > point b is unambiguously not a member of set A. eb Fig. 3a Crisp set Boundary Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 5 * Figure 3b shows the vague, ambiguous boundary of a fuzzy set A on the same universe X: * the shaded boundary represents the boundary region of A. In the central (unshaded) region of the fuzzy set, point a is clearly a full member of the set. Fig. 3b Fuzzy set Boundary X (Universe of Discourse) Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 5 * Outside the boundary region of the fuzzy set, point b is clearly nota member of the fuzzy set. * However, the membership of point c, which is on the boundary region, is ambiguous. Fig. 3b Fuzzy set Boundary X (Universe of Discourse) SS é S Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 5 olf complete membership in a set (such as point a in Fig. 3b) is represented by the number 1, and »no-membership in a set (such as point b in Fig. 3b) is represented by 0, then > point c in Fig. 3b must have some intermediate value of membership (partial membership in fuzzy set A) on the interval [0,1]. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Fuzzy Sets: Example 5 * Presumably X (Universe of Discourse) * the membership of point c in A approaches a value of 1 as it moves closer to the central (unshaded) region of A, and * the membership of point c in A approaches a value of 0 as it moves closer to leaving the boundary region of A. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: + Auseful attribute of sets and the universes on which they are defined is a metric known as the cardinality, or the cardinal number. * The total number of elements in a universe X is called its cardinal number, denoted n,, where x again is a label for individual elements in the universe. * Discrete universes that are composed of a countably finite collection of elements will have a finite cardinal number. * Continuous universes comprised of an infinite collection of elements will have an infinite cardinality. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * Collections of elements within a universe are called sets, and collections of elements within sets are called subsets. * Sets and subsets are terms that are often used synonymously, since any set is also a subset of the universal set X. * The collection of all possible sets in the universe is called the whole set. * For crisp sets A and B consisting of collections of some elements in X, the following notation is defined: Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: xexX > x belongs to X xeA > x belongs to A x ZA > x does not belong to A * For sets A and B on X, we have: ACB > ACB => A is fully contained in B (if x € A, then x € B) (A @ B) => A is contained in or is equivalent to B A C Band B C A (A is equivalent to B) Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * We define the null set, 0, as the set containing no elements, and >the whole set, X, as the set of all elements in the universe. * The null set is analogous to an impossible event, and >the whole set is analogous to a certain event. * All possible sets of X constitute a special set called the power set, P(X). * For a specific universe X, the power set P(X) is enumerated in the following example. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 6 + If we have a universe comprised of three elements, X = {a, b, c}, then: * The cardinal number is n, = 3. * The power set is: P(X) = {A, {a}, {b}, {c}, {a b}, {a,c}, {b,c}, {a. b, c}} * The cardinality of the power set, denoted Np), is found as: n = 2% =23=8 P(X) = Sas * Note that if the cardinality of the universe is infinite, then the cardinality of the power set is also infinity, i.e., ny = co=>Npcx) = ~. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * Let A and B be two sets on the universe X. * The union between the two sets, denoted AUB, represents all those elements in the universe that reside in (or belong to): >the set A, >the set B, or > both sets A and B. * The intersection of the two sets, denoted ANB, represents all those elements in the universe X that simultaneously reside in (or belong to) both sets A and B. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * The complement of a set A, denoted A, is defined as the collection of all elements in the universe that do not reside in the set A. * The difference of a set A with respect to B, denoted A|B, is defined as the collection of all elements in the universe that reside in A and that do not reside in B simultaneously. * These operations are shown below in set-theoretic terms. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Union AUB= {x |x €Aorx € B} Intersection ANB= {x |x € Aand x € B} Complement R= (x |x ¢A,x eX} Difference A|B={x|x €Aandx ¢B} * These four operations are shown next in terms of Venn diagrams (shaded area). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: pT Union of Sets A and B. Intersection of Sets A and B. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: P| Complement of Set A. Difference Operation A|B. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: . Commutativity: | HoRUA ANB=BNA AU(BUC) = (AUB)UC AN(BNC) =(ANB)NC * Associativity: * Distributivity: 4 (Bq c) =(AUB)N (AUC) AN (BUC) =(ANB)U(ANC) *ldempotency: ayaa _ANASA Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * Identity: AU#=A ANX=A ANH=H AUX=X * Transitivity: IfA CBandBCC,thenA CC * Involution: A=A * Some of these operations area shown next (double-crossed-hatched areas). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * Identity: AU#=A ANX=A ANH=H AUX=X * Transitivity: IfA CBandBCC,thenA CC * Involution: A=A * Some of these operations are shown next (double-crossed-hatched areas). Artificial Intelligence — Fuzzy Sets and Mem AEE 4510 bership Functions Properties of Sets: (ANB)NC AY U2 AN (BNC) (a) (b) Venn diagrams for (a) (ANB) NC and (b) AN (BNC). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: (AUB)NC (ANC) U(BNC) (a) Venn diagrams for (a) (A UB) NC and (b) (ANC) U(BNC). (b) Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: (ANB)UC (AUC) 9 (BUC) es Res RR KEREREY SERS (a) (b) Venn diagrams for (a) (AM B) UC and (b) (AUC) (BUC). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: * De Morgan’s principles: _ ANB=AUB AUB=ANB * In general, De Morgan’s principles can be stated for n sets, as provided here for events, E;: E) UE) U---UE, E,NE:N--- NE, E) NE) N-+- En = Ey UE} U---UEy * De Morgan’s principles operations are shown next (grey-shaded areas). Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: De Morgan’s principle (A 1 B). De Morgan’s principle (A U B) Or Bde Eth feelcuthe@iauedse, pec oor S12) Cage a ppied Engineering ISU Muza Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 6: * A shallow arch consists of two slender members as shown in Fig. 4. Loa ¢ If either member fails, then | >the arch will collapse. ¢ If Ey = survival of member 1 and * E2 = survival of member 2, then ~ > survival of the arch = E,NEz, and, ' rch members > conversely, collapse of the arch = E, Ep. Fig. 4. A two-member arch Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 6: * Logically, collapse of the arch will occur if > either of the members fails, i.e., when EyUE3. * Therefore, E, NEp E| UE) * Which is an illustration of De Morgan’s principle. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 7: ¢ For purposes of safety, the fluid supply for a hydraulic pump C in an airplane comes from two redundant source lines, A and B. * The fluid is transported by high-pressure hoses consisting of branches 1, 2, and 3, as shown in Fig. 5. Source line A Operating specifications for the pump indicate that either source line alone is capable of supplying the necessary fluid pressure to the pump. Pump Junction Fig. 5. Hydraulic Hose System a Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 7: * Denote: > E, = failure of branch 1, > Ez = failure of branch 2, and > E3 = failure of branch 3. *Then > insufficient pressure to operate the pump would be caused by (E,NE,)U E3, and > sufficient pressure would be the complement of this event. Artificial Intelligence — AEE 4510 Fuzzy Sets and Membership Functions Properties of Sets: Example 7: * Using De Morgan’s principles, we can calculate the condition of sufficient pressure to be: a (E; NE) UE; = (E; UE3) NE; in which, > (E,UE2) means the availability of pressure at the junction, and >E3 means the absence of failure in branch 3.

You might also like