SlideShare a Scribd company logo
1 of 29
Download to read offline
Production System
State-space formulation
Representation of problem and its
solution
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Problem Solving
โ€ข AI programs have a clean separation of
computational components of data,
operations & control.
โ€ข It is represented in form of production
system or state-space formulation.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Production System or
State-space Formulation
โ€ข It is a formation for structuring AI
programs which facilitates describing
search process. It consists of
โ€“ State-space
โ€“ Initial or start state
โ€“ Final or goal state
โ€“ Set of production rules
โ€“ A control strategy
โ€“ Knowledge databases
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
State-space, Initial and Goal State
โ€ข A state is a representation of elements at a
given moment for a given problem.
โ€“ Ex: any configuration of tiles in 8-puzzle
problem i.e.
represent two different states of 8-puzzle problem
โ€ข Among all possible states, there are two
special states called :
โ€“ Initial state is the start point
โ€“ Final state is the goal state
1 4 5
3 8
2 6 7
1 5
3 4 8
2 6 7
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
โ€ข A State space is the set of all states reachable from the initial
state.
โ€ข A state space forms a graph or tree in which the nodes are
states and the arcs between nodes are actions. Tree has only
one path to a given node i.e. it does not contain cycle whereas
a graph has several paths to a given node i.e. it contain cycles.
โ€ข In state space, a path is a sequence of states connected by a
sequence of actions.
โ€ข The solution of a problem is part of the map formed by the
state space.
โ€ข The state space may be explicitly represented by a graph.
But more typically the state space can be implicitly
represented and generated when required. To generate
the state space implicitly, the agent needs to know
State-space, Initial and Goal State
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
production rules
โ€ข It represents in form of a pair, each pair
consisting of a left side that determines the
applicability of the rule and a right side that
describes the action to be performed if the rule is
applied.
โ€ข These rules operate on the states of the state-
space. Application of rules change the states.
โ€ข These rules helps to move from one state to
another state which is called a successor state. A
state can have a number of successor states.Dr. Amit Kumar, Dept of CSE, JUET,
Guna
A control strategy
โ€ข A control strategy is one that specifies the
order in which the rules will be applied. Ex
Generate and test, BFS,DFS etc
โ€ข It helps to find the goal state or a path to the
goal state.
โ€ข It is not necessary that a control strategy
always find an optimal path.
โ€ข A good control strategy should causes the
motion in state-space and systematic .Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Databases
โ€ข One or more knowledge databases that
contains whatever information is appropriate
for the particular task.
โ€ข Some part of the database is permanent while
other parts of it may pertain the information
that is applicable to the solution of the
current problem.
โ€ข The information in the database must be
structured in appropriate way.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Use of Production system
โ€ข The production model not only helps to
formulate the problem but it has other
advantages as
โ€“ It is a good way to model the strong state driven
nature of intelligent action. As new inputs enter
the database, the behavior of the system changes.
โ€“ New rules can easily be added to account for new
situations without disturbing the rest of the
system, which is quite important in real-time
environment.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Water Jug Problem
โ€ข Problem statement:
Given two jugs, a 4-gallon and 3-gallon having no
measuring markers on them. There is a pump that
can be used to fill the jugs with water. How can
you get exactly 2 gallons of water into 4-gallon jug.
โ€ข Solution:
State space or production system 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 4-gallon jug and Y for 3-
gallon jug.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Production system
Water jug
โ€ข State-space: all possible combination of
(X,Y)
โ€ข Initial state: both jugs are empty i.e. (0,0)
โ€ข Goal State: 4-gallon jug contains 2-gallon
water, 2-gallon jug quantity unspecified
i.e.(2,n)
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
โ€ข Production Rules:
โ€“ R1: (X, Y | X < 4) ๏ƒ  (4, Y)
{Fill 4-gallon jug}
โ€“ R2: (X, Y | Y < 3) ๏ƒ  (X, 3)
{Fill 3-gallon jug}
โ€“ R3: (X, Y | X > 0) ๏ƒ  (0, Y)
{Empty 4-gallon jug}
โ€“ R4: (X, Y | Y > 0) ๏ƒ  (X, 0)
{Empty 3-gallon jug}
โ€“ R5:(X, Y | X+Y >= 4 ฮ›Y > 0) ๏ƒ  (4, Y โ€“(4 โ€“X))
{Pour water from 3-gallon jug into
4-gallon jug until 4-gallon jug is full}
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
โ€“ R6: (X, Y | X+Y >= 3 ฮ›X > 0) ๏ƒ  (X โ€“(3 โ€“Y), 3)
{Pour water from 4-gallon jug into 3-
gallon jug until 3-gallon jug is full}
โ€“ R7: (X, Y | X+Y <= 4 ฮ›Y > 0) ๏ƒ  (X+Y, 0)
{Pour all water from 3-gallon jug into
4-gallon jug }
โ€“ R8: (X, Y | X+Y <= 3 ฮ›X > 0) ๏ƒ (0, X+Y)
{Pour all water from 4-gallon jug into
3-gallon jug }
โ€“ R9: (X, Y | X > 0) ๏ƒ  (X โ€“D, Y)
{Pour some water D out from 4-gallon
jug}
โ€“ R10: (X, Y | Y > 0)๏ƒ  (X, Y -D)
{Pour some water D out from 3-gallon
jug}
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Solution-1
Number of
Steps
Rules applied 4-g
jug
3-g
jug
1 Initial State 0 0
2 R2 {Fill 3-g jug} 0 3
3 R7 {Pour all water from 3 to 4-g jug } 3 0
4 R2 {Fill 3-g jug} 3 3
5 R5 {Pour from 3 to 4-g jug until it is full} 4 2
6 R3 {Empty 4-gallon jug} 0 2
7 R7 {Pour all water from 3 to 4-g jug} 2 0
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Solution-2
Number of
Steps
Rules applied 4-g
jug
3-g
jug
1 Initial State 0 0
2 R1 {Fill 4-g jug} 4 0
3 R6 {Pour all water from 4-G to 3-G jug } 1 3
4 R4 {Empty 3-g jug} 1 0
5 R8 {Pour water from 4 to 3-g jug until} 0 1
6 R1 {Fill 4-gallon jug} 4 1
7 R6 {Pour from 4 to 3-g jug until it is full} 2 3
8 R4 {Empty 3-g jug} 2 0
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Points to be noted
โ€ข There is an initial description of the problem.
โ€ข Final description of the problem.
โ€ข There are more than one ways of solving the
problem.
โ€ข One would exercise a choice between various
solution paths based on some criteria of goodness
or on some heuristic function.
โ€ข There are set of rules that describe the actions
called production rules. Left side of the rules is
current state and right side describes new state
that results from applying the rule.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Missionaries and Cannibals
โ€ข Problem Statement: 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.
โ€ข Constraint: โ€ฐAt any point in time, cannibals
should not be more than missionaries. โ€ž
โ€“ If the cannibals ever outnumber the missionaries
(on either bank) then the missionaries will be
eaten.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
โ€ข PS for this problem can be described as the
set of ordered pairs of left and right bank of
the river as (L, R) where each bank is
represented as a list [nM, mC, B] โ€ฐ
โ€“ n is the number of missionaries M, m is the
number of cannibals C, and B represents boat. โ€ž
โ€ข Start state: ( [3M, 3C, 1B], [0M, 0C, 0B] ),
โ€“ โ€ฐ1B means that boat is present and 0B means it is
not there on the bank of river.
โ€ข โ€žGoal state: ( [0M, 0C, 0B], [3M, 3C, 1B] )
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
โ€ข Any state: ([n1M, m1C, 1B], [n2 M, m2 C,
0B]) , with constraints/conditions as
โ€“ n1 (โ‰ 0) โ‰ฅ m1;
โ€“ n2 (โ‰ 0) โ‰ฅ m2;
โ€“ n1 + n2 = 3 and m1 + m2 = 3
โ€ข By no means, this representation is unique. โ€ฐ
โ€ข In fact one may have number of different
representations for the same problem. โ€ฐ
โ€ข The table on the next slide consists of
production rules based on the chosen
representation.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Set of Production Rules
Applied keeping constrains in mind
Rules for boat going from left bank to right bank of the river
Rule
No.
Left side of rule Right side of rule
L1 ([n1M, m1C, 1B],
[n2M, m2C,0B])
๏ƒ  ([(n1-2)M, m1C, 0B],
[(n2+2)M,m2C, 1B])
L2 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([(n1-1)M,(m1-1)C,0B],
[(n2+1)M,(m2+1)C, 1B])
L3 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([n1M, (m1-2)C, 0B],
[n2M, (m2+2)C, 1B])
L4 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([(n1-1)M, m1C,0B],
[(n2+1)M, m2C, 1B])
L5 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([n1M, (m1-1)C, 0B],
[n2M, (m2+1)C, 1B])
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Set of Production Rules
Applied keeping constrains in mind
Rules for boat coming from right bank to left bank of the river
Rule
No.
Left side of rule Right side of rule
L1 ([n1M, m1C, 1B],
[n2M, m2C,0B])
๏ƒ  ([(n1+2)M, m1C, 0B],
[(n2-2)M,m2C, 1B])
L2 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([(n1+1)M,(m1+1)C,0B],
[(n2-1)M,(m2-1)C, 1B])
L3 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([n1M, (m1+2)C, 0B],
[n2M, (m2-2)C, 1B])
L4 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([(n1+1)M, m1C,0B],
[(n2-1)M, m2C, 1B])
L5 ([n1M, m1C, 1B],
[n2M, m2C, 0B])
๏ƒ  ([n1M, (m1+1)C, 0B],
[n2M, (m2-1)C, 1B])
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
One Possible Solution
Start โ†’ ([3M, 3C, 1B], [0M, 0C, 0B]]
L2 ([2M, 2C, 0B], [1M, 1C, 1B]) 1M,1C ๏ƒ 
R4 ([3M, 2C, 1B], [0M, 1C, 0B]) 1M ๏ƒŸ
L3 ([3M, 0C, 0B], [0M, 3C, 1B]) 2C ๏ƒ 
R4 ([3M, 1C, 1B], [0M, 2C, 0B]) 1C ๏ƒŸ
L1 ([1M, 1C, 0B], [2M, 2C, 1B]) 2M ๏ƒ 
R2 ([2M, 2C, 1B], [1M, 1C, 0B]) 1M,1C ๏ƒŸ
L1 ([0M, 2C, 0B], [3M, 1C, 1B]) 2M ๏ƒ 
R5 ([0M, 3C, 1B], [3M, 0C, 0B]) 1C ๏ƒŸ
L3 ([0M, 1C, 0B], [3M, 2C, 1B]) 2C ๏ƒ 
R5 ([0M, 2C, 1B], [3M, 1C, 0B]) 1C ๏ƒŸ
R3 ([0M, 0C, 0B], [3M, 3C, 1B]) 2C ๏ƒ  Goal stateDr. Amit Kumar, Dept of CSE, JUET,
Guna
8-puzzle problem
โ€ข Problem: the 8-puzzle is a square tray in
which 8 tiles are placed. The 9th square is
uncovered. A tile that is adjacent to the
blank space can be slide into that space.
the game consist of a starting position and
specified goal position . The goal is to
transform the starting position into goal
position by sliding the tile around.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
8-puzzle problem
โ€ข State space : configuration of 8 - tiles on the
board
โ€ข Initial state : any configuration
โ€ข Goal state : tiles in a specific order
โ€ข Action : โ€œblank movesโ€
โ€ข Transformation: blank moves L, R, U,D
โ€ข ( blank tile position, {filled neighbors
positions}, action)
(1,{2,4},U) -๏ƒ  (4,{1,5,7},-)
โ€ข Solution : optimal sequence of operators
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
One possible configuration
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Search tree
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Block world problem
โ€ข Problem: given the following initial state,
aim is to reach the goal state, such that
smaller block can not be put on bigger
block and only one block can be moved at
a time
C
B
A
Goal State
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Production system
โ€ข State space : configuration of blocks on the
table
โ€ข Initial state : any configuration
โ€ข Goal state : blocks in a specific order
โ€ข Action :
โ€“ Clear (x) {block x has nothing on it}๏ƒ  On(x, Table){pick x and
put it on table}
โ€“ Clear (x) and Clear (y) ๏ƒ  On(x, y){put x on y}
โ€ข Solution : optimal sequence of operators
Dr. Amit Kumar, Dept of CSE, JUET,
Guna
Tutorial-1
โ€ข Define the production system and one possible
solution for tower of Hanoi problem of 4 disk.
In this problem, there are three rods and a number of
disks of different sizes, which can slide onto any rod.
The puzzle starts with the disks in a neat stack in
ascending order of size on one rod, the smallest at the
top, thus making a conical shape. The objective of the
puzzle is to move the entire stack to another rod,
obeying the following simple rules:
โ€“ Only one disk can be moved at a time.
โ€“ Each move consists of taking the upper disk from one of
the stacks and placing it on top of another stack.
โ€“ No disk may be placed on top of a smaller disk.
Dr. Amit Kumar, Dept of CSE, JUET,
Guna

