You are on page 1of 55

ARTIFICIAL INTELLIGENCE

•         Introduction To Artificial Intelligence (AI)


•         History Of AI
•         Main Issues In AI
•         Application Areas In AI
•         Computer Systems For AI
•         AI Programs Verses Conventional
• Programs
•         Turing Test
•         Why AI ?
1
References
1. Rich Elaine, Knight Kevin, Shiva Shankar
B Nair, Artificial Intelligence, Third
Edition, Tata McGraw Hill Publishers
2. Winston, Horn, LISP, Pearson
3. Russel, Norvig, Artificial Intelligence,
Pearson

2
ARTIFICIAL INTELLIGENCE

AI Is The Part Of Computer Science


Concerned With The Design Of Computer
Systems Which Exhibit The Attributes Of
Human Intelligence Such As
understanding Of Languages, Learning
New Information, Reasoning, Solving
Problems, Planning, Perception And
Creativity.

3
ASPECTS OF INTELLIGENCE
• Use Of Intuition
• Common Sense - Application Of Knowledge
To New Situations
• Creativity - Creating Something New And
Useful
• Learning From Experience
• Memory Retention And Recall
• Goal - Directed Search
• Human Information Processing Has And Hope
To Find In Machines
4
ARTIFICIAL INTELLIGENCE
• AI Is A Technology Of Information
Processing Concerned With Processes
Of Reasoning Learning And Perception.
• AI Is Problem Oriented Interdisciplinary
• Fascinating
• Challenging

5
Why AI ?
Purpose of AI
To build useful new tools not only for
commercial purposes, but also to improve
life style

6
ENVIRONMENT

7
MAIN ISSUES IN AI
• LEVEL 1 ISSUES
• Is it possible to create non human
intelligence ?
• Can we model the brain ?
• Can we teach machines to think & solve
problems like humans ?

8
LEVEL 2 ISSUES
What are our assumptions about intelligence?
What kind of techniques will be useful for
solving AI problems ?
At what level of detail are we trying to
model human intelligence ?

9
LEVEL 3 ISSUES
Knowledge Representation Schemes
Search - Avoids Combinatorial Explosion
Perception - Involves Analog Signals With
Noise
Inference

10
ARTIFICIAL INTELLIGENCE
• Can we develop a good model of the processes
involved in intelligent reasoning ?
• Cognitive science is a field in which
psychologists, linguistics' and computer
scientists all work together to develop
such a model.

11
HISTORY OF AI
• Work in AI started in 1956
• Scientists
- ALLEN NEWELL
-  HERBERT SIMON tried to simulate neural

networks
- MARVIN MINSKY of the brain.
-  OLIVER SELFIDGE
• JOHN MCCARTHY
12
Year Developments
1950s - Checker – playing program was developed
1960s - Theorem proving programs
1967 - Dendral expert system for predicting
unknown chemical compounds
1970s - Speech recognition system that

can identify few spoken words


1980s - Interpretation of visual images
- ACRONYM was successful in interpreting
airport images
1990s - Chess-playing program that could compete
with grandmasters 
13
APPLICATION AREAS IN AI

• Game playing
• Theorem proving
• Computer vision, Robotics
• Natural Language understanding
• Expert Systems

Medical diagnosis
Chemical analysis
Engineering Design
14
AI systems process symbols

Example:
Knowledge Inference
If x is a bird, x can fly
Robin is a bird Robin can fly

15
COMPUTER STYSTEMS FOR AI

Features:
• Symbolic & Logic processing features in the software -
Ex, LISP, PROLOG, OOPS
• Expert system shells with built-in features as
- Knowledge acquisition capability
- Knowledge Representation capability
- Inference mechanism
- Reasoning capability
• Good graphics and natural language features
• Large memories & fast processors
16
• Processors optimized for symbolic processing
PHYSICAL SYMBOL SYSTEM
• At the heart of research in AI lies physical symbol system
(PSS) hypothesis
• NEWELL and SIMON defined PSS as below.
• A PSS is a machine that operates on symbols to produce
collection of symbol structures. It has the necessary and
sufficient means for general intelligent action. Computers
can generate any PSS we like Importance of PSS
• It is a significant theory of the nature of human intelligence
• It forms the basis of the belief that it is possible to build
programs that can perform intelligent tasks now performed
by people.

