0% found this document useful (0 votes)
14 views40 pages

CH 3

Chapter 3 discusses the definition and goals of Artificial Intelligence (AI), emphasizing its aim to replicate human-like thinking and problem-solving abilities. It outlines various AI techniques, including game playing and theorem proving, and introduces the Turing Test as a criterion for determining machine intelligence. The chapter also covers problem-solving strategies, state space search, and different search algorithms, including uninformed and informed searches, highlighting their applications in practical scenarios like chess and the water jug problem.

Uploaded by

githouse36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views40 pages

CH 3

Chapter 3 discusses the definition and goals of Artificial Intelligence (AI), emphasizing its aim to replicate human-like thinking and problem-solving abilities. It outlines various AI techniques, including game playing and theorem proving, and introduces the Turing Test as a criterion for determining machine intelligence. The chapter also covers problem-solving strategies, state space search, and different search algorithms, including uninformed and informed searches, highlighting their applications in practical scenarios like chess and the water jug problem.

Uploaded by

githouse36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Searching and Planning

Chapter 3
Revision of Definition of AI

 Def 1: AI is the study of how to make computers do things which, at the


moment, people do better (Rich & Knight)
 Def 2: The automation of activities that associates with human thinking,
activities such as decision-making, problem solving, learning (Bellman)
 Def 3: The exciting effort to make computers think, ………… , machines with
minds (Haugeland)
 Def 4: The art of creating machines that perform functions, which require
intelligence when performed by people (Kurzwell)
 Def 5: The branch of computer science that is concerned with automation of
intelligent behavior (Luger)
AI PROBLEMS

 AI Techniques used in the problems such as game playing & theorem proving.
 Game playing involves both checkers-playing program & chess.
 Theorem proving explored in the area of mathematics, as geometry.
 Both game playing & theorem proving share the property that people who do
well are considered to be displaying intelligence.
 Computers could perform well at those tasks simply by being fast at exploring
a large number of solution paths and then selecting the best one.
 This process required little knowledge & programmed easily.
Task Domains of AI:

Mundane tasks Formal Tasks


 Perception  Games
 Vision  Chess Checkers
 Speech  Soduku
 Natural Language  Mathematics
 Understanding
 Geometry
 Generation
 Logic
 Translation
 Integral Calculus
 Commonsense Reasoning
 Proving Properties of programs
 Robot Control.
Example on Mundane tasks:

 Consider going for shopping


 (i) Planning a route and a sequence of shops to visit
 (ii) Recognizing (through Vision) buses, people and shops
 (iii) Communicating through Natural Language
 (iv) Navigating round obstacles on the street, and manipulating objects for
purchase
 Mundane tasks are hardest to compute (getting bore and bore as visiting shop
by shop).
Four goals of AI

Systems that think like humans Systems that think rationally

Systems that act like humans Systems that act rationally

Rationally : Systems do processes with intelligence and finds solutions to


complex problems

Human: Solving simple problems like a human


THE LEVEL OF MODEL

 Before we set to do something, it’s a good practice to decide exactly “What


we are trying to do?”
To design a
 “What is our goal in trying to produce programs that do the tasks the same program that do
way that people do?” Tasks what people
do
Goal
To design a
programs that do
task in easiest way.
CRITERIA FOR SUCEESS:

 n 1950, ALAN TURING Proposed a method for determining “WHETHER A


MACHINE CAN THINK?” This method has become “TURING TEST”.
 TURING TEST:
 To conduct Turing test, we need two people and the machine to be evaluated.
 In one room one person interrogator and is another room one person and machine.
 The interrogator can ask questions of either person or computer by typing and
receiving typed responses.
 The interrogator knows then as A, B and aims to determine which is person and
which is machine.
 If the machine succeeds at this, then we will conclude that machine can think.
 The machine is allowed to do whatever it can to fool the interrogator..
CRITERIA FOR SUCEESS: cont…

 For e.g. How much is 12,324 times 739817 even though it can answer in
microseconds, it will take several minutes and then respond with wrong
answer.
 Computer takes long time to pass the Turing test. No computer can imitate 100%
like a person. So it is necessary to settle at a particular level of imitation.
 Rating: We can limit the level of Turing test by setting certain rates to a
program.
 For e.g. A Program can acquire classes rating based on rating of players whom it
can beat.
CRITERIA FOR SUCEESS: cont…

 Turing Test based on level of achievement:


 We can limit the level of Turing test by comparing the level of achievements made
by program with humans.
 For e.g. DENDRAL is a program that analyzes organic compounds to determine their
structure.

 Turing Test Based on Time:


 We can compare the time it takes for a program to complete the task to the time
required by a person to do the same thing.
 e.g. R1 is a program that requires minutes to perform tasks that previously required hours
of a skilled engineer’s time.
PROBLEM AS A STATE SPACE SEARCH:

 To solve a particular problem, we need to build a system. To build a system,