More Related Content

Similar to Production system

COEN507 introduction to linear time invariant.pptx
COEN507 introduction to linear time invariant.pptxCOEN507 introduction to linear time invariant.pptx
COEN507 introduction to linear time invariant.pptxMustaphaAbdullahi35
ย 
problemsolving with AI.pptx
problemsolving with AI.pptxproblemsolving with AI.pptx
problemsolving with AI.pptxPriyadharshiniG41
ย 
Linear programming
Linear programmingLinear programming
Linear programmingKrantee More
ย 
lecture_18-19_state_observer_design.pptx
lecture_18-19_state_observer_design.pptxlecture_18-19_state_observer_design.pptx
lecture_18-19_state_observer_design.pptxAnshulShekhar3
ย 
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...ijtsrd
ย 
Process Dynamics Exercises and their solutions
Process Dynamics Exercises and their solutionsProcess Dynamics Exercises and their solutions
Process Dynamics Exercises and their solutionsRami Bechara
ย 
Introduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & controlIntroduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & controlMahmoud Wanis
ย 
Bo2422422286
Bo2422422286Bo2422422286
Bo2422422286IJMER
ย 
Risk assessment of a hydroelectric dam with parallel redundant turbine
Risk assessment of a hydroelectric dam with parallel redundant turbineRisk assessment of a hydroelectric dam with parallel redundant turbine
Risk assessment of a hydroelectric dam with parallel redundant turbineeSAT Journals
ย 
Deterministic Stabilization of a Dynamical System using a Computational Approach
Deterministic Stabilization of a Dynamical System using a Computational ApproachDeterministic Stabilization of a Dynamical System using a Computational Approach
Deterministic Stabilization of a Dynamical System using a Computational ApproachIJAEMSJORNAL
ย 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.comIJERD Editor
ย 
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Intervention
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Interventionโญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Intervention
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity InterventionVictor Asanza
ย 
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...IRJET Journal
ย 

