Download Artificial Intelligence: CIT 246

Document related concepts

Ecological interface design wikipedia , lookup

Incomplete Nature wikipedia , lookup

Visual Turing Test wikipedia , lookup

Multi-armed bandit wikipedia , lookup

Technological singularity wikipedia , lookup

Computer vision wikipedia , lookup

Artificial intelligence in video games wikipedia , lookup

Wizard of Oz experiment wikipedia , lookup

Human–computer interaction wikipedia , lookup

Expert system wikipedia , lookup

AI winter wikipedia , lookup

Embodied cognitive science wikipedia , lookup

Knowledge representation and reasoning wikipedia , lookup

Computer Go wikipedia , lookup

Intelligence explosion wikipedia , lookup

Ethics of artificial intelligence wikipedia , lookup

Existential risk from artificial general intelligence wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Philosophy of artificial intelligence wikipedia , lookup

Transcript
Artificial Intelligence
By
Dr. A.S.Alvi
Artificial Intelligence
Artificial
+
Intelligence
Intelligence ?
What is Intelligence ?
“The ability to learn, understand
and think” (Oxford dictionary)
What is Intelligence ?
“The capacity to learn and solve
problems” (Webster dictionary)
What is Intelligence ?
“ The ability to acquire knowledge
and use it" (Pigford and Baur)
What is Intelligence ?
Intelligence is a property of mind that encompasses
many related mental abilities, such as the capabilities to

reason

think abstractly

plan

comprehend ideas and language

solve problems

learn
Artificial ?
Artificial:
Produced by human art or effort,
rather than originating naturally.
Artificial:
Produced by human art or effort, rather than originating naturally.
Intelligence:
is the ability to acquire knowledge and use it" [Pigford and Baur]
So
AI is defined as:
 AI
is the study of ideas that enable computers to be intelligent.
 AI
is the part of computer science concerned with design of
computer systems that exhibit human intelligence.
AI cont……
From the above two definitions, we can see that AI has
two major roles:
 Study
the intelligent part concerned with humans.
 Represent
those actions using computers.
What is Artificial Intelligence (AI)?




Computational models of human behavior?
• Programs that behave (externally) like humans,
Computational models of human “thought”
• Programs that operate (internally) the way
humans do
Computational systems that behave intelligently?
• What does it mean to behave intelligently?
Computational systems that behave rationally
• More on this later
What is Artificial Intelligence ?
THOUGHT
BEHAVIOUR
Systems that think Systems that think
like humans
rationally
Systems that act
like humans
HUMAN
Systems that act
rationally
RATIONAL
More Formal Definition of AI

AI is a branch of computer science which is
concerned with the study and creation of computer
systems that exhibit
 some
form of intelligence
OR
 those
characteristics which we associate with
intelligence in human behavior
More Formal Definition of AI cont……

A field that focuses on developing techniques to enable
computer systems to perform activities that are considered
intelligent (in humans and other animals). [Dyer]

The science and engineering of making intelligent
machines, especially intelligent computer programs. It is
related to the similar task of using computers to
understand human intelligence, but AI does not have to
confine itself to methods that are biologically observable.
[McCarthy]
More Formal Definition of AI cont……

The study of how to make computer do things which,
at the moment, people do better. [Rich&Knight]

The design and study of computer programs that
behave intelligently. [Dean, Allen, & Aloimonos]

The study of [rational] agents that exist in an
environment and perceive and act. [Russell&Norvig]
Major Branches of AI
 Perceptive system

A system that approximates the way a human sees, hears, and
feels objects
 Vision
system
 Capture, store, and manipulate visual images and pictures
 Robotics

Mechanical and computer devices that perform tedious tasks
with high precision
 Expert
system
 Stores knowledge and makes inferences
 Learning
system
 Computer changes how it functions or reacts to situations based
on feedback
 Natural
language processing
 Computers understand and react to statements and commands
made in a “natural” language, such as English
 Neural
network
 Computer system that can act like or simulate the functioning
of the human brain
Artificial
intelligence
Vision
systems
Learning
systems
Robotics
Expert systems
Neural networks
Natural language
processing
Agents
Software that gathers information about an
environment and takes actions based on that

a robot

a web shopping program

a factory

a traffic control system…
Some applications of AI

Game Playing
Speech Recognition
Computer Vision
Expert Systems
Diagnostic Systems
Financial Decision Making
Classification Systems
Mathematical Theorem Proving
Natural Language Understanding

Scheduling and Planning

Robotics and Path planning
Biology and medicine









Production System

