AI
Chapter 1 - Introduction
What is AI
Different Viewpoints of AI
Thinking Humanly: This approach focuses on replicating human thought processes like
reasoning, decision-making, and problem-solving in machines.
Acting Humanly: This approach aims to create machines that can perform tasks typically
requiring human intelligence, such as playing chess, writing poetry, or driving a car.
Thinking Rationally: This approach focuses on building machines that can act and make
decisions logically and optimally, based on their knowledge and the situation.
Acting Rationally: This approach emphasizes designing intelligent agents that exhibit
intelligent behavior in their actions.
Key Points:
Some approaches aim to mimic human behavior, while others focus on achieving optimal or
rational behavior.
AI research has historically followed all four approaches, with each having its own methods and
proponents.
The Foundations of AI
Philosophy
Aristotle: Proposed using logic for reasoning and connecting knowledge to action.
Descartes: Distinguished mind and matter, influencing the concept of "dualism."
Empiricists (Bacon, Locke, Hume): Emphasized the role of experience in acquiring
knowledge.
Logical positivists (Carnap, Russell): Advocated for connecting knowledge to observations
and logical theories.
Mathimatics
Mathematics offers formal tools to address philosophical questions:
Logic and valid conclusions:
Boole pioneered propositional (Boolean) logic.
Frege developed first-order logic for objects and relations (forming the basis of modern AI logic).
Tarski provided a theory of reference, linking logical objects to real-world entities.
Limits of computation:
Euclid's algorithm is an early example of a formal procedure.
Gödel's incompleteness theorem: some mathematical statements are true but can't be proved
within given logical systems.
Turing machines: A model to define computable functions, but some functions remain
uncomputable (e.g., determining if any program will halt).
Complexity and tractability:
Intractable problems: Time to solve them grows exponentially with problem size, making
solutions impractical.
NP-completeness: A class of hard problems. If you solve one NP-complete problem, you offer a
pathway to solving them all. Understanding this complexity is crucial for designing AI systems.
Dealing with uncertainty:
Cardano introduced probability in terms of gambling theory.
Pascal and Fermat advanced probabilistic reasoning to predict outcomes and allocate resources.
Bayes proposed Bayes' rule: a key method for updating probabilities based on new evidence,
fundamental to modern AI approaches to uncertain reasoning.
Key Takeaways:
Mathematics transformed abstract philosophical inquiries into a field with precise definitions,
formalisms, and theories.
Understanding the limits of logic and computation is crucial for building realistic AI systems.
Analyzing problem complexity helps separate easily solvable problems from hard ones, guiding
AI algorithm design.
Probability theory provides a robust framework to reason and make decisions in uncertain
situations, essential for real-world AI.
Neuroscience
The role of neuroscience in AI is to provide insights into how the brain processes information, guiding the
development of AI systems that mimic human cognition and behavior. By understanding neural
mechanisms, AI researchers can design more efficient algorithms, improve learning models, and develop
AI systems that better emulate human intelligence and decision-making processes.
Psychology
The role of psychology in AI involves providing insights into how humans and animals think and
act, which serves as inspiration for designing intelligent systems.
By understanding cognitive processes, such as perception, learning, memory, and decision-
making, AI researchers can develop models and algorithms that mimic or augment human-like
intelligence.
Psychology also informs the design of user interfaces and interaction methods to make AI systems
more intuitive and effective for human users.
Computer Engineering
The role of computer engineering in AI is to design and build efficient computing systems that can
support the computational requirements of AI algorithms and applications.
This includes developing hardware architectures, such as CPUs, GPUs, and specialized AI
accelerators, that can perform complex computations quickly and accurately.
Additionally, computer engineers work on optimizing software algorithms and systems to leverage
the capabilities of the underlying hardware, improving performance and efficiency.
Overall, computer engineering plays a crucial role in enabling the advancement and
implementation of AI technologies.
Linguistics
Linguistics is vital for AI, connecting language to thought. It helps in understanding language structures
and semantics, influencing natural language processing (NLP) algorithms. Linguistics aids in knowledge
representation and dialogue systems, enabling effective human-machine interactions in AI.
History of AI
The gestation (incubation/pregnancy) of artificial intelligence (1943–1955)
From 1943 to 1955, the groundwork for artificial intelligence (AI) was established.
Warren McCulloch and Walter Pitts developed a model of artificial neurons, drawing on brain
physiology and computation theory.
Donald Hebb introduced Hebbian learning, a foundational concept in neural network modeling.
Marvin Minsky and Dean Edmonds built the first neural network computer, known as SNARC, in
1950.
Alan Turing articulated a visionary agenda for AI in his 1950 article, including the Turing Test,
machine learning, genetic algorithms, and reinforcement learning.
Turing also proposed simulating child-like learning processes in AI systems, known as the Child
Programme idea.
These contributions marked the gestation period of AI, setting the stage for future developments in
the field.
The birth of artificial intelligence (1956)
In 1956, John McCarthy organized a workshop at Dartmouth College, marking the start of AI.
Attendees discussed the potential for machines to simulate human-like intelligence.
Allen Newell and Herbert Simon presented the Logic Theorist program, a significant milestone in
AI.
The workshop established AI as a separate field within computer science, focusing on replicating
human faculties and autonomy in machines.
Early enthusiasm, great expectations (1952–1969)
Early AI pioneers made significant strides despite limited computing capabilities.
Newell and Simon's General Problem Solver (GPS) mirrored human problem-solving.
The physical symbol system hypothesis by Newell and Simon suggested intelligence involves
symbol manipulation.
IBM's Gelernter and Samuel contributed with the Geometry Theorem Prover and checkers-playing
programs.
John McCarthy introduced Lisp and conceived the Advice Taker program.
Marvin Minsky's practical approach differed from McCarthy's logic emphasis.
Stanford's AI lab focused on logical reasoning, seen in Cordell Green's systems and Shakey
project.
Microworlds provided platforms for intelligence-requiring tasks.
Contributions from David Huffman, David Waltz, Terry Winograd, and Scott Fahlman advanced
AI.
Developments in neural networks like adalines and perceptrons laid groundwork for learning
algorithms.
A Dose of Reality (1966-1973)
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,
their ability to do these things is going to increase rapidly until—in a visible future—the
range of problems they can handle will be coextensive with the range to which the human
mind has been applied.
Early optimism in AI led to overconfidence in predicting rapid progress, exemplified by Herbert
Simon's statement.
Initial AI systems performed well on simple tasks but failed when applied to broader and more
complex problems.
Early machine translation efforts, lacking background knowledge, produced inaccurate
translations, leading to canceled funding.
Intractable problems and the illusion of unlimited computational power hindered progress in
scaling up AI solutions.
Experiments in machine evolution, like genetic algorithms, faced challenges due to the
"combinatorial explosion" problem.
Fundamental limitations, such as those highlighted in Minsky and Papert's book on perceptrons,
posed obstacles to AI development.
Criticism from the Lighthill report led to the British government ending support for AI research in
many universities.
Knowledge-based systems: The key to power? (1969–1979)
Early AI focused on weak methods, using general-purpose search mechanisms for problem-
solving, which struggled with scaling up to large or difficult problems.
DENDRAL, an early successful example of a knowledge-intensive system, inferred molecular
structures from mass spectrometer data using domain-specific rules.
Expert systems like MYCIN applied domain knowledge to medical diagnosis, outperforming
junior doctors with certainty factors to handle uncertainty.
Natural language understanding systems, such as SHRDLU and those developed by Roger Schank
and colleagues, emphasized the importance of domain knowledge for robust language
comprehension.
Different knowledge representation schemes emerged, including logic-based languages like
Prolog and structured approaches like frames, inspired by Marvin Minsky's concept.
AI becomes an industry (1980–present)
In the early 1980s, the first successful commercial expert system, R1, operated at Digital
Equipment Corporation, assisting in configuring computer system orders and saving millions of
dollars annually.
By 1988, DEC's AI group had 40 deployed expert systems, while DuPont had 100 in use and 500
in development, leading to substantial cost savings for both companies.
The Japanese initiated the "Fifth Generation" project in 1981, aiming to develop intelligent
computers using Prolog. In response, the U.S. formed the Microelectronics and Computer
Technology Corporation (MCC) to ensure national competitiveness, encompassing AI alongside
other technologies.
Despite significant investment and optimism, projects like the Fifth Generation in Japan, MCC in
the U.S., and the reinstated funding for AI research in Britain did not fully achieve their ambitious
objectives.
The AI industry experienced rapid growth from the early 1980s, with investments skyrocketing
from millions to billions of dollars by 1988. However, this was followed by a period known as the
"AI Winter," characterized by failed promises and the collapse of many companies in the AI
sector.
The return of neural networks (1986–present)
In the mid-1980s, the back-propagation learning algorithm, initially discovered in 1969 by Bryson
and Ho, was independently rediscovered by at least four different groups.
This algorithm found applications in various learning problems across computer science and
psychology.
The publication of the results in the book "Parallel Distributed Processing" by Rumelhart and
McClelland in 1986 generated significant excitement, leading to the emergence of connectionist
models of intelligent systems.
Connectionist models were viewed by some as direct competitors to symbolic models advocated
by Newell and Simon, as well as the logicist approach of McCarthy and others.
While it was acknowledged that humans manipulate symbols to some extent, connectionists
questioned whether symbol manipulation played a significant explanatory role in detailed
cognitive models.
The relationship between connectionist and symbolic approaches is now seen as complementary
rather than competing, with modern neural network research diverging into two fields: one
focused on creating effective network architectures and algorithms, and the other on modeling the
empirical properties of neurons and neuron ensembles.
AI adopts the scientific method (1987–present)
Researchers have revisited the concept of creating complete intelligent agents (Intelligent agents
are software entities designed to perceive their environment, make decisions, and take actions to
achieve specific goals or tasks.), exemplified by projects like SOAR by Allen Newell, John Laird,
and Paul Rosenbloom.
The Internet has become a significant environment for intelligent agents, with AI systems being
widely used in web-based applications and tools such as search engines, recommender systems,
and web site aggregators.
Building complete agents has highlighted the need to integrate various subfields of AI and deal
with uncertainties in sensory systems, leading to closer connections with fields like control theory
and economics.
Despite advancements, some AI pioneers, including John McCarthy, Marvin Minsky, Nils
Nilsson, and Patrick Winston, have expressed dissatisfaction with the progress of AI. They
advocate for a return to the original goal of creating "machines that think, learn, and create,"
termed human-level AI (HLAI).
Another concept is Artificial General Intelligence (AGI), which seeks universal algorithms for
learning and acting in any environment. AGI has its roots in the work of Ray Solomonoff and
aims for a broader scope of intelligence beyond specialized tasks.
Ensuring that AI systems are friendly and aligned with human values is also a concern, known as
Friendly AI, which is addressed by researchers like Yudkowsky and Omohundro.
The availability of very large data sets (2001–present)
Shift in Focus: There has been a notable shift in AI research towards prioritizing data over specific
algorithms. This shift is driven by the recognition that access to large datasets can be more crucial
for achieving high performance than the intricacies of the algorithm itself.
Data Availability: The availability of vast amounts of digital data, including text, images, genomic
sequences, and more, has facilitated this shift. These datasets provide the raw material needed to
train AI models effectively.
Example: Word-Sense Disambiguation: Yarowsky's work on word-sense disambiguation
demonstrated that large corpora of unannotated text, coupled with dictionary definitions, can
enable accurate labeling of examples without the need for manually labeled data.
Example: Image Completion: Hays and Efros' research on image completion showcased how
algorithms could leverage extensive collections of photos to find suitable matches for filling in
missing areas in images. The performance of their algorithm significantly improved with the size
of the photo dataset.
Overcoming the Knowledge Bottleneck: The traditional "knowledge bottleneck" in AI, where
encoding all necessary knowledge into systems posed a challenge, can now be addressed through
learning from large datasets. This approach reduces the reliance on manual knowledge
engineering.
Resurgence in AI Development: The growing emphasis on leveraging large datasets has led to
increased AI applications across various industries. This trend suggests a potential resurgence in
AI development, as it overcomes previous limitations associated with insufficient data and
algorithmic complexity.
THE STATE OF THE ART
Robotic Vehicles: AI-powered robotic vehicles, such as STANLEY and CMU's BOSS, have
demonstrated remarkable capabilities in navigating rough terrains and urban environments without human
intervention, relying on sensors and onboard software for decision-making.
Speech Recognition: Automated speech recognition systems are widely used in various
applications, including customer service interactions, enabling users to converse with computers naturally
and efficiently.
Autonomous Planning and Scheduling: AI programs like NASA's Remote Agent and
successors, as well as MAPGEN and MEXAR2, autonomously plan and execute operations for spacecraft
and rovers, demonstrating advanced capabilities in decision-making and problem-solving.
Game Playing: IBM's DEEP BLUE made history by defeating the world chess champion, Garry
Kasparov, showcasing the power of AI in strategic decision-making and game playing.
Spamfighting: AI algorithms play a crucial role in classifying spam emails, saving users from the
hassle of sorting through unwanted messages, with learning algorithms adapting to evolving spam tactics.
Logistics Planning: AI-based tools like DART have revolutionized logistics planning for military
operations, enabling efficient scheduling and resource allocation in complex scenarios.
Robotics: Companies like iRobot deploy AI-powered robots, such as the Roomba vacuum cleaner and
PackBot for military use, demonstrating AI's practical applications in various domains.
Machine Translation: Advanced machine translation systems leverage statistical models and vast
datasets to automatically translate text between languages, facilitating communication across linguistic
barriers.
Chapter 2 – Intelligent Agents
Agents
An agent is anything that can be viewed as perceiving its environment through sensors and acting upon
that environment through actuators.
We use the term percept to refer to the agent’s perceptual inputs at any given instant. An agent’s percept
sequence is the complete history of everything the agent has ever perceived. In general, an agent’s choice
of action at any given instant can depend on the entire percept sequence observed to date, but not on
anything it hasn’t perceived. Mathematically speaking, we say that an agent’s behavior is described by the
agent function that maps any given percept sequence to an action.
Good behaviour: The Concept of Rationality
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. But how does we know that agent is doing the right thing?
Ans: By considering the consequences of the 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. This notion of desirability is captured by a performance measure that evaluates
any given sequence of environment states.
Notice that we said environment states, not agent states. If we define success in terms of agent’s opinion of
its own performance, an agent could achieve perfect rationality simply by deluding itself that its
performance was perfect. Human agents in particular are notorious for “sour grapes”—believing they did
not really want something (e.g., a Nobel Prize) after not getting it.
Rationality
Rationality refers to the quality of being logical, consistent, and reasonable in decision-making and
behavior. In the context of human cognition, rationality involves making decisions based on sound
reasoning, evidence, and logical principles rather than emotions, biases, or irrational beliefs.
What is rational at any given time depends on four things:
The performance measure that defines the criterion of success.
The agent’s prior knowledge of the environment.
The actions that the agent can perform.
The agent’s percept sequence to date.
This leads to a definition of a rational agent:
For each possible percept sequence, a rational agent should select an action that is expected to maximize
its performance measure, given the evidence provided by the percept sequence and whatever built-in
knowledge the agent has.
Consider the simple vacuum-cleaner agent that cleans a square if it is dirty and moves to the other square if
not; this is the agent function tabulated in Figure 2.3. Is this a rational agent? That depends! First, we need
to say what the performance measure is, what is known about the environment, and what sensors and
actuators the agent has. Let us assume the following:
The performance measure awards one point for each clean square at each time step, over a
“lifetime” of 1000 time steps.
The “geography” of the environment is known apriori (Figure 2.2) but the dirt distribution and the
initial location of the agent are not. Clean squares stay clean and sucking cleans the current square.
The Left and Right actions move the agent left and right except when this would take the agent
outside the environment, in which case the agent remains where it is.
The only available actions are Left, Right,and Suck.
The agent correctly perceives its location and whether that location contains dirt.
Omniscience, learning, and autonomy
Omniscience is the concept of having complete or infinite knowledge and understanding of all things.
We need to be careful to distinguish between rationality and omniscience. An omniscient agent knows the
actual outcome of its actions and can act accordingly; but omniscience is impossible in reality.
Rationality is not the same as perfection. Rationality maximizes expected performance, while perfection
maximizes actual performance. The point is that if we expect an agent to do what turns out to be the best
action after the fact, it will be impossible to design an agent to fulfill this specification—unless we
improve the performance of crystal balls or time machines.
To the extent that an agent relies on the prior knowledge of its designer rather than on its own percepts, we
say that the agent lacks autonomy. A rational agent should be autonomous—it should learn what it can to
compensate for partial or incorrect prior knowledge. For example, a vacuum-cleaning agent that learns to
foresee where and when additional dirt will appear will do better than one that does not
The Nature of Environments
We are ready to create a rational agent but first we must know what is ‘task environment’.
Task environments are essentially the problems to which the rational agents are the solution. First we will
know how to specify task environments and we then show that task environments come in a variety of
flavors. The flavor of the task environment directly affects the appropriate design for the agent program.
Specifying the task environment
In our discussion of the rationality of the simple vacuum-cleaner agent, we had to specify the performance
measure, the environment, and the agent’s actuators and sensors. We group all these under the heading of
the task environment. For the acronymically minded, we call this the PEAS (Performance, Environment,
Actuators, Sensors) description. In designing an agent, the first step must always be to specify the task
environment as fully as possible. Automated taxi driver environment is shown in the following figure.
Properties of Task Environments
1. Fully Observable vs. Partially Observable: Refers to whether the agent has complete access
to the state of the environment at each point in time.
2. Single Agent vs. Multiagent: Indicates whether there's only one agent interacting with the
environment or multiple agents interacting with each other.
3. Deterministic vs. Stochastic: Describes whether the outcomes of actions are completely
determined by the current state and agent's action (deterministic) or if there's uncertainty and
unpredictability in outcomes (stochastic: Having a random probability distribution or pattern that
may be analysed statistically but may not be predicted precisely).
4. Episodic vs. Sequential:
Episodic environments divide the agent's experience into atomic episodes where actions are
independent of previous decisions.
Sequential environments involve actions that affect future decisions, requiring the agent to
think ahead.
Examples of episodic tasks include spotting defective parts, while chess and taxi driving are
sequential tasks.
5. Static vs. Dynamic: Specifies whether the environment remains unchanged while the agent
deliberates (static) or if it changes continuously, requiring real-time decision-making (dynamic).
6. Discrete vs. Continuous: Refers to whether the environment, percepts, and actions have a finite
number of distinct states (discrete) or if they involve continuous states and variables (continuous).
7. Known vs. Unknown: Indicates whether the outcomes for all actions are well-defined and
known to the agent (known) or if the agent needs to learn and adapt to the environment
(unknown).
As one might expect, the hardest case is partially observable, multiagent, stochastic, sequential, dynamic,
continuous,andunknown. Taxi driving is hard in all these senses, except that for the most part the driver’s
environment is known. Driving a rented car in a new country with unfamiliar geography and traffic laws is
a lot more exciting.
The Structure of Agents
The job of AI is to design an agent program that implements the agent function— the mapping from
percepts to actions. We assume this program will run on some sort of computing device with physical
sensors and actuators—we call this the architecture:
agent = architecture + program
Obviously, the program we choose has to be one that is appropriate for the architecture. If the program is
going to recommend actions like Walk, the architecture had better have legs. The architecture might be just
an ordinary PC, or it might be a robotic car with several onboard computers, cameras, and other sensors. In
general, the architecture makes the percepts from the sensors available to the program, runs the program,
and feeds the program’s action choices to the actuators as they are generated.