Similar to Production system (20)

COEN507 introduction to linear time invariant.pptx
COEN507 introduction to linear time invariant.pptxCOEN507 introduction to linear time invariant.pptx
COEN507 introduction to linear time invariant.pptx
ย 
problemsolving with AI.pptx
problemsolving with AI.pptxproblemsolving with AI.pptx
problemsolving with AI.pptx
ย 
Linear programming
Linear programmingLinear programming
Linear programming
ย 
lecture_18-19_state_observer_design.pptx
lecture_18-19_state_observer_design.pptxlecture_18-19_state_observer_design.pptx
lecture_18-19_state_observer_design.pptx
ย 
Taguchi
Taguchi Taguchi
Taguchi
ย 
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...
An Exponential Observer Design for a Class of Chaotic Systems with Exponentia...
ย 
Problems, Problem spaces and Search
Problems, Problem spaces and SearchProblems, Problem spaces and Search
Problems, Problem spaces and Search
ย 
Qc tools
Qc toolsQc tools
Qc tools
ย 
Qc tools
Qc toolsQc tools
Qc tools
ย 
Process Dynamics Exercises and their solutions
Process Dynamics Exercises and their solutionsProcess Dynamics Exercises and their solutions
Process Dynamics Exercises and their solutions
ย 
Introduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & controlIntroduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & control
ย 
Linear sort
Linear sortLinear sort
Linear sort
ย 
presentation_btp
presentation_btppresentation_btp
presentation_btp
ย 
Chapter 2 (final)
Chapter 2 (final)Chapter 2 (final)
Chapter 2 (final)
ย 
Bo2422422286
Bo2422422286Bo2422422286
Bo2422422286
ย 
Risk assessment of a hydroelectric dam with parallel redundant turbine
Risk assessment of a hydroelectric dam with parallel redundant turbineRisk assessment of a hydroelectric dam with parallel redundant turbine
Risk assessment of a hydroelectric dam with parallel redundant turbine
ย 
Deterministic Stabilization of a Dynamical System using a Computational Approach
Deterministic Stabilization of a Dynamical System using a Computational ApproachDeterministic Stabilization of a Dynamical System using a Computational Approach
Deterministic Stabilization of a Dynamical System using a Computational Approach
ย 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
ย 
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Intervention
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Interventionโญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Intervention
โญโญโญโญโญ Finding a Dynamical Model of a Social Norm Physical Activity Intervention
ย 
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...
IRJET- Two-Class Priority Queueing System with Restricted Number of Priority ...
ย 