A production system consists of four basic components:
1. A set of rules of the form Ci → Ai where Ci is the condition part
and Ai is the action part. The condition determines when a given
rule is applied, and the action determines what happens when it
is applied.
2. One or more knowledge databases that contain whatever
information is relevant for the given problem.
3. A control strategy that determines the order in which the rules
are applied to the database, and provides a way of resolving any
conflicts that can arise when several rules match at once.
4. A rule applier which is the computational system that
implements the control strategy and applies the rules
State Space Search





To provide a formal description of a problem:
Define a state space that contains all the possible
configurations of the relevant objects.
Specify the initial states.
Specify the goal states.
Specify a set of rules:
Solving a problem = search in the state space by using
the rules + control strategy
Control Strategies

Requirements of a good control strategy:
 It
causes motion.
Otherwise, it will never lead to a solution.
 It
is systematic.
Otherwise, it may use more steps than necessary.
 It
is efficient.
Find a good, but not necessarily the best, answer.
Control Strategies

Example 1: Water Jug Problem
Tree Structure

Example 2: Traveling Salesman Problem
Criteria for success.

One of the most important questions to answer in any
scientific or engineering research project is “How will we
know if we have succeeded?”

So how in AI we have to ask ourselves how will we know if
we have constructed a machine that is intelligent?
 The
question is hard as unanswerable question “What is
Intelligence?”
Criteria for success

To measure the progress we use proposed method known as
Turing Test.

Alan Turing suggested this method to determine whether the
machine can think.
 To conduct this test, we need two people and the machine
to be evaluated. One person act as interrogator, who is in a
separate room from the computer and the other person.
Criteria for success
 The
interrogator can ask questions to either the person or
computer by typing questions and received typed
responses.
 However
the interrogator knows them only as A and B and
aims to determine which is the person and which is the
machine.
 The
goal of the machine is to fool the interrogator into
believing that it is the person. If the machine succeeds at
this, then we will conclude that the machine can think.
Production Rules for Water Jug Problem
1. (x,y)
(4,y)
Fill the 4-gallon jug
(x,3)
Fill the 3-gallon jug
if x<4
2. (x,y)
if y<3
Production Rules for Water Jug Problem
3. (x,y)
if x>0
(x-d , y)
Pour some water out
the 4-gallon jug
4. (x,y)
if y>0
(x , y-d)
Pour some water out
the 3-gallon jug
Production Rules for Water Jug Problem
5. (x,y)
if x>0
(0,y)
Empty the 4-gallon jug on
the ground
6. (x,y)
if y>0
(x,0)
Empty the 3-gallon jug on
the ground
Production Rules for Water Jug Problem
7. (x,y)
if x+y4
and y>0
8. (x,y)
if x+y3
and x>0
(4,y-(4-x))
(4-(3-y) ,3)
Pour water from the
3-gallon jug into the
4-gallon jug until the
4-gallon jug is full
Pour water from the
4-gallon jug into the
3-gallon jug until the
3-gallon jug is full
Production Rules for Water Jug Problem
9.
(x,y)
if x+y4
and y>0
10. (x,y)
if x+y4
and x>0
(x+y,0)
Pour all water from the
3-gallon jug into
4-gallon jug
(0,x+y)
Pour all water from the
4-gallon jug into
3-gallon jug
Production Rules for Water Jug Problem
11. (0,2)
(2,0)
12. (2,y)
(0,y)
Pour the 2-gallon from the
3-gallon jug into
4-gallon jug
Empty the 2-gallon in
the 4-gallon jug on
the ground
Search Strategies: Blind Search
(Water Jug Problem Level1, level2)
Search Strategies: Heuristic Search
The Travelling Salesman Problem
 “A salesman has a list of cities, each of which he must visit
exactly once. There are direct roads between each pair of
cities on the list. Find the route the salesman should follow
for the shortest possible round trip that both starts and
finishes at any one of the cities.”

Heuristic is a technique that improves the efficiency of a
search process, possibly by sacrificing claims of completeness
or optimality.
Example 1: Traveling Salesman Problem

Given n cities with known distances between each pair, find
the shortest tour that passes through all the cities exactly once
before returning to the starting city

Alternatively: Find shortest Hamiltonian circuit in a weighted
connected graph

Example:
2
a
b
5
3
4
8
c
7
d
TSP by Exhaustive Search
Tour
Cost
a→b→c→d→a
2+3+7+5 = 17
a→b→d→c→a
2+4+7+8 = 21
a→c→b→d→a
8+3+4+5 = 20
a→c→d→b→a
8+7+4+2 = 21
a→d→b→c→a
5+4+3+8 = 20
a→d→c→b→a
5+7+3+2 = 17
Algorithm 2: The Nearest-Neighbor Algorithm

