Ai Mod1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Module – 1 (Introduction)

Introduction – What is Artificial Intelligence (AI)? The Foundations of AI, History of


AI, Applications of AI.
Intelligent Agents – Agents and Environments, Good behavior: The concept of
rationality, nature of Environments, Structure of Agents.
Textbook: Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach,
3rd Edition. Prentice Hall.

1. ARTIFICAL INTELLIGENCE

Artificial Intelligence (AI) is the study of how to make computers do things which, at the moment,
people do better. Some definitions of artificial intelligence.

Views of AI fall into four categories:


Thinking humanly Thinking rationally
Acting humanly Acting rationally
 Artificial intelligence is a system that thinks like human beings

1. AI is an exciting effort to make computers think… machines with minds, in the full and literal
sense
2. AI is the automation of activities that we associate with human thinking, activities such as
decision making, problem solving, and learning.
 Artificial intelligence is a system that thinks rationally
3. AI is the study of mental faculties through the use of computational models
4. AI is the study of computations that make it possible to perceive, reason, and act

Artificial intelligence is a system that act like human beings

5. AI is the art of creating machines that perform functions that require intelligence when
performed by people
6. AI is the study of how to make computers do things at which, at the moment, people do better

Artificial intelligence is a system that act rationally

7. AI is the study of the design of intelligent agents


8. AI is concerned with intelligent behavior artifacts

The four approaches in more detail are as follows:

(a)Acting humanly: The Turing Test approach

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


 Test proposed by Alan Turing in 1950
 The computer is asked questions by a human interrogator.
 The computer passes the test if a human interrogator, after posing some written questions, cannot
tell whether the written responses come from a person or not.
 Programming a computer to pass, the computer need to possess the following capabilities:
o Natural language processing to enable it to communicate successfully in English
o Knowledge representation to store what it knows or hears
o Automated reasoning to use the stored information to answer questions and to draw
new conclusions
o Machine learning to adapt to new circumstances and to detect and extrapolate patterns
o Computer vision to perceive the objects
o Robotics to manipulate objects and move about

(b)Thinking humanly: The cognitive modeling approach

We need to get inside actual working of the human mind:


 Through introspection – trying to capture our own thoughts as they go by;
 Through psychological experiments
 Allen Newell and Herbert Simon, who developed GPS –“General Problem Solver” tried to trace
the 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 try to construct precise and testable theories of the
workings of the human mind

(c) Thinking rationally: The “laws of thought approach”

 The Greek philosopher Aristotle was one of the first to attempt to codify “right thinking” that is
irrefutable reasoning processes. His reasoning provided patterns 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 and their study initiated a field called logic.

(d)Acting rationally: The rational agent approach

 An agent is something that acts. Computer agents are not mere programs, but they are expected to
have the following attributes also:
(1) operating under autonomous control,
(2) perceiving their environment,
(3) persisting over a prolonged time period,
(4) adapting to change.
 A rational agent is one that acts so as to achieve the best outcome.
 Knowledge representation and reasoning enable agents to reach good decisions.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


2. THE FOUNDATIONS OF ARTIFICIAL INTELLIGENCE

The foundation provides the disciplines that contributed ideas, viewpoints and techniques to AI.

Philosophy

Control theory
and Mathematics
cybernetics

Computer
engineering
Linguistics

Psychology Economics

Neuroscience

Philosophy

Philosophy is the very basic foundation of AI. The study of fundamental nature of knowledge, reality
and existence are considered for solving a specific problem is a basic thing in AI.
Examples some of the Philosophies are:
- Aristotle proposed SYLLOGISM, an instance of a form of reasoning in which a conclusion is
drawn from two given or assumed propositions, “Socrates is a man; all men are mortal; therefore,
Socrates is mortal.”
- Ramon Lull proposed the idea that useful reasoning could actually be carried out by a mechanical
artifact.
- Thomas Hobbes proposed that reasoning was like numerical computation that “we add and subtract
in our silent thoughts.”
- Descartes was a strong advocate of rationalism and dualism.
- David Hume’s proposed the principle of induction: that general rules are acquired by exposure to
repeated associations between their elements.
- Rudolf Carnap, developed the doctrine of logical positivism that combines rationalism and
empiricism.

Mathematics

AI requires Formal Logic and Probability for planning and learning