More from Amit Kumar Rathi

Hybrid Systems using Fuzzy, NN and GA (Soft Computing)
Hybrid Systems using Fuzzy, NN and GA (Soft Computing)Hybrid Systems using Fuzzy, NN and GA (Soft Computing)
Hybrid Systems using Fuzzy, NN and GA (Soft Computing)Amit Kumar Rathi
ย 
Fundamentals of Genetic Algorithms (Soft Computing)
Fundamentals of Genetic Algorithms (Soft Computing)Fundamentals of Genetic Algorithms (Soft Computing)
Fundamentals of Genetic Algorithms (Soft Computing)Amit Kumar Rathi
ย 
Fuzzy Systems by using fuzzy set (Soft Computing)
Fuzzy Systems by using fuzzy set (Soft Computing)Fuzzy Systems by using fuzzy set (Soft Computing)
Fuzzy Systems by using fuzzy set (Soft Computing)Amit Kumar Rathi
ย 
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Amit Kumar Rathi
ย 
Associative Memory using NN (Soft Computing)
Associative Memory using NN (Soft Computing)Associative Memory using NN (Soft Computing)
Associative Memory using NN (Soft Computing)Amit Kumar Rathi
ย 
Back Propagation Network (Soft Computing)
Back Propagation Network (Soft Computing)Back Propagation Network (Soft Computing)
Back Propagation Network (Soft Computing)Amit Kumar Rathi
ย 
Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)Amit Kumar Rathi
ย 
Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)Amit Kumar Rathi
ย 
Topological sorting
Topological sortingTopological sorting
Topological sortingAmit Kumar Rathi
ย 
String matching, naive,
String matching, naive,String matching, naive,
String matching, naive,Amit Kumar Rathi
ย 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithmsAmit Kumar Rathi
ย 
Sccd and topological sorting
Sccd and topological sortingSccd and topological sorting
Sccd and topological sortingAmit Kumar Rathi
ย 
Recurrence and master theorem
Recurrence and master theoremRecurrence and master theorem
Recurrence and master theoremAmit Kumar Rathi
ย 
Rabin karp string matcher
Rabin karp string matcherRabin karp string matcher
Rabin karp string matcherAmit Kumar Rathi
ย 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning treeAmit Kumar Rathi
ย 
Merge sort analysis
Merge sort analysisMerge sort analysis
Merge sort analysisAmit Kumar Rathi
ย 
Heap and heapsort
Heap and heapsortHeap and heapsort
Heap and heapsortAmit Kumar Rathi
ย 
Greedy algorithm activity selection fractional
Greedy algorithm activity selection fractionalGreedy algorithm activity selection fractional
Greedy algorithm activity selection fractionalAmit Kumar Rathi
ย 

