0% found this document useful (0 votes)
18 views22 pages

Lecture 5

The document discusses the concept of problem space in AI, which includes the initial state, goal state, operators, and state space, represented as a graph or tree. It outlines the search process to navigate this space, distinguishing between uninformed and informed search methods, and provides examples of AI problems like chess, maze-solving, and the water jug problem. Additionally, it emphasizes the importance of formal representation, constraints, and search algorithms in solving these problems.

Uploaded by

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

Lecture 5

The document discusses the concept of problem space in AI, which includes the initial state, goal state, operators, and state space, represented as a graph or tree. It outlines the search process to navigate this space, distinguishing between uninformed and informed search methods, and provides examples of AI problems like chess, maze-solving, and the water jug problem. Additionally, it emphasizes the importance of formal representation, constraints, and search algorithms in solving these problems.

Uploaded by

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

LECTURE: 5

PROBLEM SPACE AND SEARCH

How will you solve this?


Problem Space

The problem space is the set of all possible states and actions that can be taken to achieve a goal in a given
problem.

Components:
1.Initial State: The starting point of the problem.
2.Goal State: The desired outcome or solution.
3.Operators: Actions or rules that transition the system from one state to another.
4.State Space: All the states reachable from the initial state using the operators.

Representation: Typically represented as a graph or tree, where nodes are states and edges are transitions.
Search
Search is the process of navigating the problem space to find a path from the initial state to the goal
state.
Types of Search:
• Uninformed Search: No prior knowledge of the solution path (e.g., Breadth-First Search,
Depth-First Search).
• Informed Search: Utilizes heuristics to guide the search (e.g., A*, Greedy Best-First
Search).
Key Concepts:
• Search Tree: A tree representation of states explored during the search process.
• Search Algorithm: A systematic method for exploring the search tree or graph.
• Heuristics: Techniques or rules of thumb used to estimate the cost or distance to the goal.
SOLVED:

START END START END


What is a Problem in AI?

Problem is a

tha
particular task

tc
a ll
s fo
r
Decision-making or
solution-finding
What is a Problem in AI:

1.Definition: A problem in AI involves tasks requiring machines to simulate intelligent behavior to


achieve specific goals.

2. Uncertainty: AI problems often deal with incomplete, ambiguous, or dynamic information.

3. Formal Representation: Problems must be structured using models like logic, graphs, or equations
for machine understanding.

4. Search for Solutions: AI employs techniques like search algorithms or optimization to explore
possible solutions.

5. Constraints: Solutions must adhere to practical constraints like time, resources, or ethical
considerations.
Examples: Common AI problems include image recognition, natural language processing,
autonomous navigation, and game playing.
Example: Chess Game
Initial State: Starting positions of all chess pieces.
Objective State: Achieving checkmate.
Operators: Permissible moves for each piece.
Constraints: Rules governing chess gameplay.
Problem Space:
State Space Search

State Space Search is a problem-solving technique in AI that involves exploring


all possible states to reach the goal state from the initial state.
• States: Represent different configurations or situations of the problem at
each step.
• Search Tree/Graph: Visualizes the exploration of states where nodes
represent states and edges represent actions.
Problem Formulation by State Space Search
1. State space formally defines problem structure.
2. Graph ( V, E) represents state space.
3. Nodes ( V) correspond to problem states.
4. Arcs (E) represent applicable actions.
5. Directed arcs connect parent and child nodes.
6. Parent precedes, child succeeds in graph.
Components of Problem Spaces:
• States: Possible scenarios within the problem.
• State Space: All reachable states from start.
• Paths: Connections between states via operators.
Example 1: Maze-Solving Problem
START

• State Space: The maze structure itself.


• States: All possible positions in the maze.
• Paths: Routes connecting start to the exit.

END
Example 2: Water Jug Problem
The Water Jug Problem is a classic problem-solving example in AI where the goal is
to measure a specific amount of water using two jugs of different capacities.
• Problem Setup: Given two jugs (e.g., a 4-liter jug and a 3-liter jug) and unlimited
water supply, measure an exact target amount (e.g., 2 liters).
• State Representation: Each state is represented as a pair (x, y), where x is the
amount of water in Jug 1 and y in Jug 2.
• Operators (Actions): Fill a jug, empty a jug, or transfer water between jugs until
one jug is full or empty.
• Goal State: Achieved when first jug contains the target amount of water (e.g., (2,
0)).
Provide solution using State space search
Example 3

Three missionaries and three cannibals want to cross a river. There is a boat on their
side of the river that can be used by either one or two persons(Max. two allowed on
the boat in one go). How should they use the boat to cross the river in such a way
that cannibals never outnumber missionaries on either side of the river?
If the cannibals ever outnumber the missionaries(on either bank) then the
missionaries will be eaten. How can they all cross over without anyone being eaten?
Give solution using state space search
Homework-Problem 1
We have two jugs, a 5-gallon(5-g) and the other 3-gallon(3-g) with no measuring marker on them.
There is endless supply of water through tap. Our task is to get 4 gallon of water in the 5-g jug.
State space for this problem can be described as the set of ordered pairs of integers(X,Y) such that X
represents the number of gallons of water in 5-g jug and Y for 3-g jug.
1. Start state is (0,0)
2. Goal state is (4,N) for any value of N<=3

Possible operations:
 Fill 5-g jug from the tap and empty the 5-g jug by throwing water down the drain
 Fill 3-g jug from the tap and empty the 3-g jug by throwing water down the drain
 Pour some or 3-g water from 5-g jug into the 3-g jug to make it full
 Pour some or full 3-g jug water into the 5-g jug
Homework Problem-2
The eight-puzzle problem has a 3X3 grid with 8 randomly numbered(1 to 8) tiles arranged on it with one
empty cell. At any point, the adjacent tile can move to the empty cell, creating a new empty cell. Solving
this problem involves arranging tiles such that we get the goal state from the start state.
1. Start state:[[3,7,6],[5,1,2],[4,0,8]]
2. The goal state could be represented as: [[5,3,6],[7,0,2],[4,1,8]]
3. The operators can be thought of moving
{Up,Down,Left,Right}, the direction in which
blank space effectively moves
Partial search tree for Eight Puzzle Problem(Task is to prepare the complete tree) as per task
given in previous slide
Search in AI:

• Definition: Process of finding problem solutions.


• Purpose: Identify solutions meeting constraints and goals.
• Method: Systematically traverse the problem domain.
Types of Search in AI:
Next: Mapping Minds with State Space!

You might also like