Step 1. Start at the designated starting vertex. If there is no
designated starting vertex, pick any vertex.

Step 2. From the starting vertex go to its nearest neighbor (the
vertex for which the corresponding edge has the smallest
weight.

Steps 3. From each vertex go to its nearest neighbor, choosing
only among the vertices that haven’t been yet visited. (If there
is more than one, choose at random). Keep doing this until all
the vertices have been visited.
Tower of Hanoi
There are three towers
The disks, with decreasing sizes, placed on the first tower
You need to move all of the disks from the first tower to the
second tower .Only one disk can be move at a time.
Larger disks can not be placed on top of smaller disks
The third tower can be used to temporarily hold disks
a
b
c
Tower of Hanoi
a
b
c
State Space Representations
The state space is simply the space of all possible
states, or configurations, that our system may be in.
Generally, of course, we prefer to work with some
convenient representation of that search space.
There are two components to the representation of
state spaces:
Static States
Transitions between States
State Space Graphs:

If the number of possible states of the system is small
enough, we can represent all of them, along with the
transitions between them, in a state space graph, e.g.
Inference Rules
Modus Ponens
From P and P → Q , infer Q.
P
P→Q
-----------Q
For ex:
Given :
(John is a student)
And :
(John is a student) → (John is a Engg student)
Conclude : (John is a Engg student)
Inference Rules
 Modus
tollens:
From Q and P → Q , infer P.
Q
P→Q
-----------P
For ex:
Given : (John is a Engg student)
And : (John is a student) → (John is a Engg student)
Conclude: (John is a student)
Inference Rules
 Chain
rule :
From P → Q , Q → R infer P → R.
P→Q
Q→R
-----------P→R
Tic-Tac-Toe
X
O

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 )
Game tree for Tic-Tac-Toe
Depth-first searching

A
B
C

D
E
F
H
L
M
I
N
O
G
J
P
K

Q

49
A depth-first search (DFS)
explores a path all the way to
a leaf before backtracking and
exploring another path
For example, after searching
A, then B, then D, the search
backtracks and tries another
path from B
Node are explored in the
order A B D E H L M N I O P
CFGJKQ
N will be found before J
Breadth-first searching

A
B
C

D
E
F
G

H
L
M
I
N
O
J
P
K
Q

A breadth-first search (BFS)
explores nodes nearest the
root before exploring nodes
further away
For example, after searching
A, then B, then C, the search
proceeds with D, E, F, G
Node are explored in the
order A B C D E F G H I J K
LMNOPQ
J will be found before N
Criterion
Time
Breadth-First Depth-First
bd
bm
Space
bd
bm
Optimal?
Yes
No
Complete?
Yes
No
b: branching factor
d: solution depth
m: maximum depth
Problem Characteristics

Is the problem decomposable?

Can solution steps be ignored or undone?

Is the universe predictable?

Is a good solution absolute or relative?

Is the solution a state or a path?

What is the role of knowledge?

Does the task require human-interaction?
Is the problem decomposable?


Can the problem be broken down to smaller problems to be
solved independently?
Decomposable problem can be solved easily.
2
(x2 + 3x + sin2x.cos x) dx
2
x dx
x3/3
3x dx
3x dx
2
2
 sin x.cos x dx
2
(1− cos x)cos2xdx
3x2/2

 cos2xdx
−  cos4xdx
Can solution steps be ignored or undone?

Ignorable (e.g. Theorem Proving), in which solution steps
can be ignored.

Recoverable (e.g. 8-puzzle), in which solution steps can be
undone.

Irrecoverable (e.g. Chess), in which solution steps can be
undone.
Is the universe predictable?

The 8-Puzzle: Every time we make a move, we know exactly
what will happen.
Certain outcome!

Playing Bridge: We cannot know exactly where all the cards
are or what the other players will do on their turns.
Uncertain outcome!
Is a good solution absolute or relative?

1. Marcus was a man
2. Marcus was a Pompeian
3. Marcus was born in 40 A.D
4. All men are mortal.
5. All Pompeians died when the volcano erupted in
79 A.D
6. No mortal lives longer than 150 years.
7. It is now 2008 A.D

Question: Is Marcus alive?







What is the role of knowledge?

Playing Chess
Knowledge is important only to constrain the search for a
solution.

Reading Newspaper
Knowledge is required even to be able to recognize a
solution.
Does the task require human-interaction?
Is the solution a state or a path?

The Water Jug Problem
• The path that leads to the goal must be reported.

A path-solution problem can be reformulated as a state-
solution problem by describing a state as a partial path to a
solution.

The question is whether that is natural or not.