Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

Chapter one

What is Artificial Intelligence?

According to the father of Artificial Intelligence, John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a
software think intelligently, in the similar manner the intelligent humans think.
AI is accomplished by studying how human brain thinks, and how humans learn, decide, and
work while trying to solve a problem, and then using the outcomes of this study as a basis of
developing intelligent software and systems.

Philosophy of AI

While exploiting the power of the computer systems, the interest of human, lead him to
wonder, “Can a machine think and behave like humans do?”
Thus, the development of AI started with the intention of creating similar intelligence in
machines that we find and regard high in humans.

Goals of AI

 To Create Expert Systems − the systems which exhibit intelligent behavior, learn,
demonstrate, explain, and advice its users.
 To Implement Human Intelligence in Machines − Creating systems that understand,
think, learn, and behave like humans.

What Contributes to AI?

Artificial intelligence is a science and technology based on disciplines such as Computer


Science, Biology, Psychology, Linguistics, Mathematics, and Engineering. A major thrust of AI
is in the development of computer functions associated with human intelligence, such as
reasoning, learning, and problem solving.
Out of the following areas, one or multiple areas can contribute to build an intelligent system.
Programming Without and With AI

The programming without and with AI is different in following ways −

Programming Without AI Programming With AI

A computer program without AI can A computer program with AI can answer


answer the specific questions it is meant the generic questions it is meant to solve.
to solve.

AI programs can absorb new modifications by putting


Modification in the program leads to highly independent pieces of information together. Hence
change in its structure. you can modify even a minute piece of information of
program without affecting its structure.

Modification is not quick and easy. It may


Quick and Easy program modification.
lead to affecting the program adversely.

Applications of AI

AI has been dominant in various fields such as −


 Gaming − AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc.,
where machine can think of large number of possible positions based on heuristic
knowledge.
 Natural Language Processing − It is possible to interact with the computer that
understands natural language spoken by humans.
 Expert Systems − There are some applications which integrate machine, software, and
special information to impart reasoning and advising. They provide explanation and
advice to the users.
 Vision Systems − These systems understand, interpret, and understand visual input on
the computer. For example,
o A spying aero plane takes photographs, which are used to figure out spatial
information or map of the areas.
o Doctors use clinical expert system to diagnose the patient.
o Police use computer software that can recognize the face of criminal with the
stored portrait made by forensic artist.
 Speech Recognition − Some intelligent systems are capable of hearing and
comprehending the language in terms of sentences and their meanings while a human
talks to it. It can handle different accents, slang words, noise in the background, change
in human’s noise due to cold, etc.
 Handwriting Recognition − The handwriting recognition software reads the text written
on paper by a pen or on screen by a stylus. It can recognize the shapes of the letters and
convert it into editable text.
 Intelligent Robots − Robots are able to perform the tasks given by a human. They have
sensors to detect physical data from the real world such as light, heat, temperature,
movement, sound, bump, and pressure. They have efficient processors, multiple sensors
and huge memory, to exhibit intelligence. In addition, they are capable of learning from
their mistakes and they can adapt to the new environment.

 Approaches to AI – making computer

Four Approaches to Artificial Intelligence


.
  Humanly Rationally
Thinkin Thinking humanly — cognitive Thinking rationally — the use of logic. Need to worry
g (reasoning) modeling. Systems about modeling uncertainty and dealing with
should solve problems the same complexity.
way humans do.
Acting Acting humanly — the Turing Acting rationally — the study of rational agents:
Test approach. agents that maximize the expected value of their
performance measure given what they currently know.
Approach-1
Acting Humanly:

                The Turing Test, proposed by Alan Turing (1950), was designed to provide a
satisfactory operational definition of intelligence.

Turing test: ultimate test for acting humanly


–Computer and human both interrogated by judge
–Computer passes test if judge can’t tell the difference
The computer would need to possess the following capabilities:

