0% found this document useful (0 votes)
16 views

Introduction To AI

Uploaded by

Raunak Das
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Introduction To AI

Uploaded by

Raunak Das
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Artificial Intelligence

Syllabus

Artificial Intelligence ( PEC-IT501B ) Semester: V

Introduction [2]: Overview of Artificial intelligence- Problems of


AI, AI technique, Tic - Tac - Toe problem.
Intelligent Agents [2]: Agents & environment, nature of
environment, structure of agents, goal based agents, utility based
agents, learning agents.
Problem Solving [2]: Problems, Problem Space & search: Defining
the problem as state space search, production system, problem
characteristics, issues in the design of search programs. Solving
problems by searching :problem solving agents, searching for
solutions; uniform search strategies: breadth first search, depth first
search, depth limited search, bidirectional search, comparing uniform
search strategies.
Syllabus

Heuristic search strategies [5]: Greedy best-first search, A*


search, memory bounded heuristic search: local search algorithms
& optimization problems: Hill climbing search, simulated
annealing search, local beam search, genetic algorithms; constraint
satisfaction problems, local search for constraint satisfaction
problems.
Adversarial search [3]: Games, optimal decisions & strategies
in games, the minimax search procedure, alpha-beta pruning,
additional refinements, iterative deepening
Knowledge & reasoning [3]: Knowledge representation issues,
representation & mapping, approaches to knowledge
representation, issues in knowledge representation.
Using predicate logic [2]: Representing simple fact in logic,
representing instant & ISA relationship, computable functions &
predicates, resolution, natural deduction.
Syllabus

Probabilistic reasoning [4]: Representing knowledge in an


uncertain domain, the semantics of Bayesian networks,
Dempster-Shafer theory, Fuzzy sets & fuzzy logics.
Natural Language processing [2]: Introduction, Syntactic
processing, semantic analysis, discourse & pragmatic processing.
Learning [2]: Forms of learning, inductive learning, learning
decision trees, explanation based learning, learning using relevance
information, neural net learning & genetic learning.
Expert Systems [2]: Representing and using domain knowledge,
expert system shells, knowledge acquisition.
Books

Text book and Reference books:


1.Artificial Intelligence, Ritch & Knight, TMH
2. Artificial Intelligence A Modern Approach, Stuart Russel
Peter Norvig Pearson
3. Artificial Intelligence, A Classical Approach, Munish
Chandra Trivedi, Khanna Publishing
4. Introduction to Artificial Intelligence & Expert Systems,
Patterson, PHI
5. Poole, Computational Intelligence, OUP
6. Logic & Prolog Programming, Saroj Kaushik, New Age
International
7. Expert Systems, Giarranto, VIKAS
Artificial Intelligence

Introduction
Introduction

Humans are the wise and because of our intelligence


we have tried to understand how we think; that is, how
an incident can be perceived, understood, predicted,
and manipulated in the real world in favor of us.
Artificial Intelligence attempts not just to understand
but also to build intelligent entities which can perform
task on behalf of human like, a human.
What is Intelligence

Intelligence is a property of mind that encompasses


many related mental abilities, such as the
capabilities to
❖ reason
❖ plan
❖ solve problems
❖ think abstractly
❖ comprehend ideas and language and
❖ learn
What is Intelligence

The intelligence of an entity can be measured basically


in two different approach
❖ entity is expected to behave or act as intelligently

as a human
❖ entity should exhibit thought process or reasoning

ability
Along with this an intelligent entity must be
rational, e.g. it does the “right thing” based on what
it knows.

Based on that there are few approach that define AI


What is Intelligence
Acting humanly: The Turing Test approach

The Turing Test, proposed by Alan Turing (1950), was


designed to provide a satisfactory operational
definition of intelligence. A computer passes the test if
a human interrogator, after posing some written
questions, cannot tell whether the written responses
come from a person or from a computer.
A Turing Test is a method of inquiry in artificial
intelligence (AI) for determining whether or not a
computer is capable of thinking like a human being.
The test is named after Alan Turing, the founder of the
Turing Test and an English computer scientist,
cryptanalyst, mathematician and theoretical biologist.
Acting humanly: Turing Test (2)

Turing proposed that a computer can be said to


possess artificial intelligence if it can mimic human
responses under specific conditions. The original
Turing Test requires three terminals, each of which is
physically separated from the other two. One terminal
is operated by a computer, while the other two are
operated by humans.
Acting humanly: Turing Test (3)