Computations are required for analyzing relation and implementation. Algorithms where used for
logical deductions and computations. Knowledge in Formal Representation are most required for
writing actions for agents.
In AI the Mathematics & Statistics are most important for
- Proving theorems
- Writing algorithms
- Computations

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


- Decidability
- Tractability
- Modeling uncertainty
- Learning from data

Economics

Deals with investing the amount of money and maximization of utility with minimal investment.
Decision theory, which combines probability theory with utility theory, provides a formal and
complete framework for decisions. While developing AI products, we should make decisions for
When to invest?
How to invest?
How much to invest? And
Where to invest?
To answer these questions one should have knowledge about Decision Theory, Game Theory, and
Operation Research.

Neuroscience

Neuroscience is the study of the nervous system (human brain). When compared to other creatures,
man has the largest brain in proportion to his size. The brain consisted largely of nerve cells, or neurons
and the observation of individual neurons can lead to thought, action, and consciousness of one’s brain.

Psychology/ Cognitive Science

The scientific method to the study of human vision, how the mind works, functions and behaves.
Cognitive science relies on developing representative structures of the mind and analyzing
computational procedures that run on those structures to understand better how the thinking process
unfolds within the human brain.

Computer Engineering

For AI to succeed we need intelligence and computer as artifacts. Computer hardware gradually
changed for AI applications, such as the graphics processing unit (GPU), tensor processing unit (TPU)
and wafer scale engine (WSE). The amount of computing power used to train top machine learning
applications and the utilization doubled every 100 days. The super computers and quantum computers
can solve very complicated AI problems.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


AI has founded many ideas including time sharing, interactive interpreters, personal computers with
windows and mice, rapid development environments, linked list data type, automatic storage
management, object oriented programming.

Control theory and Cybernetics

Control theory helps the system to analyze, define, debug and fix errors by itself.
Developing self-controlling machine, self-regulating feedback control systems and the submarine are
some examples of control theory. Calculus and matrix algebra and the tools of control theory provide
themselves to systems that are describable by fixed sets of continuous variables are foundations of AI.
Knowledge representation, grammars, computational linguistics or NLP are significant to developing
AI applications

Linguistics

Speech technology is a technology which enables a machine to understand the spoken language and
translate into machine readable format. It is a way to talk with a computer and on the basis of that
command a computer can perform a specific task. It include speech to text, Text to speech.

3. THE HISTORY OF AI

ENIAC stands for electronic numerical integrator and computers. It is the first electronic general
purpose computer, and it was Turing complete. It was capable of being reprogrammed to solve a large
class of numerical problems. It was designed to compute artillery firing tables for the United States
Army. It was being used for defense purposes.

Maturation of Artificial Intelligence (1943-1952)


 Year 1943: The first work which is now recognized as AI was done by Warren McCulloch and
Walter pits in 1943. They proposed a model of artificial neurons.
 Year 1949: Donald Hebb demonstrated an updating rule for modifying the connection strength
between neurons. His rule is now called Hebbian learning.
 Year 1950: The Alan Turing who was an English mathematician and pioneered Machine learning
in 1950. Alan Turing publishes "Computing Machinery and Intelligence" in which he proposed
a test. The test can check the machine's ability to exhibit intelligent behavior equivalent to human
intelligence, called a Turing test.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


The birth of Artificial Intelligence (1952-1956)

 Year 1955: An Allen Newell and Herbert A. Simon created the "first artificial intelligence
program"Which was named as "Logic Theorist". This program had proved 38 of 52
Mathematics theorems, and find new and more elegant proofs for some theorems.
 Year 1956: The word "Artificial Intelligence" first adopted by American Computer scientist
John McCarthy at the Dartmouth Conference. For the first time, AI coined as an academic
field.
At that time high-level computer languages such as FORTRAN, LISP, or COBOL were
invented. And the enthusiasm for AI was very high at that time.

The golden years-Early enthusiasm (1956-1974)

 Year 1966: The researchers emphasized developing algorithms which can solve mathematical
problems. Joseph Weizenbaum created the first chatbot in 1966, which was named as ELIZA.
 Year 1972: The first intelligent humanoid robot was built in Japan which was named as
WABOT-1.
 The first AI winter (1974-1980)
 The duration between years 1974 to 1980 was the first AI winter duration. AI winter refers to