17
CONVENTIONAL VERSES AI PROGRAMS

Conventional Programs AI Programs


* Definite algorithms i.e. completely well * There is no definite algorithm
defined steps of solution
* Uses data structures like arrays, records, lists * Uses knowledge
representation schemes
such as semantic
nets, predicate logic etc.

* Predominantly manipulates numbers, characters * Manipulates macros,


objects, symbols
* Deterministic, well defined and will bounded * Open ended, large and
problem uncertainty dominate
problem
* Predefined data * Dynamic data ( due to
knowledge acquisition)
* Primitive user interface * Sophisticated user interface

18
AI REQUIRES KNOWLEDGE
PROPERTIES OF KNOWLEDGE
• Knowledge is indispensable - that can not be done
without
• It is voluminous
• Difficult to characterize accurately
• Constantly changing
• Differs from data by being organized
• Data may be acquired automatically from instruments
• Knowledge is provided by people who understand it
• Can be used in many situations
• Can be easily modified to correct errors.
• AI technique is a method to exploit knowledge 19
NATURAL LANGUAGE UNDERSTANDING (NLU)
EXAMPLE

“ I need to go to New York as soon as possible”


An airline database system will have understand if it
finds the first available plan to New York . Your best
friend will have understood if he/she realizes that there
may be a need for you to go to New York.
Collecting, organizing the background knowledge and
applying it for language comprehension terms the major
problem in NLU

20
TURING TEST
• Dr. Alan Turing has devised a test to know
whether AI has achieved. 
• Comparison with a human be the criteria by
which it is decided whether or not a machine can
think

21
TURING TEST
• Machine and human are in one room
• Interrogator does not know who is answering
• He gets answers through intermediary system
• As they respond to questions, A and B must
convince the interrogator that he is the human.
• If the machine can convince, the machine
passes the TURNING TEST.

22
Intelligence and knowledge
• Intelligence has many dimensions
• Different kinds of inference made with
knowledge
• Well-directed search procedure?
• Automatic knowledge acquisition
available?

23
SIMULATION OF INTELLIGENT BEHAVIOUR

GAME . PLAYING
TIC-TAC-TOE
9 Positions, 2 Players
Each player inputs a number
Win : Same number vertically horizontally
or diagonally makes a player win

24
PROGRAM - I
Data Structure 
Board : A nine element vector representing the
board, the elements of the vector correspond to
board positions as above.
Element Value 
• 0                    blank
• 1                    if X in a square
• 2                    if 0 in a square
Moveable: A vector of 39 = 19,683 elements.
Each element is a nine-element vector chosen
specifically to allow the algorithm to work.
25
ALGORITHM
• View the board as a ternary (base 3)
number. Convert it to a decimal number.
• Use the number as an index into move
table and access the vector stored there.
• The vector selected represents the current
board position i.e. after the move that
should be made

26
Example

(i) (ii)

(iii)(iv) 27
EXAMPLE - cont
The vector corresponding to board position (i) is 000 000 000
The vector corresponding to board position (ii) 100 000 000
The vector corresponding to board position (iii) 200 000 000
The vector corresponding to board position (iv) 120 000 000
Board position next to (i)is(ii) means
move-table [0] =100 000 000
Board position following (ii) is (iv) means
move-table [6561] = 120 000 000
( 100 000 000) 3 = (6561) 10

28
Comments
• It is very efficient in terms of time. It can
play an optimal game.
• Lot of space is required to store move-
table
• Total strategy has been figured out in
advance so cannot be extended to three
dimensions, in fact this technique would
no longer work due to enormous amount
of memory requirement
29
TIC-TAC-TOE
PROGRAM – 2
2 - blank 3 –X , 5 – O (opponent)
Data Structures
 Board same as in program - I
Turn: an integer indicating the move
number (1 – First move, 9 last move)

30
PROCEDURES
MAKE 2 Returns 5 if center square is blank i.e.
Board [5] = 2, otherwise returns any blank non-
corner square ( 2, 4, 6 or 8 )
Posswin(p)
• Returns 0 if player p cannot win on his next
move, otherwise returns the number of the
winning square
• Enables to win and to block opponent’s moves