More from Amit Kumar Rathi (20)

Hybrid Systems using Fuzzy, NN and GA (Soft Computing)
Hybrid Systems using Fuzzy, NN and GA (Soft Computing)Hybrid Systems using Fuzzy, NN and GA (Soft Computing)
Hybrid Systems using Fuzzy, NN and GA (Soft Computing)
ย 
Fundamentals of Genetic Algorithms (Soft Computing)
Fundamentals of Genetic Algorithms (Soft Computing)Fundamentals of Genetic Algorithms (Soft Computing)
Fundamentals of Genetic Algorithms (Soft Computing)
ย 
Fuzzy Systems by using fuzzy set (Soft Computing)
Fuzzy Systems by using fuzzy set (Soft Computing)Fuzzy Systems by using fuzzy set (Soft Computing)
Fuzzy Systems by using fuzzy set (Soft Computing)
ย 
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)Fuzzy Set Theory and Classical Set Theory (Soft Computing)
Fuzzy Set Theory and Classical Set Theory (Soft Computing)
ย 
Associative Memory using NN (Soft Computing)
Associative Memory using NN (Soft Computing)Associative Memory using NN (Soft Computing)
Associative Memory using NN (Soft Computing)
ย 
Back Propagation Network (Soft Computing)
Back Propagation Network (Soft Computing)Back Propagation Network (Soft Computing)
Back Propagation Network (Soft Computing)
ย 
Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)
ย 
Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)
ย 
Topological sorting
Topological sortingTopological sorting
Topological sorting
ย 
String matching, naive,
String matching, naive,String matching, naive,
String matching, naive,
ย 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
ย 
Sccd and topological sorting
Sccd and topological sortingSccd and topological sorting
Sccd and topological sorting
ย 
Red black trees
Red black treesRed black trees
Red black trees
ย 
Recurrence and master theorem
Recurrence and master theoremRecurrence and master theorem
Recurrence and master theorem
ย 
Rabin karp string matcher
Rabin karp string matcherRabin karp string matcher
Rabin karp string matcher
ย 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
ย 
Merge sort analysis
Merge sort analysisMerge sort analysis
Merge sort analysis
ย 
Loop invarient
Loop invarientLoop invarient
Loop invarient
ย 
Heap and heapsort
Heap and heapsortHeap and heapsort
Heap and heapsort
ย 
Greedy algorithm activity selection fractional
Greedy algorithm activity selection fractionalGreedy algorithm activity selection fractional
Greedy algorithm activity selection fractional
ย 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
ย 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
ย 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Standamitlee9823
ย 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
ย 