During the test, one of the humans functions as the


questioner, while the second human and the computer
function as respondents. The questioner interrogates the
respondents within a specific subject area, using a
specified format and context. After a preset length of
time or number of questions, the questioner is then
asked to decide which respondent was human and which
was a computer.
The test is repeated many times. If the questioner makes
the correct determination in half of the test runs or less,
the computer is considered to have artificial intelligence
because the questioner regards it as "just as human" as
the human respondent.
Acting humanly: Turing Test (4)

In order to pass the turing test 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 patterns.
The total Turing Test

Includes two more issues:


Computer vision : to perceive objects (seeing)
Robotics : to move objects (acting)
Thinking humanly: The cognitive modeling
approach

If we demand that a given program thinks like a


human, we must have some way of determining how
humans think.
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; and
Through brain imaging—observing the brain in
action.
Thinking humanly

Once we have a sufficiently knowledge of the mind, it


becomes possible to express that theory as a computer
program. If the program’s input–output behavior
matches corresponding human behavior then we can
say that computer thinks like human and it is
intelligent.
Thinking rationally: The “laws of thought”
approach

The Greek philosopher Aristotle was one of the first to


attempt to codify “right thinking,”. 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. If a computer can response in the logic,
then it is said to be intelligent.
Acting rationally: The rational agent
approach

“Agent” word comes from from the Latin word “agere”


which means “to do”. An agent is just something that
acts.
Though 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.
If a computer can act like a rational agent, then the
Why Artificial Intelligence?

AI can have two purposes;


❖ One is to use the power of computers to augment
human thinking, just as we use motors to augment
human or horse power. Robotics and expert
systems are major branches of that.
❖ The other is to use a computer's artificial
intelligence to understand how humans think in a
humanoid way. If you test your programs not
merely by what they can accomplish, but how they
accomplish it, they you're really doing cognitive
science; you're using AI to understand the human
mind."
The Foundation of AI

The AI field is interdisciplinary, in which a number of


sciences and professions converge, including
Philosophy: Dealt with questions like: Can formal rules be
used to draw valid conclusions? Where does knowledge come
from? How does it lead to action?
Economics: This deals with question like: How do we make
decisions so as to maximize payoff? How do we do this when
the payoff may be far in the future?
Mathematics: This formalizes the three main area of AI:
computation, logic, and probability.
Computation leads to analysis of the problems that can be computed
(complexity theory). Probability contributes the “degree of belief” to
handle uncertainty in AI. Decision theory combines probability theory
and utility theory (bias)
The Foundation of AI

Psychology: Computer models can be used to understand


the psychology of memory, language and thinking; The
brain is now thought of in terms of computer science
constructs like I/O units, and processing center
Computer Science/Engineering: How to build an
efficient computer? Provides the artifact that makes AI
application possible.
❖ AI has also contributed its own work to computer

science, including: time-sharing, the linked list data


type, OOP, etc.
Control theory: Purposeful behaviour as arising from a
regulatory mechanism to minimize the difference between
goal state and current state (“error”)
The Foundation of AI

Cybernetics- the study of communication and


control, typically involving regulatory feedback, in
living organisms, in machines, and in combinations of
the two
Linguistics: For understanding natural languages :-
different approaches has been adopted from the
linguistic work like Formal languages, Syntactic and
semantic analysis, Knowledge representation.
Neuroscience: Study of the nervous system, esp. brain
which is a collection of simple cells can lead to thought and
action. Cycle time: Human brain is microseconds; while
that of computers- nanoseconds; The brain is still 100,000
The State of the Art

A concise answer to the question “What can AI do


today?” is difficult because there are so many
activities in so many subfields. But some of the
important use of AI include the following.
Robotic vehicles: A driverless robotic car.
Speech recognition: Many company uses
conversation with customers guided by an automated
speech recognition and dialog management system.
Autonomous planning and scheduling : AI is
now a days used for autonomous planning program to
control the scheduling of operations for a spacecraft
like complicated system also.
The State of the Art

Game playing: IBM’s DEEP BLUE became the first


computer program to defeat the world champion in a
chess match when it bested Garry Kasparov by a score
of 3.5 to 2.5 in an exhibition match (Goodman and
Keene, 1997).
Spam fighting: Each day, learning algorithms
classify over a billion messages as spam, saving the
recipient from having to waste time deleting
Logistics planning: AI is now a days used to do
automated
logistics planning and scheduling for transportation
involving thousands of vehicles, cargo, and people at a
time, and had to account for starting points,
The State of the Art