the time period where computer scientist dealt with a severe shortage of funding from
government for AI researches.
 During AI winters, an interest of publicity on artificial intelligence was decreased.

A boom of AI (1980-1987)

 Year 1980: After AI winter duration, AI came back with "Expert System". Expert systems were
programmed that emulate the decision-making ability of a human expert.
 In the Year 1980, the first national conference of the American Association of Artificial
Intelligence was held at Stanford University.
The second AI winter (1987-1993)

 The duration between the years 1987 to 1993 was the second AI Winter duration.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


 Again Investors and government stopped in funding for AI research as due to high cost but not
efficient result. The expert system such as XCON was very cost effective.
The emergence of intelligent agents (1993-2011)

 Year 1997: In the year 1997, IBM Deep Blue beats world chess champion, Gary Kasparov, and
became the first computer to beat a world chess champion.

 Year 1999: The remote agent system was a system that was supposed to manage this spacecraft.
If a fault happens, this remote agent system will understand that there is a fault, and it will correct
it. So it was a diagnosis and repair system.

 Year 2002: for the first time, AI entered the home in the form of Roomba, a vacuum cleaner.
 Year 2005: DARPA Grand Challenge. This was the first working demonstration of a long trip
taken by a car entirely by itself.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


 Year 2006: AI came in the Business world till the year 2006. Companies like Facebook, Twitter,
and Netflix also started using AI.

Deep learning, big data and artificial general intelligence (2011-present)

 Year 2011: In the year 2011, IBM's Watson won jeopardy, a quiz show, where it had to solve the
complex questions as well as riddles. Watson had proved that it could understand natural language
and can solve tricky questions quickly.
 Year 2012: Google has launched an Android app feature "Google now", which was able to provide
information to the user as a prediction.
 Year 2014: In the year 2014, Chatbot "Eugene Goostman" won a competition in the infamous
"Turing test."
 Year 2018: The "Project Debater" from IBM debated on complex topics with two master debaters
and also performed extremely well.

4. APPLICATIONS OF AI

 Autonomous planning and scheduling: A hundred million miles from Earth, NASA's Remote
Agent program became the first on-board autonomous planning program to control the scheduling
of operations for a spacecraft. Remote Agent generated plans from high-level goals specified from
the ground, and it monitored the operation of the spacecraft as the plans were executed-detecting,
diagnosing, and recovering from problems as they occurred.
 Game playing: You can buy machines that can play master level chess for a few hundred dollars.
There is some AI in them, but they play well against people mainly through brute force
computation--looking at hundreds of thousands of positions. To beat a world champion by brute
force heuristics requires looking at 200 million positions per second.
 Speech recognition: The ability of devices to respond to spoken commands. United Airlines has
replaced its keyboard tree for flight information by a system using speech recognition of flight

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


numbers and city names. It enables hands-free control of various devices and equipment and
provides input to automatic translation, and creates print-ready dictation.

 Understanding natural language and solving problems: PROVERB 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.
 Computer vision: The world is composed of three-dimensional objects, but the inputs to the
human eye and computers' TV cameras are two dimensional. Some useful programs can work
solely in two dimensions, but full computer vision requires partial three-dimensional information
that is not just a set of two-dimensional views. At present there are only limited ways of
representing three-dimensional information directly, and they are not as good as what humans
evidently use.
 Expert systems: Expert knowledge is a combination of theoretical understanding of the problem
and a collection of heuristic problem solving rules that experience has shown to be effective in the
domain. A ``knowledge engineer'' interviews experts in a certain domain and tries to embody their
knowledge in a computer program for carrying out some task. One of the first expert systems was
MYCIN in 1974, which diagnosed bacterial infections of the blood and suggested treatments. It
did better than medical students or practicing doctors, provided its limitations were observed. Its
interactions depended on a single patient being considered. Since the experts consulted by the
knowledge engineers knew about patients, doctors, death, recovery, etc., it is clear that the
knowledge engineers forced what the experts told them into a predetermined framework. The
usefulness of current expert systems depends on their users having common sense.
 Heuristic classification: Games can generate extremely large search spaces. So we use powerful
techniques called heuristics to explore the problem space. A heuristic is a useful but potentially
fallible problem strategy, such as checking to make sure that an unresponsive appliance is plugged
in before assuming that it is broken.
 Commonsense reasoning: It is the branch of Artificial intelligence concerned with replicating