Natural language processing to enable it to communicate successfully in English  


 Knowledge representation to store what it knows or hears; 
 Automated reasoning to use the stored information to answer questions and to draw new
conclusions; 
 Machine learning to adapt to new circumstances and to detect and extrapolate pattern
However, the so-called total Turing Test includes a video signal so that the interrogator can test
the subject’s perceptual abilities, as well as the opportunity for the interrogator to pass physical
objects “through the hatch.”
 To pass the total Turing Test, the computer will need :
 Computer vision to perceive objects
 Robotics to manipulate objects and move about.
The quest for “artificial flight” succeeded when the Wright brothers and others stopped
imitating birds and started using wind tunnels and learning about aerodynamics. Aeronautical
engineering texts do not define the goal of their field as making “machines that fly so exactly
like pigeons that they can fool even other pigeons.”

How Effective Is This Test?

•Agent must:
–Have command of language
–Have wide range of knowledge
–Demonstrate human traits (humor, emotion)
–Be able to reason
–Be able to learn
 Artificial Intelligence approach 1
                          
Chinese Room Agent

Imagine you are sitting in a room with a library of rule books, a bunch of blank exercise books,
and a lot of writing tools. Your only contact with the external world is through two slots in the
wall labeled ``input'' and ``output''. Occasionally, pieces of paper with Chinese characters come
into your room through the ``input'' slot. Each time a piece of paper comes in through the input
slot your task is to find the section in the rule books that matches the pattern of Chinese
characters on the piece of paper. The rule book will tell you which pattern of characters to
inscribe the appropriate pattern on a blank piece of paper. Once you have inscribed the
appropriate pattern according to the rule book your task is simply to push it out the output slot.
By the way, you don't understand Chinese, nor are you aware that the symbols that you are
manipulating are Chinese symbols.
In fact, the Chinese characters which you have been receiving as input have been questions about
a story and the output you have been producing has been the appropriate, perhaps even
"insightful," responses to the questions asked. Indeed, to the outside questioners your output has
been so good that they are convinced that whoever (or whatever) has been producing the
responses to their queries must be a native speaker of, or at least extremely fluent in, Chinese.

Do you understand Chinese?


 Searle says NO
 What do you think?
 Is this a refutation of the possibility of AI?
 The Systems Reply
 –The individual is just part of the overall system, which does understand Chines
 The Robot Reply
–Put same capabilities in a robot along with perceiving, talking, etc.  This agent would seem to have
genuine understanding and mental states.

Approach 2
Thinking Humanly

             If we are going to say that a given program thinks like a human, we must have some way
of determining how humans think. We need to get inside the actual workings of human minds.

There are three ways to do this: 


 Through introspection—trying to catch our own thoughts as they go by 
 Through psychological experiments—observing a person in action
 Through brain imaging—observing the brain in action. 
     Once we have a sufficiently precise theory of the mind, it becomes possible to express the
theory as a computer program. If the program’s input–output behavior matches corresponding
human behavior, that is evidence that some of the programs mechanisms could also be operating
in humans.

For example,
        Allen Newell and Herbert Simon, who developed GPS, the “General Problem Solver”
(Newell and Simon, 1961), were not content merely to have their program solve problems
correctly.They were more concerned with comparing the trace of its reasoning steps to traces of
human subjects solving the same problems. 

         The interdisciplinary field of cognitive science brings together computer models from AI
and experimental techniques from psychology to construct precise and testable theories of the
human mind.

Cognitive science is the interdisciplinary, scientific study of the mind and its processes. It
examines the nature, the tasks, and the functions of cognition. Cognitive scientists study
intelligence and behavior, with a focus on how nervous systems represent, process, and
transform information.

             In the early days of AI there was often confusion between the approaches: an author