31
• Posswin(p) Checks each of the rows,
columns and the diagonal
• Winning criteria: X can win if the
product of the row/column/diagonal is 18
=( 3 x 3 x 2)
O can win if the product is 50 = ( 5 x 5 x 2)
Go(n) Makes a move in square n.
Board [n] = 3 if turn is odd
Board [n] = 5 if turn is even
Increments turn by 1
32
Algorithm has a built-in strategy

Odd-numbered moves – if X is playing:


corner squares and centre square
1,3,5,7,9
Even numbered moves if O is playing;
(non-corner squares) 2,4,6,8

33
Algorithm with Example

Turn = 1 Turn = 2
Go (1) if Board [5] = blank
Go (5) else Go (1)

34
Algorithm with Example

Turn = 3 Turn = 4
IF Board [9] is blank w in or if opponent can
Go (9) else Go (3) win, block it else
Go (Make 2)

35
Algorithm with Example

Turn = 5 Turn = 6
win or block win win or block win
else if Board [7] = blank else Go (Make2)
Go [7], else Go [3]
36
Algorithm with Example

Turn = 7 Turn = 8
check for win check for win
or block oppo’s. or block oppo’s
win else go win else go
any where in any where in
blank square blank square

37
Algorithm with Example

Turn = 9
check for win
or block oppo’s
win else go
any where in
blank square

38
Example - 2

S C If Board (5) is not


blank
Go [1]

39
Example - 2

S C

40
Example - 2

S C S

41
Example - 2

C S

42
Example - 3

C S C
Go [1] Board [9]=blank
Go [9]

43
Example - 3

S C S
Block oppo's move

44
Example - 3

45
Comments
• Not efficient in terms of time since, it has
to check several conditions before making
a move
• More efficient in terms of space
• Cannot generalize the knowledge to a
different domain as 3-D tic-tac-toe

46
Program – 2 1

SAME AS PROGRAM 2 but the board


positions are as below

All the rows, columns, and diagonals sum


to 15 : magic square

47
The process of checking for a possible win
is simplified
• Keep a list of squares a player owns
• Compute the difference : D = 15 – sum of two
squares
• Two squares are not collinear : If D is not
positive or if D is greater than 9, two squares
are not collinear and so can be ignored
( because a blank square can have numbers
1..9, but can not contain a number <=0 or
>9)

48
• If the third square along with the two
collinear squares (with D as required) is
blank, a move there will produce a win
• Fewer Squares will be examined as no
player can have > 4 squares at any time

49
Comments :
• Suitable for a conventional computer
which processes numbers
• People are parallel processors and can
look at several parts of the board at once
• Different from problem solving by people

50
Program – 3

Data Structures
A structure containing a nine-element
vector representing the board
• A list of board positions that could result
from the next move
• A number representing an estimate of
how likely the board position is to lead
to an ultimate win. ( The number is
computed based on a function)
51
ALGORITHM :
(Minimax (Minimum Maximum) procedure)
• To decide on the next move, look ahead at
the board positions that result from each
possible move
• Decide which position is best and make
the move leading to that position
• Assign the rating of that best move to the
current position

52
Evaluation function
• For Tic-Tac-Toe a board evaluation function is
as below
100A+10B+C – (100D+10E+F)
X and O are players
A is the number of lines of three X’s
B is the number of unblocked lined with two X’s.
C is the number of unblocked lines with single X.
Similarly D,E,F give number of lines of O’s.

53
How to decide which of a set of board
positions is best ?
• If it is a win call it the best by giving highest
possible rating
• Otherwise, consider all the moves the
opponent could make next, see which of them
is worst for us (by recursively calling this
procedure), whatever rating that move has,
assign it to the node we are considering 
• The best node is then the one with the highest
rating. The algorithm attempts to maximize the
likelihood of winning
54
Comments
• This is an example of an AI technique
• Can be applied to any game playing program
• Can be used when traditional techniques fail
• Requires much more time than others
• Can be augmented by a specific kind of
knowledge about games and how to play them
• It might consider only a subset of all possible
next moves

55

You might also like