Professional Documents
Culture Documents
What Is Artificial Intelligence?
What Is Artificial Intelligence?
What is AI?
• Study of how to make computers do things
which, at the moment, people do better.
• Ephemeral – reference to the current state of
computer science.
• Fails to include some areas – problems that
cannot be solved well by either computers or
people.
• AI is Artificial Intelligence till it is achieved; after
which the acronym reduces to Already
Implemented
The AI Problems
• Early work focused on formal task - Game playing
and theorem proving.
– Checkers-playing program
– Chess
• Theorem proving
• Appeared as computers could perform well – fast
at exploring large number of solution paths and
selecting the best one.
• Assumption turned to be false - no computer is
fast enough to overcome the combinatorial
explosion
• Commonsense Reasoning – reasoning about
Physical objects and their relationships to
each other, reasoning about actions and their
consequences.
• Perception (vision and speech), natural
language understanding, problem solving – in
specialized domains.
• Specialized task – engineering design,
scientific discovery, medical diagnosis,
financial planning.
Task Domains of AI
• Mundane Tasks
• Formal Tasks
• Expert Tasks
Mundane Tasks
• Perception
– Vision
– Speech
• Natural language
– Understanding
– Generation
– Translation
• Commonsense reasoning
• Robot control
Formal Tasks
• Games
• Mathematics
• Geometry
• Logic
• Integral calculus
• Proving properties of programs
Expert Tasks
• Engineering
– Design
– Fault finding
– Manufacturing planning
• Scientific analysis
• Medical diagnosis
• Financial analysis
• What are the underlying assumptions about
intelligence?
• What kind of techniques will be used for
solving AI problems?
• At what level of detail, if at all, are we trying
to model human intelligence?
• How will we know when we have succeeded
in building an intelligent program?
The Underlying Assumption
• At the heart of research in AI lies – physical
symbol system hypothesis.
• There appears to be no way to prove or
disprove it on logical grounds.
• Only way to determine its truth is by
experimentation.
• Computers provide the perfect medium for
this experimentation.
What is an AI technique?
• AI problems span a very broad spectrum.
• Appear to have very little in common except
they are hard.
Properties of Knowledge
• Voluminous
• Hard to categorize accurately
• Constantly changing
• AI technique is a method that exploits knowledge
that should be represented in such way that:
➢Knowledge captures generalizations. Situations that
share important properties are grouped together.
➢It can be understood by people who must provide it.
➢Can easily be modified to correct errors.
➢Can be used in situations even if its not totally
accurate or complete.
Tic-Tac-Toe
• A paper-and-pencil
game for two
players, X and O, who
take turns marking the
spaces in a 3×3 grid
• The player who
succeeds in placing
three respective marks
in a horizontal, vertical,
or diagonal row wins
the game
• Three approaches are presented to play this game
which increase in
➢Complexity
➢Use of generalization
➢Clarity of their knowledge
➢Extensibility of their approach
• These approaches will move towards being
representations of what we will call AI techniques
Program 1
• Data Structures
➢ Board : A nine-element vector representing the board, where
the elements of the vector corresponds to the board position
as follows:
An element contains the value
0 if the corresponding square is blank,
1 if its filled with an X, or
2 if it is filled with an O.
➢ Movetable
• MT is a vector of 39 elements, each element of
which is a nine element vector representing board
position
Index Current Board position New Board position
0 000000000 000010000
1 000000001 020000001
2 000000002 000100002
3 000000010 002000010
:
:
• Algorithm
To make a move, do the following:
1. View the vector (board) as a ternary number
(Base 3) and convert it to its corresponding
decimal number.
2. Use the number computed in step 1 as an index
into the MT and access the vector stored there.
3. The selected vector represents the way the
board will look after the move
Set board equal to that vector
Comments
• Advantages:
➢Efficient in terms of time
• Disadvantages:
➢Lot of space to store the table that specifies the
correct move for each board table.
➢Lot of work specifying all the entries in the MT
➢Unlikely that required MT entries can be determined
and entered without any errors.
➢To extend to 3D – start from scratch, 327 board
positions – overwhelming the computer memories.
Program 2
• Data Structures
➢Board: A nine-element vector representing the board:
B[1..9]
➢Following conventions are used
2 - indicates blank
3 - X 1 2 3
5 - O
Turn: An integer 4 5 6
1 - First move
7 8 9
9 - Last move
Procedures Used
• To find valid blank
1 2 3
4 5 6
7 8 9
• Make2
➢Returns 5 if the centre square of the board is
blank, i. e., if Board[5] = 2
➢If not possible, then it tries the various suitable
non corner square and returns square number (2,
4, 6, or 8)
To Win / To Block the Opponent’s Win
• Posswin (P)
➢Returns 0, if player P cannot win in its next move,
➢otherwise the number of the square that
constitutes a winning move for P
• Rule
➢If Posswin (P) = 0 {P cannot win} then find
whether opponent can win.
➢If so, then block it.
• Posswin 1 2 3
8 3 4
Magic Square!
1 5 9
6 7 2
• Simplify the process of checking for a possible
win.
• Each player – the squares in which he/she has
played.
• Difference between 15 and the sum of the two
squares.
• If the square representing the difference is blank-
win
• If the difference is not positive or greater than 9-
not collinear- ignore
Advantages
• Fewer squares examined using this scheme
• Choice of representation – major impact on
the efficiency of a problem-solving program.
Program 3
• Data Structures
Board :
➢A structure containing a nine-element vector
representing the board
➢a list of board positions that could result from the
next move
➢number representing the estimate of how likely
the board position is to lead to an ultimate win for
the player to move
Algorithm
• Look ahead at the board positions that result
from each possible move.
• Decide which position is best, make the move
that leads to that position.
• Assign the rating of that best move to the
current position.
• To decide which position is the best :
➢See if it is a win. If so, call it the best by giving it
the highest possible rating.
➢Otherwise, consider all the moves the opponent
could make next. See which of them is worst for
us. Assume the opponent will make that move.
Whatever rating that move has, assign it to the
node we are considering.
➢The best node is then the one with the highest
rating.
Advantages
• It could be extended to handle more
complicated games.
Question Answering
• Series of programs that read in English text
and then answer questions, also stated in
English, about that text.
• It is more difficult to state formally and
precisely what our problem is and what
constitutes correct solutions to it.
Mary went shopping for a new coat. She found a
red one she really liked. When she got it home,
she discovered that it went perfectly with her
favorite dress.
Questions:
Q1: What did Mary go shopping for?
Q2: What did Mary find that she liked?
Q3: Did Mary buy anything?
Program 1
• Attempts to answer questions using literal
input text.
• Matches the text fragments in the questions
against the input text.
Data Structures
• Question Patterns: A set of templates that match
common question forms and produce patterns to
be used to match against inputs. Ex: If the
template “who did x y” matches an input
question, pattern “x y z” is matched against the
input text and the value z is given as the answer
to the question.
• Text: Input text stored simply as a long character
string.
• Question: Current question also stored as a
character string.
Algorithm
1. Compare each element of questionPatterns
against the Question and use all those that match
successfully to generate a set of text patterns.
2. Pass each of these patterns through a
substitution process that generates alternative
forms of verbs. Ex: “go” in question matches “went”
in text. Generates new expanded set of text
patterns.
3. Apply each of these text patterns to Text, and
collect all the resulting answers.
4. Reply with the set of answers just collected.
Examples
• Q1: “what did x v” matches this question.
• Generates pattern “Mary go shopping for z”.
• After pattern-substitution step – pattern is
expanded to a set of patterns – “Mary goes
shopping for z” , “Mary went shopping for z”,
assigns z the value “a new coat” , which is
given as answer.
• Q2: Question not answerable unless
➢Template set is very large
➢ Allowing for the insertion of the object of “find”
between it and modifying phrase “that she liked”
➢Insertion of the word “really” in the text
➢Substitution of “she” for “Mary”
• If all these variations are accounted for and
the question can be answered – response is
“a red one”.
• Q3: Since no answer to this question is
contained in the text, no answer will be found.
Comments
• Inadequate to answer the kind of question
people could answer after reading a simple
text.
• Ability to answer the direct question is
dependent – exact form in which the
questions are stated, variations that were
anticipated in the design of the templates and
pattern substitution that the system uses.
Program 2
• Converts input text and question into
structured internal form that attempts to
capture the meaning of the sentences.
• Finds answers by matching structured forms
against each other.
Data Structures
• EnglishKnow: Description of the words,
grammar, semantic interpretations of large
enough subset of English to account for the
input texts that the system will see.
• InputText: Input text in character form
• StructuredText: Structured representation of
the content of the input text.
Structured Text
• Attempts to capture the essential knowledge
contained in the text – independently of the exact
way that the knowledge was stated in English.
• Representing knowledge – important issue in the
design of almost all AI programs.
• Knowledge representation –
➢Production rules (“if x then y’’)
➢Slot-and-filler structures
➢Statements in Mathematical Logic
• Slot-Filler structures:
Key idea: Entities in the representation derive their
meaning from their connections to other entities.
She found a red one she really liked.
• InputQuestion: The input question in
character form.
• StructQuestion: Structured representation of
the content of the user’s question. Same as
the one used to represent the content of the
input text.
Algorithm
1. Convert the question to structured form using
the knowledge contained in EnglishKnow. Use
some special marker in the structure to indicate
the part of the structure that should be returned
as answer.
2. Match this structured form against
structuredText.
3. Return as answer those parts of the text that
match the requested segment of the question.
Examples
• Q1: This question is answered
straightforwardly with, “a new coat”.
• Q2: This question is answered successfully
with, “a red coat”.
• Q3: This one, though, cannot be answered,
since there is no direct response to it in the
text.
Comments
• More meaning (knowledge)- based than that of
the first program.
• More effective.
• Can answer most questions to which replies are
contained in the text.
• More time spent searching the various
knowledge bases (EnglishKnow, StructuredText)
• Additional knowledge about the world with
which the text deals- support lexical and syntactic
disambiguation and correct assignment of
antecedents to pronouns.
Mary walked up to the salesperson. She asked
where the toy department was.