would argue that an algorithm performs well on a task and that it is therefore a good model of
human performance, or vice versa. Modern authors separate the two kinds of claims; this
distinction has allowed both AI and cognitive science to develop more rapidly. The two fields
continue to fertilize each other, most notably in computer vision, which incorporates
neurophysiological evidence into computational models.
Main Thing is:
 Requires knowledge of brain function
 What level of abstraction?
 How can we validate this
 This is the focus of Cognitive Science

Artificial Intelligence approach 2

Approach 3
Thinking Rationally:

            The Greek philosopher Aristotle was one of the first to attempt to codify “right thinking,”
that  is, irrefutable reasoning processes. His syllogisms provided patterns for argument structures
that always yielded correct conclusions when given correct premises—for example, “Socrates is
a man; all men are mortal; therefore, Socrates is mortal.” These laws of thought were supposed
to govern the operation of the mind; their study initiated the field called logic.

             Logicians in the 19th century developed a precise notation for statements about all kinds
of objects in the world and the relations among them. (Contrast this with ordinary arithmetic
notation, which provides only for statements about numbers.) By 1965, programs existed that
could, in principle, solve any solvable problem described in logical notation. (Although if no
solution exists, the program might loop forever.) The so-called logicist tradition within artificial
intelligence hopes to build on such programs to create intelligent systems

There are two main obstacles to this approach. 


 First, it is not easy to take informal knowledge and state it in the formal terms required by
logical notation, particularly when the knowledge is less than 100% certain.
 Second, there is a big difference between solving a problem “in principle” and solving it
in practice.

 Artificial Intelligence approach 3

Even problems with just a few hundred facts can exhaust the computational resources of any
computer unless it has some guidance as to which reasoning steps to try first. Although both of
these obstacles apply to any attempt to build computational reasoning systems, they appeared
first in the logicist tradition.

Main Thing in this:


 Aristotle attempted this
 What are correct arguments or thought processes?
 Provided foundation of much of AI
 Not all intelligent behavior controlled by logic
 What is our goal?  What is the purpose of thinking?
Approach 4
Acting Rationally

                 An agent is just something that acts (agent comes from the Latin agere, to do). Of
course, all computer programs do something, but computer agents are expected to do more:
operate autonomously, perceive their environment, persist over a prolonged time period, adapt to
change, and create and pursue goals. A rational agent is one that acts so as to achieve the best
outcome or, when there is uncertainty, the best expected outcome.

             In the “laws of thought” approach to AI, the emphasis was on correct inferences. Making
correct inferences is sometimes part of being a rational agent, because one way to act rationally
is to reason logically to the conclusion that a given action will achieve one’s goals and then to act
on that conclusion. On the other hand, correct inference is not all of rationality; in some
situations, there is no provably correct thing to do, but something must still be done. There are
also ways of acting rationally that cannot be said to involve inference. For example, recoiling
from a hot stove is a reflex action that is usually more successful than a slower action taken after
careful deliberation.

             All the skills needed for the Turing Test also allow an agent to act rationally. Knowledge
representation and reasoning enable agents to reach good decisions. We need to be able to
generate comprehensible sentences in natural language to get by in a complex society. We need
learning not only for erudition, but also because it improves our ability to generate effective
behavior.

The rational-agent approach has two advantages over the other approaches. 
 First, it is more general than the “laws of thought” approach because correct inference is
just one of several possible mechanisms for achieving rationality. 
 Second, it is more amenable to scientific development than are approaches based on
human behavior or human thought. 
The standard of rationality is mathematically well defined and completely general, and can be
“unpacked” to generate agent designs that provably achieve it. Human behavior, on the other
hand, is well adapted for one specific environment and is defined by, well, the sum total of all
the things that humans do. This book therefore concentrates on general principles of rational
agents and on components for constructing them. We will see that despite the apparent simplicity
with which the problem can be stated, an enormous variety of issues come up when we try to
solve it. 
 Artificial Intelligence appcoache 4

One important point to keep in mind: 


                   We will see before too long that achieving perfect rationality—always doing the
