Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science & Engineering Shiraz University Artificial Intelligence.

Similar presentations


Presentation on theme: "Computer Science & Engineering Shiraz University Artificial Intelligence."— Presentation transcript:

1 Computer Science & Engineering Shiraz University Artificial Intelligence

2 365 4 8 1 27732 5 1 4 8 6 Game of 8 How can we solve Game Of 8 with minimum number of movements? The answer can be a sequence of movements.

3 Program input can be a 3 by 3 Matrix Input = [[3, 7, 2], [1, 4, 0], [8, 5, 6]] ظ 36548127 Game of 8 Output can be a list representing movements of the empty place Output = [‘up’, ‘right’, ‘down’, …, ‘left’, ‘up’] >>> def find_answer(input, target): “returns a sequence of movements” Goal = [[7, 8, 0], [4, 5, 6], [1, 2, 3]]

4 What is AI ? Making computers to act Intelligently What is Intelligence ? (Russell and Norvig 1995)‏ – Thinking like humans – Acting like humans – Thinking rationally – Acting rationally

5 What are factors of Intelligence ? Understanding Reasoning Problem Solving Learning Common Sense Generalizing Inference Analogy Recall Intuition Emotion Self-awareness

6 The Turing Test Proposed by Alan Turing in 1950 to provide a definition of intelligent behaviour. – The computer is interrogated by a human via a teletype – it passes the test if the interrogator cannot identify the answerer was computer or human

7 The Turing Test Requirements Natural language processing – Communicating with human; understanding sentences Knowledge representation – Storing facts and information Automated reasoning – Concluding new facts using from existing facts Machine learning – Using experiences – Acting rationally in new situations – Recognizing patterns

8 The Total Turing Test adding to the agent a video interface and an acting arm it necessitates: 1- Machine Vision 2- Robotics

9 Some examples of AI related topics Playing Chess with human Solving a Geometric Problem Selecting fastest way to destination Vision Traffic Controlling Automatic Conversation Pattern recognition Robot Controlling Deriving Proof of Mathematical theorems Symbolic Calculation Weather forecasting Disease diagnosis Symbolic erentiation and integration from mathematical expressions

10 Foundations of AI Philosophy (Dualism vs. Materialism)‏ Mathematics (Computation, Logic, Probability)‏ Linguistics (Understanding and Analysis of Languages)‏ Computer Science (provides and tools : programmability, speed, storage, actions)‏ Psychology (The brain processes, study of human Behaviors)‏ Cognitive Sciences Neurology/Biology Engineering...

11 Some Examples

12 3654812773251486 Game of 8 How can we solve Game Of 8 with minimum number of movements? The answer can be a sequence of movements.

13 DCFAEZGB 32km 30km 55km 17km 26km 40km 31km 18km 20km 33km 35km We want to go from city 'A' to 'Z' through shortest possible path The answer can be sequence of city names

14 Problem Solving using Search Searching: Testing all possible states to find an appropriate solution. In many cases Search problems have a close relation with Trees

15 36548127 3 65 4 8 1 2 7 3 6 5 4 8 1 27 3 65 4 8 1 273 65 4 8 1 2 7 3 6 5 4 8 1 27

16 Game Playing We can design game playing programs using search methods So, we should visit all possible states which can occur in a game. But like many search problems, there are methods to reduce the search states (eliminates some states having no effect on search solutions)

17 X X X X X... X O XOX O X O X O X O X O X O O X X X O X O X X X O O

18 Some other examples

19 Find maximum of the functions : f(x) = x e^(1-x^2) - e^x log x f(x, y) = x^(log y – y) + y^(x^2 – 1)‏ f(x1, x2, x3,..., x100) =...

20 If age of Ali is 3 times greater than age of his brother plus 1, and age of his brother is ¼ of age of Ali then find age of Ali and his brother. Can ordinary search methods be used to solve the above problem? Reasonable steps to solve the problem: Getting and storing the text Analyzing text and extracting necessary information. Converting the information to suitable mathematical form Solving the equations and finding unknown variables

21 In ABC we know AB = AC A B C Are angles B and C equal? Print steps of the proof How to pose this problem for computer? Computer would search for a sequence of inference proves the fact Using a geometric model can ease the process.

22 Write a program to simplify simple expressions >>> def simplify(expr): : >>> simplify(“(a + b) (a – b)”)‏ “a^2 – b^2” >>> simplify(“(a-b) (a+b) (a^2 + b^2) + a^4 + b^4”)‏ “2 a^4” >>> simplify(“(a + b)^2 – (a - b)^2”)‏ “4 a b”

23 Write a program to differentiate simple mathematical expressions: >>> def diff(expr, resp): : >>> diff(‘2 x^2 – x + 4’, ‘x’)‏ “4 x - 1” >>> diff(‘(x - a)^2’, ‘x’)‏ “2 x – 2 a” >>> diff(‘y sin (y^2)’, ‘y’)‏ “sin (y^2) + 2 y^2 cos(y^2) ”