Recently uploaded (20)

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
ย 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 

Production system

  • 1. Production System State-space formulation Representation of problem and its solution Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 2. Problem Solving โ€ข AI programs have a clean separation of computational components of data, operations & control. โ€ข It is represented in form of production system or state-space formulation. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 3. Production System or State-space Formulation โ€ข It is a formation for structuring AI programs which facilitates describing search process. It consists of โ€“ State-space โ€“ Initial or start state โ€“ Final or goal state โ€“ Set of production rules โ€“ A control strategy โ€“ Knowledge databases Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 4. State-space, Initial and Goal State โ€ข A state is a representation of elements at a given moment for a given problem. โ€“ Ex: any configuration of tiles in 8-puzzle problem i.e. represent two different states of 8-puzzle problem โ€ข Among all possible states, there are two special states called : โ€“ Initial state is the start point โ€“ Final state is the goal state 1 4 5 3 8 2 6 7 1 5 3 4 8 2 6 7 Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 5. โ€ข A State space is the set of all states reachable from the initial state. โ€ข A state space forms a graph or tree in which the nodes are states and the arcs between nodes are actions. Tree has only one path to a given node i.e. it does not contain cycle whereas a graph has several paths to a given node i.e. it contain cycles. โ€ข In state space, a path is a sequence of states connected by a sequence of actions. โ€ข The solution of a problem is part of the map formed by the state space. โ€ข The state space may be explicitly represented by a graph. But more typically the state space can be implicitly represented and generated when required. To generate the state space implicitly, the agent needs to know State-space, Initial and Goal State Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 6. production rules โ€ข It represents in form of a pair, each pair consisting of a left side that determines the applicability of the rule and a right side that describes the action to be performed if the rule is applied. โ€ข These rules operate on the states of the state- space. Application of rules change the states. โ€ข These rules helps to move from one state to another state which is called a successor state. A state can have a number of successor states.Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 7. A control strategy โ€ข A control strategy is one that specifies the order in which the rules will be applied. Ex Generate and test, BFS,DFS etc โ€ข It helps to find the goal state or a path to the goal state. โ€ข It is not necessary that a control strategy always find an optimal path. โ€ข A good control strategy should causes the motion in state-space and systematic .Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 8. Databases โ€ข One or more knowledge databases that contains whatever information is appropriate for the particular task. โ€ข Some part of the database is permanent while other parts of it may pertain the information that is applicable to the solution of the current problem. โ€ข The information in the database must be structured in appropriate way. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 9. Use of Production system โ€ข The production model not only helps to formulate the problem but it has other advantages as โ€“ It is a good way to model the strong state driven nature of intelligent action. As new inputs enter the database, the behavior of the system changes. โ€“ New rules can easily be added to account for new situations without disturbing the rest of the system, which is quite important in real-time environment. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 10. Water Jug Problem โ€ข Problem statement: Given two jugs, a 4-gallon and 3-gallon having no measuring markers on them. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into 4-gallon jug. โ€ข Solution: State space or production system 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 4-gallon jug and Y for 3- gallon jug. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 11. Production system Water jug โ€ข State-space: all possible combination of (X,Y) โ€ข Initial state: both jugs are empty i.e. (0,0) โ€ข Goal State: 4-gallon jug contains 2-gallon water, 2-gallon jug quantity unspecified i.e.(2,n) Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 12. โ€ข Production Rules: โ€“ R1: (X, Y | X < 4) ๏ƒ  (4, Y) {Fill 4-gallon jug} โ€“ R2: (X, Y | Y < 3) ๏ƒ  (X, 3) {Fill 3-gallon jug} โ€“ R3: (X, Y | X > 0) ๏ƒ  (0, Y) {Empty 4-gallon jug} โ€“ R4: (X, Y | Y > 0) ๏ƒ  (X, 0) {Empty 3-gallon jug} โ€“ R5:(X, Y | X+Y >= 4 ฮ›Y > 0) ๏ƒ  (4, Y โ€“(4 โ€“X)) {Pour water from 3-gallon jug into 4-gallon jug until 4-gallon jug is full} Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 13. โ€“ R6: (X, Y | X+Y >= 3 ฮ›X > 0) ๏ƒ  (X โ€“(3 โ€“Y), 3) {Pour water from 4-gallon jug into 3- gallon jug until 3-gallon jug is full} โ€“ R7: (X, Y | X+Y <= 4 ฮ›Y > 0) ๏ƒ  (X+Y, 0) {Pour all water from 3-gallon jug into 4-gallon jug } โ€“ R8: (X, Y | X+Y <= 3 ฮ›X > 0) ๏ƒ (0, X+Y) {Pour all water from 4-gallon jug into 3-gallon jug } โ€“ R9: (X, Y | X > 0) ๏ƒ  (X โ€“D, Y) {Pour some water D out from 4-gallon jug} โ€“ R10: (X, Y | Y > 0)๏ƒ  (X, Y -D) {Pour some water D out from 3-gallon jug} Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 14. Solution-1 Number of Steps Rules applied 4-g jug 3-g jug 1 Initial State 0 0 2 R2 {Fill 3-g jug} 0 3 3 R7 {Pour all water from 3 to 4-g jug } 3 0 4 R2 {Fill 3-g jug} 3 3 5 R5 {Pour from 3 to 4-g jug until it is full} 4 2 6 R3 {Empty 4-gallon jug} 0 2 7 R7 {Pour all water from 3 to 4-g jug} 2 0 Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 15. Solution-2 Number of Steps Rules applied 4-g jug 3-g jug 1 Initial State 0 0 2 R1 {Fill 4-g jug} 4 0 3 R6 {Pour all water from 4-G to 3-G jug } 1 3 4 R4 {Empty 3-g jug} 1 0 5 R8 {Pour water from 4 to 3-g jug until} 0 1 6 R1 {Fill 4-gallon jug} 4 1 7 R6 {Pour from 4 to 3-g jug until it is full} 2 3 8 R4 {Empty 3-g jug} 2 0 Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 16. Points to be noted โ€ข There is an initial description of the problem. โ€ข Final description of the problem. โ€ข There are more than one ways of solving the problem. โ€ข One would exercise a choice between various solution paths based on some criteria of goodness or on some heuristic function. โ€ข There are set of rules that describe the actions called production rules. Left side of the rules is current state and right side describes new state that results from applying the rule. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 17. Missionaries and Cannibals โ€ข Problem Statement: 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. โ€ข Constraint: โ€ฐAt any point in time, cannibals should not be more than missionaries. โ€ž โ€“ If the cannibals ever outnumber the missionaries (on either bank) then the missionaries will be eaten. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 18. โ€ข PS for this problem can be described as the set of ordered pairs of left and right bank of the river as (L, R) where each bank is represented as a list [nM, mC, B] โ€ฐ โ€“ n is the number of missionaries M, m is the number of cannibals C, and B represents boat. โ€ž โ€ข Start state: ( [3M, 3C, 1B], [0M, 0C, 0B] ), โ€“ โ€ฐ1B means that boat is present and 0B means it is not there on the bank of river. โ€ข โ€žGoal state: ( [0M, 0C, 0B], [3M, 3C, 1B] ) Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 19. โ€ข Any state: ([n1M, m1C, 1B], [n2 M, m2 C, 0B]) , with constraints/conditions as โ€“ n1 (โ‰ 0) โ‰ฅ m1; โ€“ n2 (โ‰ 0) โ‰ฅ m2; โ€“ n1 + n2 = 3 and m1 + m2 = 3 โ€ข By no means, this representation is unique. โ€ฐ โ€ข In fact one may have number of different representations for the same problem. โ€ฐ โ€ข The table on the next slide consists of production rules based on the chosen representation. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 20. Set of Production Rules Applied keeping constrains in mind Rules for boat going from left bank to right bank of the river Rule No. Left side of rule Right side of rule L1 ([n1M, m1C, 1B], [n2M, m2C,0B]) ๏ƒ  ([(n1-2)M, m1C, 0B], [(n2+2)M,m2C, 1B]) L2 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([(n1-1)M,(m1-1)C,0B], [(n2+1)M,(m2+1)C, 1B]) L3 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([n1M, (m1-2)C, 0B], [n2M, (m2+2)C, 1B]) L4 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([(n1-1)M, m1C,0B], [(n2+1)M, m2C, 1B]) L5 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([n1M, (m1-1)C, 0B], [n2M, (m2+1)C, 1B]) Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 21. Set of Production Rules Applied keeping constrains in mind Rules for boat coming from right bank to left bank of the river Rule No. Left side of rule Right side of rule L1 ([n1M, m1C, 1B], [n2M, m2C,0B]) ๏ƒ  ([(n1+2)M, m1C, 0B], [(n2-2)M,m2C, 1B]) L2 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([(n1+1)M,(m1+1)C,0B], [(n2-1)M,(m2-1)C, 1B]) L3 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([n1M, (m1+2)C, 0B], [n2M, (m2-2)C, 1B]) L4 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([(n1+1)M, m1C,0B], [(n2-1)M, m2C, 1B]) L5 ([n1M, m1C, 1B], [n2M, m2C, 0B]) ๏ƒ  ([n1M, (m1+1)C, 0B], [n2M, (m2-1)C, 1B]) Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 22. One Possible Solution Start โ†’ ([3M, 3C, 1B], [0M, 0C, 0B]] L2 ([2M, 2C, 0B], [1M, 1C, 1B]) 1M,1C ๏ƒ  R4 ([3M, 2C, 1B], [0M, 1C, 0B]) 1M ๏ƒŸ L3 ([3M, 0C, 0B], [0M, 3C, 1B]) 2C ๏ƒ  R4 ([3M, 1C, 1B], [0M, 2C, 0B]) 1C ๏ƒŸ L1 ([1M, 1C, 0B], [2M, 2C, 1B]) 2M ๏ƒ  R2 ([2M, 2C, 1B], [1M, 1C, 0B]) 1M,1C ๏ƒŸ L1 ([0M, 2C, 0B], [3M, 1C, 1B]) 2M ๏ƒ  R5 ([0M, 3C, 1B], [3M, 0C, 0B]) 1C ๏ƒŸ L3 ([0M, 1C, 0B], [3M, 2C, 1B]) 2C ๏ƒ  R5 ([0M, 2C, 1B], [3M, 1C, 0B]) 1C ๏ƒŸ R3 ([0M, 0C, 0B], [3M, 3C, 1B]) 2C ๏ƒ  Goal stateDr. Amit Kumar, Dept of CSE, JUET, Guna
  • 23. 8-puzzle problem โ€ข Problem: the 8-puzzle is a square tray in which 8 tiles are placed. The 9th square is uncovered. A tile that is adjacent to the blank space can be slide into that space. the game consist of a starting position and specified goal position . The goal is to transform the starting position into goal position by sliding the tile around. Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 24. 8-puzzle problem โ€ข State space : configuration of 8 - tiles on the board โ€ข Initial state : any configuration โ€ข Goal state : tiles in a specific order โ€ข Action : โ€œblank movesโ€ โ€ข Transformation: blank moves L, R, U,D โ€ข ( blank tile position, {filled neighbors positions}, action) (1,{2,4},U) -๏ƒ  (4,{1,5,7},-) โ€ข Solution : optimal sequence of operators Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 25. One possible configuration Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 26. Search tree Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 27. Block world problem โ€ข Problem: given the following initial state, aim is to reach the goal state, such that smaller block can not be put on bigger block and only one block can be moved at a time C B A Goal State Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 28. Production system โ€ข State space : configuration of blocks on the table โ€ข Initial state : any configuration โ€ข Goal state : blocks in a specific order โ€ข Action : โ€“ Clear (x) {block x has nothing on it}๏ƒ  On(x, Table){pick x and put it on table} โ€“ Clear (x) and Clear (y) ๏ƒ  On(x, y){put x on y} โ€ข Solution : optimal sequence of operators Dr. Amit Kumar, Dept of CSE, JUET, Guna
  • 29. Tutorial-1 โ€ข Define the production system and one possible solution for tower of Hanoi problem of 4 disk. In this problem, there are three rods and a number of disks of different sizes, which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules: โ€“ Only one disk can be moved at a time. โ€“ Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack. โ€“ No disk may be placed on top of a smaller disk. Dr. Amit Kumar, Dept of CSE, JUET, Guna