right thing—is not feasible in complicated environments. The computational demands are just
too high. For most of the book, however, we will adopt the working hypothesis that perfect
rationality is a good starting point for analysis. It simplifies the problem and provides the
appropriate setting for most of the foundational material in the field.

Main Thing In this is 

 Act to achieve goals, given set of beliefs


 Rational behavior is doing the “right thing”
–Thing which expects to maximize goal achievement
        This is approach adopted by Russell & Norvig
Chapter Two

Intelligent Agents

Agents in Artificial Intelligence

An AI system can be defined as the study of the rational agent and its environment. The agents
sense the environment through sensors and act on their environment through actuators. An AI
agent can have mental properties such as knowledge, belief, intention, etc.

What is an Agent?

An agent can be anything that perceive its environment through sensors and act upon that
environment through actuators. An Agent runs in the cycle of perceiving, thinking, and acting.
An agent can be:

o Human-Agent: A human agent has eyes, ears, and other organs which work for sensors
and hand, legs, vocal tract work for actuators.
o Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for
sensors and various motors for actuators.
o Software Agent: Software agent can have keystrokes, file contents as sensory input and
act on those inputs and display output on the screen.

Hence the world around us is full of agents such as thermostat, cellphone, camera, and even we
are also agents.

Before moving forward, we should first know about sensors, effectors, and actuators.

Sensor: Sensor is a device which detects the change in the environment and sends the
information to other electronic devices. An agent observes its environment through sensors.

Actuators: Actuators are the component of machines that converts energy into motion. The
actuators are only responsible for moving and controlling a system. An actuator can be an
electric motor, gears, rails, etc.

Effectors: Effectors are the devices which affect the environment. Effectors can be legs, wheels,
arms, fingers, wings, fins, and display screen.
Intelligent Agents:

An intelligent agent is an autonomous entity which act upon an environment using sensors and
actuators for achieving goals. An intelligent agent may learn from the environment to achieve
their goals. A thermostat is an example of an intelligent agent.

Following are the main four rules for an AI agent:

o Rule 1: An AI agent must have the ability to perceive the environment.
o Rule 2: The observation must be used to make decisions.
o Rule 3: Decision should result in an action.
o Rule 4: The action taken by an AI agent must be a rational action.

Rational Agent:

A rational agent is an agent which has clear preference, models uncertainty, and acts in a way to
maximize its performance measure with all possible actions.

A rational agent is said to perform the right things. AI is about creating rational agents to use for
game theory and decision theory for various real-world scenarios.

For an AI agent, the rational action is most important because in AI reinforcement learning
algorithm, for each best possible action, agent gets the positive reward and for each wrong
action, an agent gets a negative reward.

Note: Rational agents in AI are very similar to intelligent agents.

Rationality:
The rationality of an agent is measured by its performance measure. Rationality can be judged on
the basis of following points:

o Performance measure which defines the success criterion.


o Agent prior knowledge of its environment.
o Best possible actions that an agent can perform.
o The sequence of percepts.

Note: Rationality differs from Omniscience because an Omniscient agent knows the actual
outcome of its action and act accordingly, which is not possible in reality.

Structure of an AI Agent

The task of AI is to design an agent program which implements the agent function. The structure
of an intelligent agent is a combination of architecture and agent program. It can be viewed as:

1. Agent = Architecture + Agent program  

Following are the main three terms involved in the structure of an AI agent:

Architecture: Architecture is machinery that an AI agent executes on.

Agent Function: Agent function is used to map a percept to an action.

1. f:P* → A  

Agent program: Agent program is an implementation of agent function. An agent program


executes on the physical architecture to produce function f.

PEAS Representation

PEAS is a type of model on which an AI agent works upon. When we define an AI agent or
rational agent, then we can group its properties under PEAS representation model. It is made up
of four words:

o P: Performance measure
o E: Environment
o A: Actuators
o S: Sensors

Here performance measure is the objective for the success of an agent's behavior.
PEAS for self-driving cars:

