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

AI Unit-1-1

The document provides an introduction to artificial intelligence (AI) topics including computerized reasoning, characteristics of AI problems, problem representation in state space, and concept of small talk programming. It defines AI as making computers think intelligently like humans by studying human brain patterns and cognitive processes. Examples of AI applications and different categories like acting and thinking humanly versus rationally are described. The key aspects of representing problems in state space and examples like tic tac toe and water jug problem are summarized.

Uploaded by

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

AI Unit-1-1

The document provides an introduction to artificial intelligence (AI) topics including computerized reasoning, characteristics of AI problems, problem representation in state space, and concept of small talk programming. It defines AI as making computers think intelligently like humans by studying human brain patterns and cognitive processes. Examples of AI applications and different categories like acting and thinking humanly versus rationally are described. The key aspects of representing problems in state space and examples like tic tac toe and water jug problem are summarized.

Uploaded by

Geethakshaya
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

UNIT I

INTRODUCTION TO AI
Topics to be covered
Computerized reasoning
Artificial Intelligence (AI)
Characteristics of an AI problem
Problem representation in AI
State space representation
Problem reduction
Concept of small talk programming.
Computerized reasoning
Computers that use automated
reasoning can be used to automate and
apply logical reasoning to activities such
as proving theorems, checking proofs or
designing circuits.
Automated reasoning can also use logic
in the form of reasoning through analogy,
induction, abduction and nonmonotonic
reasoning.
What is Artificial Intelligence?
Itis the study of how to make computer
do things, which at the moment, people do
better.

Example:
Definition
a method of making a computer, a
computer-controlled robot, or a software
think intelligently like the human mind.
AI is accomplished by studying the
patterns of the human brain and by
analyzing the cognitive process.
Evolution of AI
Evolution of AI
2020 – A revolutionary tool for automated
conversations – GPT-3 is introduced
2022 – AI has become an inseparable part
of the workforce and is making strides in
cyber security
2022 – Chat GPT (OpenAI)
Strong and Weak Artificial Intelligence

The terms were coined by John Searle in


order to differentiate the performance
levels in different kinds of AI machines.

Weak AI Strong AI
It is a narrow application with a It is a wider application with a more
limited scope. vast scope.
This application is good at specific This application has incredible
tasks. human-level intelligence.

It uses supervised and unsupervised It uses clustering and association to


learning to process data. process data.

Example: Siri, Alexa. Example: Advanced Robotics


Applications of AI
Human approach:
• Systems that think like humans
• Systems that act like humans

Ideal approach:
• Systems that think rationally
• Systems that act rationally
Four categories of AI
Acting Humanly :Turing Test Approach

Proposed by Alan Turing in 1950.


Satisfactory operational intelligence.
Computer should possess:
Natural language processing.
Knowledge representation
Automated Reasoning
Machine Learning
To Pass the test :
Computer Vision
Robotics
Thinking Humanly: The Cognitive
Modeling Approach
Three possible ways
Introspection – trying to catch your own
thoughts.

Psychological Experiments – Observing a


person in action.

Brain imaging – Observing brain in action


General problem solver
Allen Newell and Herbert Simon
developed General Problem solver
method which follows the same reasoning
steps as that of human for solving the
same problem.
Thinking Rationally : the “Laws of
Thought” approach
Syllogism:
Greek Philosopher Aristotle developed this
concept.
Logic:
 To govern the operation of the mind.
 Logicians formed precise notation for
statements.
 By 1965, programs developed that could
solve any solvable problem in logical notation.
This “Logicist” tradition can be used to
build the intelligent systems.
Disadvantages:
1. Not easy to convert any informal knowledge
to logical notation if it is less than 100%
certainty.
2. Solving a problem by practice has huge
difference than solving it by principle.
Acting Rationally : The Rational Agent Approach
Agent :
◦ “Acts”, Computer agents should do more: operate
autonomously.
Rational Agent:
◦ Acts to achieve best outcome / best expected
outcome.
Advantages:
1. Laws of thought
2. Adaptable to
Scientific
development
Problem Characteristics
1. Is the problem decomposable?
2. Can solution steps be ignored or undone?
3. Is the Universe predictable?
4. Is a solution relative or absolute?
5. Is the solution is state or path?
6. What role does knowledge play?
7. Is interaction with the person is required
by the task?
Boston New Miami Dallas S.F.
York
Boston 250 1450 1700 3000