four things are required.
1. Define the problem precisely:
 This includes precise specifications of what is initial situation as well as what will be the
final situation constitute acceptable solution to the problem.

2. Analyze the problem:


 Explains about various possible techniques for solving the problem.

3. Isolate and represent the task knowledge that is necessary to solve the problem.
4. Choose the best problem solving technique and apply it to the particular problem
Solving Problems by Searching and
Planning
 Searching
 The process of systematically exploring a problem's state space (all possible states)
to discover a sequence of actions that leads to a solution.
 Example: Finding the shortest route on a map.
 Planning
 The process of determining a sequence of actions (a plan) that transitions the
system from an initial state to a goal state.
 Example: Planning a series of moves to win a chess game or assembling a
product step by step.
Steps in Problem Solving

 1. Formulate Problem
 Define the problem in terms of:
 Initial State: Starting condition.
 Goal State: Desired outcome.
 Actions/Transitions: Allowed operations to move between states.
 Example: In a maze-solving problem:
 Initial State: The starting point of the maze.
 Goal State: The exit of the maze.
 Actions: Moving up, down, left, or right.
Start → Define Problem → Apply Search Algorithm → Identify Solution Path → Take
Actions → Goal Reached → End.
Steps in Problem Solving

 2. Search for Solution


 Explore the problem's state space to find a path from the initial state to the goal
state using search strategies.
 Strategies Include:
 Uninformed Search: Breadth-First Search (BFS),
 Depth-First Search (DFS).Informed Search: A* Search, Greedy Search.
 Example: Using BFS to find the shortest path in a network.

 3. Execute Solution
 Implement the sequence of actions from the solution path in the real environment.
 Example: A robot executing movements to navigate a warehouse.
State space Search

 State Space
 Initial State, Goal State, Actions
 Solution Path
Solving Problems by Searching and
Planning
 State Space A representation of all possible configurations of a problem.
 Includes:
 Nodes: Represent specific states.
 Edges: Represent transitions (actions) between states.

 Example: In a puzzle game, each configuration of pieces represents a state, and


each move changes the state.
 Initial State The starting point of the problem.
 Example: The starting location in a navigation problem.
 Goal State The desired outcome or solution of the problem.
 Example: Reaching a destination on a map or solving a Rubik's Cube.
Solving Problems by Searching and
Planning
 Actions Possible operations or steps that transition the system from one state
to another.
 Example: Moving a pawn in chess, or changing lanes in driving.
 Solution Path A sequence of actions or transitions that lead from the initial
state to the goal state.
 Example: Directions that guide you from your home to a friend's house.
DEFINING THE PROBLEM AS A STATE SPACE
SEARCH
Problem 1. playing chess
 PLAYING CHESS GAME
 To build a program that could “play chess”,
a) We have to specify the starting position of the chess board,
b) The rules that define legal moves
c) The board positions that represent a win for one side
d) We have to write a program explicitly since the goal of not only playing a
game of chess but also winning the game.
The two practical difficulties in writing the rules are:
a) No person could ever supply a complete set of such rules. It would take too
long and could certainly not to be done without mistakes.
b) No program could easily handle all those rules.
DEFINING THE PROBLEM AS A STATE SPACE
SEARCH
Problem 1. playing chess
 In order to minimize such problems, we have to
write the rules describing the legal moves in a
general way.
 We have to define the problem of playing chess as a
problem of moving around in a state space, where
each state corresponds to a legal position of the
board.
DEFINING THE PROBLEM AS A STATE SPACE
SEARCH
Problem 2. water jug problem
 You are given two jugs a 4-litre one and a 3-litre one, a
pump which has unlimited water which you can use to
fill the jug, and the ground on which water may be
poured Neither jug has any measuring markings on it.
 How can you exactly get 2 liter of water in the 4-litre
jug?
DEFINING THE PROBLEM AS A STATE SPACE
SEARCH
Problem 2. water jug problem
 State representation and initial state

 We sill represent a state of the problem as a tuple (x, uy) where x


represents the amount of water in the 4 litre jug and y rpresents the
amount of water in the 4-litre jug and y
 Note 0<= x <=4 and 0<=y<=3

 Our initial state (0,0)


 Goal predicate-state= (2,y) where 0<=y<=3
Home take project (submission date
Tomorrow)

Implement the water jug problem


in python
Operationalization:

 In both chess and water jug problem explained the first step (“Define the
problem precisely”) towards the design of a program to solve a problem.
 For that formal and manipulatable description of the problem is required.
 Hence we ill be able to write programs which produces these formal
description into informal.
 This process is known as “Operationalization”
CONTROL STRATEGIES

 Control Strategies decides which rule to apply during the process of searching
for solution to a problem.
 The two types of search algorithms are
 Un informed search
 Informed Search
Search Algorithms

Search Algorithms

Uninformed Informed(Heuristic)

Greedy Best First


