AI Unit-1-1
AI Unit-1-1
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
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.
Ideal approach:
• Systems that think rationally
• Systems that act rationally
Four categories of AI
Acting Humanly :Turing Test Approach
Boston (8850)
Boston
San
Francisco New York
Dallas Miami
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
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
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.