Let's suppose a self-driving car then PEAS representation will be:

Performance: Safety, time, legal drive, comfort

Environment: Roads, other vehicles, road signs, pedestrian

Actuators: Steering, accelerator, brake, signal, horn

Sensors: Camera, GPS, speedometer, odometer, accelerometer, sonar.

Example of Agents with their PEAS representation

Agent Performance measure Environment Actuators Sensors

1. Medical o Healthy patient o Patient o Tests Keyboard


Diagnose o Minimized cost o Hospital o Treatments (Entry of symptoms)
o Staff

2. o Cleanness o Room o Wheels o Camera


Vacuum o Efficiency o Table o Brushes o Dirt detection
Cleaner o Battery life o Wood floor o Vacuum sensor
o Security o Carpet Extractor o Cliff sensor
o Various obstacles o Bump Sensor
o Infrared Wall
Sensor
3. Part o Percentage of parts in o Conveyor belt o Jointed Arms o Camera
-picking correct bins. with parts, o Hand o Joint angle
Robot o Bins sensors.

Types of AI Agents

Agents can be grouped into five classes based on their degree of perceived intelligence and
capability. All these agents can improve their performance and generate better action over the
time. These are given below:

o Simple Reflex Agent


o Model-based reflex agent
o Goal-based agents
o Utility-based agent
o Learning agent

1. Simple Reflex agent:

o The Simple reflex agents are the simplest agents. These agents take decisions on the basis
of the current percepts and ignore the rest of the percept history.
o These agents only succeed in the fully observable environment.
o The Simple reflex agent does not consider any part of percepts history during their
decision and action process.
o The Simple reflex agent works on Condition-action rule, which means it maps the current
state to action. Such as a Room Cleaner agent, it works only if there is dirt in the room.
o Problems for the simple reflex agent design approach:
o They have very limited intelligence
o They do not have knowledge of non-perceptual parts of the current state
o Mostly too big to generate and to store.
o Not adaptive to changes in the environment.
2. Model-based reflex agent

o The Model-based agent can work in a partially observable environment, and track the
situation.
o A model-based agent has two important factors:
o Model: It is knowledge about "how things happen in the world," so it is called a
Model-based agent.
o Internal State: It is a representation of the current state based on percept history.
o These agents have the model, "which is knowledge of the world" and based on the model
they perform actions.
o Updating the agent state requires information about:

o How the world evolves


o How the agent's action affects the world.
3. Goal-based agents

o The knowledge of the current state environment is not always sufficient to decide for an
agent to what to do.
o The agent needs to know its goal which describes needed situations.
o Goal-based agents expand the capabilities of the model-based agent by having the "goal"
information.
o They choose an action, so that they can achieve the goal.
o These agents may have to consider a long sequence of possible actions before deciding
whether the goal is achieved or not. Such considerations of different scenario are called
searching and planning, which makes an agent proactive.
4. Utility-based agents

o These agents are similar to the goal-based agent but provide an extra component of utility
measurement which makes them different by providing a measure of success at a given
state.
o Utility-based agent act based not only goals but also the best way to achieve the goal.
o The Utility-based agent is useful when there are multiple possible alternatives, and an
agent has to choose in order to perform the best action.
o The utility function maps each state to a real number to check how efficiently each action
achieves the goals.
5. Learning Agents

o A learning agent in AI is the type of agent which can learn from its past experiences, or it
has learning capabilities.
o It starts to act with basic knowledge and then able to act and adapt automatically through
learning.
o A learning agent has mainly four conceptual components, which are:

1. Learning element: It is responsible for making improvements by learning from


environment
2. Critic: Learning element takes feedback from critic which describes that how
well the agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. Problem generator: This component is responsible for suggesting actions that
will lead to new and informative experiences.
b. Hence, learning agents are able to learn, analyze performance, and look for new ways to
improve the performance.

You might also like