New 250 1200 1500 2900


York
Miami 1450 1200 1600 3300

Dallas 1700 1500 1600 1700

S.F 3000 2900 3300 1700


Boston
San Francisco
Dallas
New York
Miami

Boston (8850)
Boston

San
Francisco New York

Dallas Miami

New York Dallas

San
Miami Francisco

Boston Boston
Problem Characteristics Examples
Problem Characteristic Example
Decomposability Decomposable : Problem of Integration.
Non-decomposable : Block game.
Nature of Solution Steps Ignorable : Theorem Proving.
Recoverable : 8-puzzle.
Irrecoverable : Game of Bridge.
Is solution absolute or relative? Any path : 8-Puzzle.
Best path : Travelling salesman Problem.
Is problem’s Universe Certain outcome : 8-Puzzle.
predictable? Uncertain outcome: Game of Bridge.
Is desired solution a state or NLP solution is state.
path? Water jug problem’s solution is path.
What is the role of knowledge? Lot of knowledge to constraint search :
Chess.
Lot of knowledge is needed to recognize
solution – Newspaper Heading
Does the task require No – Theorem proving.
interaction with person? Yes – Expert System.
Examples
Tic Tac Toe
Question Answering
Tic Tac Toe
Three programs are considered to check which
one suits the mechanism of AI.
Considerations made based on their:
◦ Complexity
◦ Use of generalizations
◦ Clarity of their knowledge
◦ Extensibility
Program 1
Data 1 2 3
Structures
Board 4 5 6
0 – blank, 1 – filled with X, 2 – filled with O
Move table 7 8 9
Vector of size 3^9 = 19683 elements.
The Algorithm
1. Board as decimal no.
2. Access the vector in move table using step1.
3. After the move the board is set to that vector.
Comments
 Efficient in time
 Needs lots of space
 Errors may happen
 Cannot be extended.
Program 2

Data Structures
Board
2– blank, 3 – filled with X, 5 – filled with O
Turn
Moves indicated by integer. 1-First, 2-Last
The Algorithm
1. Make 2
2. Posswin(p)
3. Go(n)
Comments
 Time Inefficient
 Efficient in space
 Strategy completely depends on programmer.
Program 3(minimax procedure)
Data Structures
Board Position – List of board positions that could result
from the next move.
Likely to estimate the win for the player
The Algorithm
1. Highest positive rating for win
2. Possibility calculation of moves by the opponent and
assign it as node.
3. The best node with the highest rating
Comments
 Time Inefficient
 Efficient in space
 Complicated games can be handled
Problem Solving
AI focuses on a specific type of problem
and particular techniques used to obtain a
solution.

Choose
Analyze Isolate and
Define Best
the represent
Problem Strategy to
problem the task
Statement Achieve
Statement knowledge
Solution
State Space Representation
Problem Statement – Play Chess
Analyzing the problem – Specify the
initial board positions and rules
Isolation – based on win for one side
Strategy – implicit goal of winning the
game.
Simple and efficient program:
While pawn at
Square(file e, rank 2)
AND Move pawn
from Square (file
Square (file e, rank 3) e, rank 2) to
Is empty Square(file e,
rank4)
AND
Square(file e, rank 4)
Is empty
Initial board position First move

One legal chess move