24 Write a program to calculate integration: >>> def integrate(expr, resp): : >>> integrate(‘6 x + 4’, ‘x’)‏ “3 x^2 + 4 x + C” >>> integrate(‘x + sin x’, ‘x’)‏ “0.5 x^2 - cos x + C” >>> integrate(‘y sin (y^2)’, ‘y’)‏ “- 0.5 cos (y^2) + C” >>> integrate(‘x sin x’, ‘x’)‏ “- x cos x + sin x + C”

25 Stages to solve such problems Assume we are going to simplify “(x-y) (x+y)” 1- Transform the expression in the form dealing with which is more convinient: For example in this case we can convert it to: [[‘x’, ‘y’, ‘-’], [‘x’, ‘y’, ‘+’], ‘*’] 2- Simplify according to some rules and algorithms [[‘x’, 2, ‘^’], [‘y’, 2, ‘^’], ‘-’] 3- Convert simplified expression to strings “x^2 – y^2”

26 Write a program who could solve simple differential equations >>> def solve(equation, indep_var, dep_var): : >>> solve(”y = y’ “, ‘x’, ‘y’)‏ “A e^x” >>> solve(‘ y’’ – y’ = 2 sin x’, ‘x’, ‘y’)‏ “A e^x + B + cos x – sin x”

27 to ?is like to Analogy 12345

28 Examples of Logic Suppose we have the following facts All habitants of “Bal Island” are exactly truthful or lier A, B, C are habitants of Bal island A says: “All of us are lier” B says: “At least one of us is lier” Each of A, B, C are lier or truthful ? (-> algorithmic puzzles, Mohammad Ghodsi, Fatemi Publication)‏

29 Examples of Logic We can solve this problem using search In this case we should try 8 (=2 3 ) cases For example (A is lier, B is truthful, C is lier)‏ But if we had 100 persons we should search 2 100 states (2 100 = 1267650600228229401496703205376)‏ This is practically impossible

30 Problem Solving Using Logic We can solve some of problems using logical conclusions (reasoning)‏ By logical reasoning we can obtain new facts from existing facts Reasonings can be done according to logical roles in mathematics

31 Suppose we have following facts Kamran is a student All students are humans All students like learning Know we can conclude following facts Kamran is a human Kamran like learning A human likes learning OR is not a student An Example of Logical Reasoning Suppose we have following facts Kamran is a student All students are humans All students like learning Know we can conclude following facts Kamran is a human Kamran like learning A human likes learning OR is not a student

32 Knowledge Representation Before working with the data we should be able to represent and store them in computer. There are many ways for representing information in computers, example: Ali is tall -> tall(Ali)‏ Ali is bigger than Reza -> bigger(Ali, Reza)‏ Ali is brother of Reza->Ali = brotherOf(Reza)‏ Ali is tall and Reza is not fat ->tall(Ali) AND (NOT fat(Reza))‏ If Ali is a human then he can speak ->human(Ali) => canSpeak(Ali)‏ All humans are Male or Female -> for all x : human(x) => Male(x) OR Female(x)‏

33 Fuzzy Logic Assume following predicates : My bag is at home. My book is in my bag. My brother is taller than me They are exactly True or False. So we can have some conclusions : IF (My bag is at home) AND (My book is in may bag) THEN (My book is at home)‏

34 Fuzzy Logic We want to perform conclusions on the knowledge obtained from the real world But some or most of facts in the real word are not decisive (are not exactly true or false)‏ Look the facts below: Ali is tall. The weather is hot. My book is large. It is about 2 meters high.

35 Fuzzy Logic Fuzzy Logic suggests a solution In fuzzy logic facts are not exactly true or false they instead have degree of truth If we denote true by '1' and false by '0' then truth of a fact can be a number between '0' and '1'. For example truth of “Ali is tall” can be '0.9' We can define 'AND', 'OR', 'NOT' and '=>' in fuzzy logic such as ordinary logic.

36 Fuzzy Logic Fuzzy Logic was created by “Dr. Lotfi Zhdeh” in 1960 for the purpose of modeling uncertainty inherent in Natural Language Representing vague and often contradictory knowledge. Fuzzy logic is primarily used as the underlying logic of fuzzy expert systems

37 Fuzzy Logic Example of Fuzzy Logic applications : Pattern Recognition Control (Fuzzy Controllers)‏ Weather forecasting Economics Politics

38 other fields of AI Evolutionary Computation (Genetic Algorithms,...)‏ Artificial Neural Networks Robotics Expert Systems Image Processing and Machine Vision Data Mining...


Download ppt "Computer Science & Engineering Shiraz University Artificial Intelligence."

Similar presentations


Ads by Google