























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























1.3.2.1 Toy problems 1.3.2.2 Real world problems
1.3.4.1 Breadth-first search
1.3.4.2 Uniform-cost search 1.3.4.3 Depth-first search 1.3.4.4 Depth limited search 1.3.4.5 Iterative-deepening depth first search 1.3.4.6 Bi-directional search 1.3.4.7 Comparing uninformed search strategies
1. Introduction to AI
Artificial Intelligence is the branch of computer science concerned with making computers behave like humans. Major AI textbooks define artificial intelligence as "the study and design of intelligent agents," where an intelligent agent is a system that perceives its environment and takes actions which maximize its chances of success. John McCarthy, who coined the term in 1956, defines it as "the science and engineering of making intelligent machines,especially intelligent computer programs." The definitions of AI according to some text books are categorized into four approaches and are summarized in the table below :
Systems that think like humans “The exciting new effort to make computers think … machines with minds,in the full and literal sense.”(Haugeland,1985)
Systems that think rationally “The study of mental faculties through the use of computer models.” (Charniak and McDermont,1985)
Systems that act like humans The art of creating machines that perform functions that require intelligence when performed by people.”(Kurzweil,1990)
Systems that act rationally “ Computational intelligence is the study of the design of intelligent agents.”(Poole et al.,1998)
The four approaches in more detail are as follows :
An agent is something that acts. Computer agents are not mere programs ,but they are expected to have the following attributes also : (a) operating under autonomous control, (b) perceiving their environment, (c) persisting over a prolonged time period, (e) adapting to change. A rational agent is one that acts so as to achieve the best outcome.
The various disciplines that contributed ideas,viewpoints,and techniques to AI are given below : Philosophy(428 B.C. – present) Aristotle (384-322 B.C.) was the first to formulate a precise set of laws governing the rational part of the mind. He developed an informal system of syllogisms for proper reasoning,which allowed one to generate conclusions mechanically,given initial premises.
Computer Human Brain
Computational units Storage units
Cycle time Bandwidth Memory updates/sec
1 CPU,10^8 gates 1010 bits RAM 1011 bits disk 10 -9^ sec 1010 bits/sec 10 9
1011 neurons 1011 neurons 1014 synapses 10 -3^ sec 1014 bits/sec 10 14
Table 1.1 A crude comparison of the raw computational resources available to computers( circa 2003 )
and brain. The computer’s numbers have increased by at least by a factor of 10 every few years. The brain’s numbers have not changed for the last 10,000 years.
Brains and digital computers perform quite different tasks and have different properties. Tablere 1. shows that there are 10000 times more neurons in the typical human brain than there are gates in the CPU of a typical high-end computer. Moore’s Law predicts that the CPU’s gate count will equal the brain’s neuron count around 2020.
Psycology(1879 – present) The origin of scientific psychology are traced back to the wok if German physiologist Hermann von Helmholtz(1821-1894) and his student Wilhelm Wundt(1832 – 1920) In 1879,Wundt opened the first laboratory of experimental psychology at the university of Leipzig. In US,the development of computer modeling led to the creation of the field of cognitive science. The field can be said to have started at the workshop in September 1956 at MIT.
Computer engineering (1940-present) For artificial intelligence to succeed, we need two things: intelligence and an artifact. The computer has been the artifact of choice. A1 also owes a debt to the software side of computer science, which has supplied the operating systems, programming languages, and tools needed to write modern programs
Control theory and Cybernetics (1948-present) Ktesibios of Alexandria (c. 250 B.c.) built the first self-controlling machine: a water clock with a regulator that kept the flow of water running through it at a constant, predictable pace. Modern control theory, especially the branch known as stochastic optimal control, has as its goal the design of systems that maximize an objective function over time.
Linguistics (1957-present) Modem linguistics and AI, then, were "born" at about the same time, and grew up together, intersecting in a hybrid field called computational linguistics or natural language processing.
1.1.3 The History of Artificial Intelligence The gestation of artificial intelligence (1943-1955) There were a number of early examples of work that can be characterized as AI, but it was Alan Turing who first articulated a complete vision of A1 in his 1950 article "Comput- ing Machinery and Intelligence." Therein, he introduced the Turing test, machine learning, genetic algorithms, and reinforcement learning.
The birth of artificial intelligence (1956) McCarthy convinced Minsky, Claude Shannon, and Nathaniel Rochester to help him bring together U.S. researchers interested in automata theory, neural nets, and the study of intelligence. They organized a two-month workshop at Dartmouth in the summer of 1956. Perhaps the longest-lasting thing to come out of the workshop was an agreement to adopt McCarthy's new name for the field: artificial intelligence.
Early enthusiasm, great expectations (1952-1969) The early years of A1 were full of successes-in a limited way. General Problem Solver ( GPS ) was a computer program created in 1957 by Herbert Simon and Allen Newell to build a universal problem solver machine. Th e order in which the program considered subgoals and possible actions was similar to that in which humans approached the same problems. Thus, GPS was probably the first program to embody the "thinking humanly" approach. At IBM, Nathaniel Rochester and his colleagues produced some of the first A1 pro- grams. Herbert Gelernter (1959) constructed the Geometry Theorem Prover, which was able to prove theorems that many students of mathematics would find quite tricky. Lisp was invented by John McCarthy in 1958 while he was at the Massachusetts Institute of Technology (MIT). In 1963, McCarthy started the AI lab at Stanford. Tom Evans's A NALOGY program (1968) solved geometric analogy problems that appear in IQ tests, such as the one in Figure 1.
Figure 1.1 The Tom Evan’s ANALOGY program could solve geometric analogy problems as shown.
A dose of reality (1966-1973) From the beginning, AI researchers were not shy about making predictions of their coming successes. The following statement by Herbert Simon in 1957 is often quoted: “It is not my aim to surprise or shock you-but the simplest way I can summarize is to say that there are now in the world machines that think, that learn and that create. Moreover,
model of a patient's internal anatomy and then uses robotic control to guide the insertion of a hip replacement prosthesis. Language understanding and problem solving: P ROVERB (Littman et al., 1999) is a computer program that solves crossword puzzles better than most humans, using constraints on possible word fillers, a large database of past puzzles, and a variety of information sources including dictionaries and online databases such as a list of movies and the actors that appear in them.
1.2 INTELLIGENT AGENTS
An agent is anything that can be viewed as perceiving its environment through sensors and SENSOR acting upon that environment through actuators. This simple idea is illustrated in Figure 1.2.
Figure 1.2 Agents interact with environments through sensors and actuators.
Percept We use the term percept to refer to the agent's perceptual inputs at any given instant. Percept Sequence An agent's percept sequence is the complete history of everything the agent has ever perceived. Agent function Mathematically speaking, we say that an agent's behavior is described by the agent function that maps any given percept sequence to an action.
Agent program Internally, The agent function for an artificial agent will be implemented by an agent program. It is important to keep these two ideas distinct. The agent function is an abstract mathematical description; the agent program is a concrete implementation, running on the agent architecture.
To illustrate these ideas, we will use a very simple example-the vacuum-cleaner world shown in Figure 1.3. This particular world has just two locations: squares A and B. The vacuum agent perceives which square it is in and whether there is dirt in the square. It can choose to move left, move right, suck up the dirt, or do nothing. One very simple agent function is the following: if the current square is dirty, then suck, otherwise move to the other square. A partial tabulation of this agent function is shown in Figure 1.4.
Figure 1.3 A vacuum-cleaner world with just two locations.
Agent function
Percept Sequence Action [A, Clean] Right [A, Dirty] Suck [B, Clean] Left [B, Dirty] Suck [A, Clean], [A, Clean] Right [A, Clean], [A, Dirty] Suck … Figure 1.4 Partial tabulation of a simple agent function for the vacuum-cleaner world shown in Figure 1.3.
Rational Agent A rational agent is one that does the right thing-conceptually speaking, every entry in the table for the agent function is filled out correctly. Obviously, doing the right thing is better than doing the wrong thing. The right action is the one that will cause the agent to be most successful. Performance measures A performance measure embodies the criterion for success of an agent's behavior. When an agent is plunked down in an environment, it generates a sequence of actions according to the percepts it receives. This sequence of actions causes the environment to go through a sequence of states. If the sequence is desirable, then the agent has performed well. Rationality What is rational at any given time depends on four things:
This leads to a definition of a rational agent: For each possible percept sequence, a rational agent should select an action that is ex- pected to maximize its performance measure, given the evidence provided by the percept sequence and whatever built-in knowledge the agent has.
Omniscience, learning, and autonomy An omniscient agent knows the actual outcome of its actions and can act accordingly; but omniscience is impossible in reality. Doing actions in order to modify future percepts-sometimes called information gathering -is an important part of rationality. Our definition requires a rational agent not only to gather information, but also to learn
Deterministic vs. stochastic. If the next state of the environment is completely determined by the current state and the action executed by the agent, then we say the environment is deterministic; other- wise, it is stochastic. Episodic vs. sequential In an episodic task environment , the agent's experience is divided into atomic episodes. Each episode consists of the agent perceiving and then performing a single action. Cru- cially, the next episode does not depend on the actions taken in previous episodes. For example, an agent that has to spot defective parts on an assembly line bases each decision on the current part, regardless of previous decisions; In sequential environments , on the other hand, the current decision could affect all future decisions. Chess and taxi driving are sequential: Discrete vs. continuous. The discrete/continuous distinction can be applied to the state of the environment, to the way time is handled, and to the percepts and actions of the agent. For example, a discrete-state environment such as a chess game has a finite number of distinct states. Chess also has a discrete set of percepts and actions. Taxi driving is a continuous- state and continuous-time problem: the speed and location of the taxi and of the other vehicles sweep through a range of continuous values and do so smoothly over time. Taxi-driving actions are also continuous (steering angles, etc.).
Single agent vs. multiagent. An agent solving a crossword puzzle by itself is clearly in a single-agent environment, whereas an agent playing chess is in a two-agent environ- ment. As one might expect, the hardest case is partially observable, stochastic, sequential, dynamic, continuous, and multiagent.
Figure 1.7 lists the properties of a number of familiar environments.
Figure 1.7 Examples of task environments and their characteristics.
Agent programs The agent programs all have the same skeleton: they take the current percept as input from the sensors and return an action to the actuatom6 Notice the difference between the agent program , which takes the current percept as input, and the agent function , which takes the entire percept history. The agent program takes just the current percept as input because nothing more is available from the environment; if the agent's actions depend on the entire percept sequence, the agent will have to remember the percepts.
Function TABLE-DRIVEN_AGENT( percept ) returns an action
static : percepts , a sequence initially empty table , a table of actions, indexed by percept sequence
append percept to the end of percepts action ← LOOKUP( percepts , table ) return action
Figure 1.8 The TABLE-DRIVEN-AGENT program is invoked for each new percept and returns an action each time.
Drawbacks:
Some Agent Types
Simple Reflex Agent
The simplest kind of agent is the simple reflex agent. These agents select actions on the basis of the current percept, ignoring the rest of the percept history. For example, the vacuum agent whose agent function is tabulated in Figure 1.10 is a simple reflex agent, because its decision is based only on the current location and on whether that contains dirt.
A Simple Reflex Agent: Schema
function REFLEX-AGENT-WITH-STATE( percept ) returns an action static : rules , a set of condition-action rules state , a description of the current world state action , the most recent action. state ← UPDATE-STATE( state , action , percept ) rule ← RULE-MATCH( state , rule ) action ← RULE-ACTION[ rule ] return action
Figure 1.13 Model based reflex agent. It keeps track of the current state of the world using an internal model. It then chooses an action in the same way as the reflex agent.
Goal-based agents Knowing about the current state of the environment is not always enough to decide what to do. For example, at a road junction, the taxi can turn left, turn right, or go straight on. The correct decision depends on where the taxi is trying to get to. In other words, as well as a current state description, the agent needs some sort of goal information that describes situations that are desirable-for example, being at the passenger's destination. The agent program can combine this with information about the results of possible actions (the same information as was used to update internal state in the reflex agent) in order to choose actions that achieve the goal. Figure 1.13 shows the goal-based agent's structure.
Figure 1.14 A goal based agent
Utility-based agents Goals alone are not really enough to generate high-quality behavior in most environments. For example, there are many action sequences that will get the taxi to its destination (thereby achieving the goal) but some are quicker, safer, more reliable, or cheaper than others. Goals just provide a crude binary distinction between "happy" and "unhappy" states, whereas a more general performance measure should allow a comparison of different world states according to exactly how happy they would make the agent if they could be achieved. Because "happy" does not sound very scientific, the customary terminology is to say that if one world state is preferred to another, then it has higher utility for the agent.
Figure 1.15 A model-based, utility-based agent. It uses a model of the world, along with a utility function that measures its preferences among states of the world. Then it chooses the action that leads to the best expected utility, where expected utility is computed by averaging over all possible outcome states, weighted by the probability of the outcome.
Figure 1.16 A general model of learning agents.
1.3.1 Problem Solving by Search An important aspect of intelligence is goal-based problem solving. The solution of many problems can be described by finding a sequence of actions that lead to a desirable goal. Each action changes the state and the aim is to find the sequence of actions and states that lead from the initial (start) state to a final (goal) state.
A well-defined problem can be described by:
e.g., sum of distances, number of actions executed, etc. c(x; a; y) is the step cost, assumed to be >= 0 A solution is a sequence of actions leading from the initial state to a goal state.
Figure 1.17 Goal formulation and problem formulation
Search An agent with several immediate options of unknown value can decide what to do by examining different possible sequences of actions that leads to the states of known value,and then choosing the best sequence. The process of looking for sequences actions from the current state to reach the goal state is called search. The search algorithm takes a problem as input and returns a solution in the form of action sequence. Once a solution is found,the execution phase consists of carrying out the recommended action.. Figure 1.18 shows a simple “formulate,search,execute” design for the agent. Once solution has been executed,the agent will formulate a new goal.
function SIMPLE-PROBLEM-SOLVING-AGENT( percept ) returns an action inputs : percept , a percept static : seq , an action sequence, initially empty state , some description of the current world state goal , a goal, initially null problem , a problem formulation state UPDATE-STATE( state, percept ) if seq is empty then do goal FORMULATE-GOAL( state ) problem FORMULATE-PROBLEM( state, goal ) seq SEARCH( problem ) action FIRST( seq ); seq REST(seq) return action
Figure 1.18 A Simple problem solving agent. It first formulates a goal and a problem ,searches
for a sequence of actions that would solve a problem,and executes the actions one at a time.
1.3.1.1 Well-defined problems and solutions
A problem can be formally defined by four components :
Figure 1.19 A simplified Road Map of part of Romania
1.3.2 EXAMPLE PROBLEMS The problem solving approach has been applied to a vast array of task environments. Some best known problems are summarized below. They are distinguished as toy or real-world problems A toy problem is intended to illustrate various problem solving methods. It can be easily used by different researchers to compare the performance of algorithms. A real world problem is one whose solutions people actually care about.
Vacuum World Example
A complete-state formulation starts with all 8 queens on the board and move them around. In either case the path cost is of no interest because only the final state counts.
Figure 1.22 8-queens problem
The first incremental formulation one might try is the following :
In this formulation,we have 64.63…57 = 3 x 10^14 possible sequences to investigate. A better formulation would prohibit placing a queen in any square that is already attacked. :
2... REAL-WORLD PROBLEMS
Route-finding problem is defined in terms of specified locations and transitions along links between them. Route-finding algorithms are used in a variety of applications,such as routing in computer networks,military operations planning,and air line travel planning systems.
The airline travel problem is specifies as follows :
Touring problems are closely related to route-finding problems,but with an important difference. Consider for example,the problem,”Visit every city at least once” as shown in Romania map. As with route-finding the actions correspond to trips between adjacent cities. The state space, however,is quite different. The initial state would be “In Bucharest; visited{Bucharest}”.
A typical intermediate state would be “In Vaslui;visited {Bucharest,Urziceni,Vaslui}”. The goal test would check whether the agent is in Bucharest and all 20 cities have been visited.
Is a touring problem in which each city must be visited exactly once. The aim is to find the shortest tour.The problem is known to be NP-hard. Enormous efforts have been expended to improve the capabilities of TSP algorithms. These algorithms are also used in tasks such as planning movements of automatic circuit-board drills and of stocking machines on shop floors.
VLSI layout A VLSI layout problem requires positioning millions of components and connections on a chip to minimize area ,minimize circuit delays,minimize stray capacitances,and maximize manufacturing yield. The layout problem is split into two parts : cell layout and channel routing.
ROBOT navigation ROBOT navigation is a generalization of the route-finding problem. Rather than a discrete set of routes,a robot can move in a continuous space with an infinite set of possible actions and states. For a circular Robot moving on a flat surface,the space is essentially two-dimensional. When the robot has arms and legs or wheels that also must be controlled,the search space becomes multi-dimensional. Advanced techniques are required to make the search space finite.
The example includes assembly of intricate objects such as electric motors. The aim in assembly problems is to find the order in which to assemble the parts of some objects. If the wrong order is choosen,there will be no way to add some part later without undoing somework already done. Another important assembly problem is protein design,in which the goal is to find a sequence of Amino acids that will be fold into a three-dimensional protein with the right properties to cure some disease.
In recent years there has been increased demand for software robots that perform Internet searching.,looking for answers to questions,for related information,or for shopping deals. The searching techniques consider internet as a graph of nodes(pages) connected by links.
2.. SEARCHING FOR SOLUTIONS
Having formulated some problems ,we now need to solve them. This is done by a search through the state space. A search tree is generated by the initial state and the successor function that together define the state space. In general,we may have a search graph rather than a search tree ,when the same state can be reached from multiple paths.
Figure 1.23 shows some of the expansions in the search tree for finding a route from Arad to Bucharest.