human thinking. In theory, if the computer is endowed with good Knowledge Representation
Database, including a comprehensive common sense database, and is able to process and respond
in plain-text English, it will have the ability to process and reason with English texts. There are
two issues with this, one is how to represent the knowledge gathered in a computer processible,
and human accessible way. The second task is actually collecting the Common Sense knowledge.
 Planning and robotics: Research in planning began as an effort to design robots that could
perform their tasks with some degree of flexibility and responsiveness to outside world. Planning
assumes a robot that is capable of performing certain atomic actions. One method that human
beings use in planning is hierarchical problem decomposition. A robot will have to formulate a
plan based on the incomplete information and correct its behavior.
 Neural nets and genetic algorithms: An approach to build intelligent programs is to use models
that parallel the structure of neurons in the human brain. Each computational unit computes some
functions of its inputs and passes the result along to connected units in the network; final results
are produced by the parallel and distributed processing of this network of neural connection and
threshold weights.

5. AN INTELLIGENT AGENT

An agent is something that perceives and acts in an environment


Agents can be:

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


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

The main four rules for an AI agent:

 Rule 1: An AI agent must have the ability to perceive the environment.

 Rule 2: The observation must be used to make decisions.


 Rule 3: Decision should result in an action.

 Rule 4: The action taken by an AI agent must be a rational action.

Agent Function: The agent function for an agent specifies the action taken by the agent in response
to any percept sequence. Agent can be described internally and externally. Tabulating the agent
function is external implementation, and internally agent function is implemented by agent programs.
Eg: Vacuum cleaner problem:- The agent is in one of two locations, each of which might or might not
contain dirt. 2*4 = 8 possible states. Any state can be designated as the initial state. The actions are
left, right, suck. Goal test checks whether all the squares are clean. Path cost is the no. of steps in the
path.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


Figure: The state space of a vacuum world

Rational Agent
Definition: 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.
It can be any piece of software, hardware or a combination of the two which can interact with
the environment with actuators after perceiving the environment with sensors. A rational agent
should strive to do the right thing. The right action is the one that will cause the agent to be most
successful.
Performance measure: An objective criterion for success of an agent’s behavior.
Eg:
Rational agent – vacuum cleaner
Environment – floor.
Sensor- dirt sensor or camera
Actuator- brush and suction pump
Percept - agent’s perceptual inputs at any given point of time
Performance measure- Amount of dirt cleaned up, amount of time taken, amount of electricity
consumed, amount of noise generated etc.

Intelligent agent Rational agent Omniscient agent


An Intelligent Agent is a system A Rational Agent is an It knows the actual
that can perceive its environment Intelligent Agent that makes outcomes of its actions.
and take actions to achieve a decisions based on logical Eg: tic-tac-toe
specific goal. reasoning and optimizes its
Eg: self-driving car, virtual behavior to achieve a specific
personal assistant goal.
Eg: chess playing program,
financial assistant

Rationality
The rationality of an agent is measured by its performance measure. Rationality can be judged on the
basis of following points:
 Performance measure which defines the success criterion.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


 Agent prior knowledge of its environment.

 Best possible actions that an agent can perform.

 The sequence of percepts.


PEAS Representation

PEAS System is used to group similar type of agents together. The PEAS system delivers the
performance measure with respect to the environment, actuators, and sensors of the respective agent.
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.

Performance measure: It
is the objective for success
of an agent's behavior

Sensors: Devices from


Environment: All
which agent perceives
PEAS surrounding things
observation from
and conditions
environment

Actuators: Devices , h/w,


s/w through which agent
performs actions on
environment

Example: PEAS for self-driving cars:


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

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


Types of Environments in AI

An environment in artificial intelligence is the surrounding of the agent. The agent takes input from
the environment through sensors and delivers the output to the environment through actuators. There
are several types of environments:
 Fully Observable vs Partially Observable
 Deterministic vs Stochastic
 Competitive vs Collaborative
 Single-agent vs Multi-agent
 Static vs Dynamic
 Discrete vs Continuous
 Episodic vs Sequential
 Known vs Unknown

Fully Observable Partially Observable


An agent sensor is capable to sense or access the An agent sensor is not able to access the complete
complete state of an agent at each point in time. state of an agent.
Maintaining a fully observable environment is easy Eg: Driving – the environment is partially observable
as there is no need to keep track of the history of the because what’s around the corner is not known.
surrounding.
Eg: Chess – the board is fully observable, and so are
the opponent’s moves.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