DFS BFS A* Search
search
Search Algorithms

 Uninformed Search
 It is also called Blind or Exhaustive search. Search and therefore may not be very
efficient.
 Does not use domain-specific knowledge; explores the state space systematically.
 Informed Search
 Also called heuristic or intelligent search. Uses information about the problem to
guide the search
 Types of Uninformed Search:
 Breath-First Search
 Depth-First Search
 Uniform Cost search
Breadth-First Search (BFS)

 Explores all states at the current depth before moving to deeper levels.
 Pros: Guaranteed to find the shortest path if all actions have equal cost.
 Cons: Requires significant memory for large state spaces.
 Example: Exploring a maze layer by layer.
Home take project (submission date
Tomorrow)

Implement the Breadth First


Search in python
Depth-First Search (DFS)

 Explores one path deeply before backtracking to explore other paths.


 Pros: Uses less memory.
 Cons: Can get stuck in loops or take long for deep solutions.
 Example: Exploring all moves in a chess game until checkmate is reached.
Home take project (submission date
Tomorrow)

Implement the Depth First Search


in Python
Informed Search (Heuristic Search)

 A Heuristic is a technique that improves the efficiency of search process,


possibly by sacrificing claims of completeness.
 Heuristics are like tourist guides.
 Uses problem-specific knowledge (heuristics) to guide the search more
efficiently.
 They are good to the extent that they point in generally interesting
directions.
 They are bad to the extent that they miss the points of interest to particular
individuals.
 For complex problems, traditional algorithms are unable to find the solution
with some limits of time & space.
Why Heuristic Search?

 Blind search is not always possible, because they require too much space &
time.
 Heuristics are “Rules of Thumb”. they do not guarantee for a solution to a
problem.
 Heuristics are knowledge about domain which help search and reasoning in its
domain.
 Heuristics search function estimates cost from current state to goal,
presuming function is efficient.
 Heuristic function
 f(n) = h(n)
Types of Informed Search:

 Greedy Best-First Search


 A search*
Greedy Best-First Search

 Prioritizes states that appear closest to the goal based on a heuristic function
(h(n)).
 Pros: Often faster than uninformed methods.
 Cons: Not guaranteed to find the optimal solution.
 Example: Choosing roads that seem to lead directly to a destination on a map.
A Search*

 Combines path cost (g(n)) and heuristic cost (h(n)): f(n) = g(n) + h(n).
 Pros: Guaranteed to find the optimal solution if the heuristic is admissible.
 Cons: Can be slow in complex problems.
 Example: Solving puzzles like the 8-puzzle or optimizing robot navigation.
Constraint Satisfaction Problem (CSP)

 A Constraint Satisfaction Problem (CSP) is a mathematical model used in


artificial intelligence (AI) for solving combinatorial problems.
 Formal Definition:
 A CSP is defined as a tuple (X,D,C)(X, D, C)(X,D,C), where:
 X: A set of variables {x1,x2,...,xn}\{x_1, x_2, ..., x_n\}{x1,x2,...,xn}.
 D: A set of domains {D1,D2,...,Dn}\{D_1, D_2, ..., D_n\}{D1,D2,...,Dn}, where
DiD_iDi is the set of possible values for xix_ixi.
 C: A set of constraints {c1,c2,...,cm}\{c_1, c_2, ..., c_m\}{c1,c2,...,cm}, where
each constraint specifies allowable combinations of values for a subset of XXX.

 A CSP can be formally defined as a tuple:


 CSP = (X, D, C)
Constraint Satisfaction Problem (CSP)

 Variables: Items that need to be assigned values.


 Example: Cells in Sudoku or regions in a map.
 Domains: The set of possible values each variable can take.
 Example: Numbers 1-9 in Sudoku, or colors in a map coloring problem.
 Constraints: Rules that restrict which combinations of values are valid.
 Example: No two adjacent regions on a map can have the same color.
Examples of csp

 Sudoku
 Variables: Each cell in the grid.
 Domains: Numbers 1 to 9.
 Constraints: No duplicate numbers in a row, column, or 3x3 subgrid.
 Map Coloring
 Variables: Each region on a map.
 Domains: Colors (e.g., red, blue, green).
 Constraints: No two adjacent regions can have the same color.
 Scheduling
 Variables: Time slots for activities.
 Domains: Possible times or locations.
 Constraints: No overlap between conflicting activities., Specific resources
(like a room) can be used only once at a time.
Examples of csp

 Sudoku
 Variables: Each cell in the grid.
 Domains: Numbers 1 to 9.
 Constraints: No duplicate numbers in a row, column, or 3x3 subgrid.
 Map Coloring
 Variables: Each region on a map.
 Domains: Colors (e.g., red, blue, green).
 Constraints: No two adjacent regions can have the same color.
 Scheduling
 Variables: Time slots for activities.
 Domains: Possible times or locations.
 Constraints: No overlap between conflicting activities., Specific resources
(like a room) can be used only once at a time.
Q?

You might also like