Robotics: Starting from robotic vacuum cleaners like


household appliances, doing repetitive job in factory to
robot capable of handling hazardous materials,
clearing explosives, and identify the location of
snipers.
Machine Translation: AI based computer program
automatically translates from one natural language
helping one person to understand text/speech in other
language.
What AI can do?

The general problem of simulating (or creating)


intelligence has been broken down into a number of
specific sub-problems
❖ Deduction, reasoning, problem solving

❖ Knowledge representation

❖ Planning

❖ Learning

❖ Natural language processing (communication)

❖ Perception

❖ Ability to move and manipulate objects


Artificial Intelligence :An Overview

A view of the world:


Three segments – Totally known segment, Partially
Known, Totally Unknown

Segment 1 – Totally known segment. All


knowledge in this segment is known. Methods exist for
all problems.
Solutions are method oriented. Underlying patterns
can be ignored. Example - Find the square root of a
number
A view of the world

Segment 2 – Partially Known.


Quite a lot is known about topics in this segment, but
not everything. Incomplete, Ambiguous patterns.
Example – Diagnosing diseases.

Segment 3 - Totally Unknown


Hardly anything of topics in this area is known.
Human beings are themselves unable to do much here.
Example - Life on other planets
Artificial Intelligence :An Overview

Intelligence is required to handle problems in


Segment 2.
Algorithmic approaches cannot work here as an
algorithm, by definition is finite, definite, and effective.
(Definite is the opposite of ambiguous.)
As more knowledge is acquired, topics in Segment 3
move to Segment 2 and topics in Segment 2 move to
Segment 1.
Problem that artificial intelligence attempts to handle
is “Providing efficient solutions to problems in an
ambiguous, incomplete pattern area”. Artificial
intelligence itself lies in Segment 2 of the view of the
Artificial Intelligence :An Overview

Artificial Intelligence - Enabling computers to work


efficiently with Incomplete, Complex Patterns.

What is the problem?


In real world solution space of a specific problem is
incomplete, complex patterns and a large unbounded
search space. Searching this is time consuming and
may be solve in Non Polynomial time complexity. AI
can help in this situation.
The main topics in AI

Artificial intelligence can be considered under a


number of headings:
❖ Search (includes Game Playing).

❖ Representing Knowledge and Reasoning with it.

❖ Planning.

❖ Learning.

❖ Natural language processing.

❖ Expert Systems.

❖ Interacting with the Environment

(e.g. Vision, Speech recognition, Robotics)


Search

Search is the fundamental technique of AI. Possible


answers, decisions or courses of action are structured
into an abstract space, which we then search. Search is
either "blind" or “uninformed":
blind : we move through the space without worrying
about what is coming next, but recognising the answer if
we see it.
informed : we guess what is ahead, and use that
information to decide where to look next.
We may want to search for the first answer that satisfies
our goal, or we may want to keep searching until we find
the best answer.
Knowledge Representation & Reasoning

The second most important concept in AI is knowledge


representation. If we are going to act rationally in our
environment, then we must have some way of
describing that environment and drawing inferences
from that representation.
❖ how do we describe what we know about the world

?
❖ how do we describe it concisely ?

❖ how do we describe it so that we can get hold of the

right piece of knowledge when we need it ?


❖ how do we generate new pieces of knowledge ?

❖ how do we deal with uncertain knowledge ?


Knowledge Representation & Reasoning

Declarative knowledge deals with factoid questions


(what is the capital of India? Etc.)
Procedural knowledge deals with “How”
Procedural knowledge can be embedded in
declarative knowledge
Planning

Given a set of goals, construct a sequence of actions that


achieves those goals. For this often a very large search
space may need to consider, but most parts of the world
are independent of most other parts.
❖ Therefore often we need to start with goals and

connect them to actions through proper planning to


achieve that goal.
❖ what happens if the world changes as we execute the

plan and/or our actions don’t produce the expected


results?
Learning

If a system is going to act truly appropriately, then it


must be able to change its actions in the light of
experience:
❖ how do we generate new facts from old ?

❖ how do we generate new concepts ?

❖ how do we learn to distinguish different situations

in new environments ?
Interacting with the Environment

In order to enable intelligent behaviour, we will have