Deterministic Stochastic
Agent’s current state and selected action can Nature of the environment is random and can’t be
completely determine the environment’s next state. determined by the agent alone.
Eg: Chess- there would be only a few possible moves Eg: self-driving cars- the actions are not unique, it
and the moves can be determined varies time to time

Competitive Collaborative
An agent competes against another agent to optimize An agent cooperate with multiple agents to produce
the output. the desired output.
Eg: Chess- players compete with each other to win Eg: self-driving cars and other vehicles cooperate
the game which is the output with each other to avoid collisions.

Single agent Multi agent


An environment consisting of only one agent. An environment involving more than one agent.
Eg: A person left alone in a maze Eg: Football game involves 11 players in each team

Dynamic Static
State of environment changes with time when agent State of environment does not changes with time.
perform some actions. (idle environment)
Eg: A roller coaster ride Eg: An empty house

Discrete Continuous
If an environment consists of a finite number of Agent can perceive and make observations from the
actions that can be deliberated in the environment to environment continuously without any lag.
obtain the output. Eg: The game of chess is discrete Eg: Self-driving cars are an example of continuous
as it has only a finite number of moves environments as their actions are driving, parking,
etc. which cannot be numbered

Episodic Sequential
Each of the agent’s actions is divided into atomic The previous decisions can affect all future
incidents or episodes. There is no dependency decisions. The next action of the agent depends on
between current and previous incidents. what action he has taken previously and what action
Eg: Pick and Place robot, which is used to detect he is supposed to take in the future.
defective parts from the conveyor belts. Here, every Eg: Checkers
time robot will make the decision on the current part
i.e. there is no dependency between current and
previous decisions.

Unknown Known
It has to gain knowledge about how the The output for all probable actions is given.
environment works

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


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:
 Agent = Architecture + Agent program
 Following are the main three terms involved in the structure of an AI agent:
o Architecture: Architecture is machinery that an AI agent executes on.
o Agent Function: Agent function is used to map a percept to an action.
f: P* → A
o Agent program: Agent program is an implementation of agent function. An agent
program executes on the physical architecture to produce function f.

Types of Agent Programs

Five basic kinds of agent programs that embody the principles underlying almost all intelligent
systems:
1. Simple reflex agents
2. Model-based reflex agents
3. Goal-based agents and
4. Utility-based agents
5. Learning agents

Simple Reflex Agent

This agent’s works only on the basis of current perception and it does not bother about the previous
state in which the system was. This type of agents is based upon the condition- action rule. Action
becomes a “reflex.”
If the condition is true
Action is taken
Else not

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


The INTERPRET-INPUT function generates an abstracted description of the current state from the
percept.
The RULE-MATCH function returns the first rule in the set of rules that matches the given state
description.
The RULE –ACTION function returns the action that matches the rule
Eg: If automated taxi driver is a simplex reflex agent:- Behind a car, it would either brake continuously
and unnecessarily or never brake at all.
Problems faced:
1. Very limited intelligence
2. No knowledge about the non- perceptual parts of the state
3. Operating in partially observable environment infinite loops are unavoidable.

Model- Based Reflex Agents

It works by finding a rule whose condition matches the current situation. It can handle partially
observable environments. Updating the state requires information about how the world evolves
independently from the agent & how the agent actions affect the world. Knowledge about “how the
world works is called a model of the world. An agent that uses such a model is called a model-based
agent.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


UPDATE-STATE function is responsible for creating the new internal state description.

Goal –Based Reflex Agents

The goal based agent focuses only on reaching the goal set and hence the decision took by the agent
is based on how far it is currently from their goal or desired state. Their every action is intended to
minimize their distance from the goal. Typical model for search and planning.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


Utility- Based Agents

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. Possibly
more than one goal, or more than one way to reach it. They focus on goals and best way to reach the
goal.

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering


Learning Agents

All agents have methods for selecting actions. It has four conceptual components.
Performance element: the previously described actions and changes in states.
Learning element: makes changes to actions
Critic: Evaluate actions, gives feedback to learning element.
Problem generator: Suggests actions

Prepared by Anuja Radhakrishnan,CSE, Providence College Of Engineering

You might also like