The state space representations forms the
basis of most of the AI methods.
Its structure corresponds to the structure
of problem solving in two ways:
Allows formal definition of problem.
Process of solving a particular problem as a
combination of known techniques.
“search” is a very important process in the
solution of hard problems.
Water Jug problem
You are given two jugs. A 4-gallon one
and a 3-gallon one. Neither has any
measuring markers on it. There is a pump
that can be used to fill the jugs with water.
How can you get exactly 2 gallons of
water into the 4-gallon jug?
Rules for the water jug problem
S.No Action performed Constraint on the Successor state
state
1. Fill 4- gallon jug (x,y) (4,y)
x<4
2. Fill 3-gallon jug (x,y) (x,3)
y<3
3. Empty 4-gallon jug on ground (x,y) (0,y)
x>0
4. Empty 3-gallon jug on ground (x,y) (x,0)
y>0
5. Pour water from 3-gallon jug to fill (x,y) (4,y-(4-x))
4-gallon jug until the 4-gallon jug is x+y≥4 and y>0
full
6. Pour water from 4-gallon jug to fill (x,y) (x-(3-y),3)
3-gallon jug until the 4-gallon jug is x+y≥3 and x>0
full
7. Pour all of the water from 3-galloon (x,y) (x+y,0)
jug to fill 4-gallon jug x+y≤4 and y>0
8. Pour all of the water from 4-galloon (x,y) (0,x+y)
jug to fill 3-gallon jug x+y≤3 and x>0
Different states of water jug problem

1 2 3

4 5 6

7
Solutions of water jug problem
Gallons in the 4- Gallons in the 3- Gallons in the 4- Gallons in the 3-
Gallon Jug Gallon Jug Gallon Jug Gallon Jug
0 0 0 0

0 3 4 0

3 0 1 3

3 3 1 0

4 2 0 1

0 2 4 1

2 0 2 3
Formal description of a problem
The steps to be followed:
 Define a state space
 Specify initial states
 Specify goal states
 Specify a set of rules that describe the actions
available. Giving thought to:
◦ What unstated assumptions are present in the
informal problem description?
◦ How general should the rules be?
◦ How much of the work required to solve the
problem should be precomputed and represented in
the rules?
Production Systems
• Left side – Applicability of rules
Set of Rules • Right side – Action performed

• Some parts of DBS are permanent


Knowledge
Database
• Information are structured

• Order of rules to be applied


Control
strategy
• Resolving conflicts

• It works in a structured manner


Rule applier
Small talk programming
Itis an object oriented programming
language.
Developed by Alan Kay, Dan Ingalls and
Adele Goldberg at Xerox PARC in the
1970s.
Smalltalk can be viewed from a number
of different perspectives.
An object oriented programming
language
A programming environment .
An application development environment
(ADE)
Objects in Smalltalk

Everything is treated as an object.


For example: 2+3
It indicates that the object 2 is sent the
message +, with the argument of the
object 3.
This system included a number of
technical innovations:
 The language was based entirely on the
Simula concepts of class and message.
 The language had no fixed syntax . Each
class was responsible not only for its own
behavior and state definition, but even for
parsing the token stream that followed a
mention of an instance.
The adoption of the ASCII character set rather than
the special character set used in Smalltalk-72 and -76.
Smalltalk-80 removed the ability of primitive
methods to directly access any memory location.
Instead Smalltalk -80 introduced a dozen primitive
methods which provided the required functionality.
This significantly helped portability.
The Smalltalk -80 language introduced the concept of
metaclass, to provide a way of talking about behavior
(messages) that were specific to an individual class.
The Model -View-Controller (MVC ) system was
introduced for interactive applications.
Implementation of Smalltalk
Transcripts: output of the VisualWorks
System.
Example :
It can also understand,
Cr – Starts a new line
Space – puts a single space
Tab - puts a ‘tab’
• It prints only strings. To print anything we
need to use “printString”
Decode this
Some basics…
Classes
Definition

For Example
Example:
Methods
Question Answering
1. Siva was a man.
2. Siva was a worker in a company.
3. Siva was born in 1905.
4. All men are mortal.
5. All workers in a factory died when there was an accident in 1952.
6. No mortal lives longer than 100 years.
Suppose we ask a question: ‘Is Siva alive?’
There are two ways to answer the question shown below:
Method I:
1. Siva was a man.
2. Siva was born in 1905.
3. All men are mortal.
4. Now it is 2008, so Siva’s age is 103 years.
5. No mortal lives longer than 100 years.
Method II:
1. Siva is a worker in the company.
2. All workers in the company died in 1952.
Answer: So Siva is not alive. It is the answer from the above methods.

You might also like