to interact with our environment.
Properly intelligent systems may be expected to:
❖ accept sensory input
➢ vision, sound, …
❖ interact with humans
➢ understand language, recognise speech, generate text,
speech and graphics, …
❖ modify the environment
➢ robotics
Advantages of Artificial Intelligence

❖ new and improved interfaces


❖ solving new problems
❖ better handling of information
❖ relieves information overload
❖ more powerful and more useful computers
❖ conversion of information into knowledge
Disadvantages of Artificial Intelligence

❖ increased costs
❖ difficulty with software development - slow and
expensive
❖ few experienced programmers
❖ few practical products have reached the market as
yet.
State Space Search: Water Jug Problem

In the water jug problem in Artificial Intelligence, we are


provided with two jugs: one having the capacity to hold 3
gallons of water and the other has the capacity to hold 4
gallons of water. There is no other measuring equipment
available and the jugs also do not have any kind of marking
on them.
So, the agent’s task here is to fill the 4-gallon jug with 2
gallons of water by using only these two jugs and no other
material. Initially, both our jugs are empty.
So, to solve this problem, following set of rules were proposed:
Water Jug Problem
Here, let x denote the 4-gallon jug and y denote the 3-gallon jug.
Sl No Initial State Condition Final state Description

1 (x,y) if x<4 (4,y) Fill the 4 gallon jug completely

2 (x,y) if y<3 (x,3) Fill the 3 gallon jug completely

3 (x,y) if x>0 (x-d,y) Pour some part from the 4 gallon jug

4 (x,y) if y>0 (x,y-d) Pour some part from the 3 gallon jug

5 (x,y) if x>0 (0,d) Empty the 4 gallon jug

6 (x,y) if y>0 (x,0) Empty the 3 gallon jug

7 (x,y) if (x+y)<7 (4, y-[4-x]) Pour some water from 3 gallon jug to fill the 4 gallon
jug

8 (x,y) if (x+y)<7 (x-[3-y],y) Pour some water from 4 gallon jug to fill 3 gallon jug

9 (x,y) if (x+y)<4 (x+y,0) Pour all water from 3 gallon jug to the 4 gallon jug

10 (x,y) if (x+y)<3 (0, x+y) Pour all water from 4 gallon jug to 3 gallon jug
Water Jug Problem

The listed production rules contain all the actions that could be performed by the agent in
transferring the contents of jugs. But, to solve the water jug problem in a minimum number of
moves, following set of rules in the given sequence should be performed:

Solution of water jug problem according to the production rules:

S.No. 4 gallon jug contents 3 gallon jug contents Rule followed


1. 0 gallon 0 gallon Initial state
2. 0 gallon 3 gallons Rule no.2
3. 3 gallons 0 gallon Rule no. 9
4. 3 gallons 3 gallons Rule no. 2
5. 4 gallons 2 gallons Rule no. 7
6. 0 gallon 2 gallons Rule no. 5
7. 2 gallons 0 gallon Rule no. 9

On reaching the 7th attempt, we reach a state which is our goal state. Therefore,
at this state, our problem is solved
Tic Tac Toe: AI Problem

In the game Tic-Tac-Toe game the two player needs to


mark in the spaces of a 3x3 grid with their own marks
(may be ‘X’ and ‘0’), if 3 consecutive marks
(Horizontal, Vertical,Diagonal) are formed then the
player who owns these moves get won.
Tic-Tac-Toe

Initial State: Board position of 3x3 matrix with 0 and X.


Operators: Putting 0’s or X’s in vacant positions
alternatively
Terminal test: Which determines game is over
Utility function: e(p) = (No. of complete rows, columns
or diagonals are still open for player ) – (No. of
complete rows, columns or diagonals are still open for
opponent )

e(p) = 6 - 5 = 1
MinMax Algorithm for game playing

Generate the game tree


Apply the utility function to each terminal state to get
its value
Use these values to determine the utility of the nodes
one level higher up in the search tree
From bottom to top
For a max level, select the maximum value of its
successors
For a min level, select the minimum value of its
successors
From root node select the move which leads to highest
value
Game Tree of Tic-Tac-Toe
Game Tree of Tic-Tac-Toe
Observation

❖ Minimax algorithm, presented above, requires


expanding the entire state-space.
❖ Severe limitation, especially for problems with a
large state-space.
❖ Some nodes in the search can be proven to be
irrelevant to the outcome of the search
Thank You!!

You might also like