SlideShare a Scribd company logo
1 of 9
Download to read offline
Topic To Be Covered:
Water Jug Problem Solution Using State
Space Search
Jagdamba Education Society's
SND College of Engineering & Research Centre
Department of Computer Engineering
SUBJECT: Artificial Intelligence & Robotics
Lecture No-08(UNIT-02)
Prof.Dhakane Vikas N
Water Jug Problem With State Space Search
What is Water Jug Problem?????
 The state space for this problem
can be described as of ordered
pair of integers(x, y)
 Such that x->0,1,2,3,4
(Representing the number of
gallon or liter of water into the
4-litre jug.)
 x->0,1,2,3(Representing the
number of gallon or liter of
water into the 3-litre jug.)
 Goal state is (n,2) for any value
of n, since the problem does not
specify how many liters need to
be in the 4-litre Jug
Water Jug Problem With State Space Search
General Solution to Water Jug Problem
 We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter
Jug)
Step-1:x=0,y=0
Step-2:x=0,y=3
Step-3:x=3,y=0
Step-4:x=3,y=3
Step-5:x=4,y=2
 Now, we have to solve this problem using artificial intelligence(Means
,how computer will know that this problem has to solved in particular
way.)
 For this we use state Space.
Water Jug Problem With State Space Search
Rule Set TO Solve Water Jug Problem Using State Space
We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug)
Rule:1 (For filling X-Jug Completely)
(x, y)->(4,y)
Rule:2 (For filling Y-Jug Completely)
(x, y)->(x,3)
Rule:3 (To take some water out of X)
(x, y)->(x-d, y) when X>0
Water Jug Problem With State Space Search
Rule Set TO Solve Water Jug Problem Using State Space
We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug)
Rule:4 (To take some water out of Y)
(x, y)->(x, y-d) when Y>0
Rule:5 (TO Empty X-Completely)
(x, y)->(0,y) when X>0
Rule:6 (TO Empty Y-Completely)
(x, y)->(x,0) when Y>0
Water Jug Problem With State Space Search
Rule Set TO Solve Water Jug Problem Using State Space
We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug)
Rule:7 (To Fill X using Y)
(x, y)->(4, y-(4-X)) when Y>0,x+y>=4
Rule:8 (To Fill Y using X)
(x, y)->(x-(3-Y),3) when X>0,x+y>=3
Rule:9 (TO add everything from X& Y into->X )
(x, y)->(x+y,0) when x+y<=4,y>0
Rule:10 (TO add everything from Y&X into->Y )
(x, y)->(0,x+y) when x+y<=3,x>0
Water Jug Problem With State Space Search
Solution to Water Jug Problem Using State Space
We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug)
 We can apply above rules and solve water jug problem using Graphical or
Tree representation & Another way to solve this is Tabular
Representation.
 We will solve WJP using Tabular Representation As Below.
X Y Rules
0 0 -
0 3 (2)
3 0 (9)
3 3 (2)
4 2(DesiredAnswer) (7)
0 2 (5)
2(DesiredAnswer) 0 (9)
Ai lecture  8(unit02)
Ai lecture  8(unit02)

More Related Content

Similar to Ai lecture 8(unit02)

Water jug problem ai part 6
Water jug problem ai part 6Water jug problem ai part 6
Water jug problem ai part 6Kirti Verma
 
AI problem solving.pptx
AI problem solving.pptxAI problem solving.pptx
AI problem solving.pptxSonam Mittal
 
Definite Integrals 8/ Integration by Parts
Definite Integrals 8/ Integration by PartsDefinite Integrals 8/ Integration by Parts
Definite Integrals 8/ Integration by PartsLakshmikanta Satapathy
 
Lecture 7 - Spring-Mass Problem.pptx
Lecture 7 - Spring-Mass Problem.pptxLecture 7 - Spring-Mass Problem.pptx
Lecture 7 - Spring-Mass Problem.pptxPatrickOmoyon
 
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...IOSR Journals
 

Similar to Ai lecture 8(unit02) (12)

Water jug problem ai part 6
Water jug problem ai part 6Water jug problem ai part 6
Water jug problem ai part 6
 
AI problem solving.pptx
AI problem solving.pptxAI problem solving.pptx
AI problem solving.pptx
 
Ncit 1st ai lab
Ncit 1st ai labNcit 1st ai lab
Ncit 1st ai lab
 
Signals And Systems Assignment Help
Signals And Systems Assignment HelpSignals And Systems Assignment Help
Signals And Systems Assignment Help
 
K12105 sharukh...
K12105 sharukh...K12105 sharukh...
K12105 sharukh...
 
Definite Integrals 8/ Integration by Parts
Definite Integrals 8/ Integration by PartsDefinite Integrals 8/ Integration by Parts
Definite Integrals 8/ Integration by Parts
 
nr_exams.pdf
nr_exams.pdfnr_exams.pdf
nr_exams.pdf
 
Abstraction
AbstractionAbstraction
Abstraction
 
Lecture 7 - Spring-Mass Problem.pptx
Lecture 7 - Spring-Mass Problem.pptxLecture 7 - Spring-Mass Problem.pptx
Lecture 7 - Spring-Mass Problem.pptx
 
Sreeku
SreekuSreeku
Sreeku
 
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
 
Fo ode-1
Fo ode-1Fo ode-1
Fo ode-1
 

More from vikas dhakane

Ai lecture 14(unit03)
Ai lecture  14(unit03)Ai lecture  14(unit03)
Ai lecture 14(unit03)vikas dhakane
 
Ai lecture 13(unit03)
Ai lecture  13(unit03)Ai lecture  13(unit03)
Ai lecture 13(unit03)vikas dhakane
 
Ai lecture 13(unit03)
Ai lecture  13(unit03)Ai lecture  13(unit03)
Ai lecture 13(unit03)vikas dhakane
 
Ai lecture 12(unit03)
Ai lecture  12(unit03)Ai lecture  12(unit03)
Ai lecture 12(unit03)vikas dhakane
 
Ai lecture 12(unit03)
Ai lecture  12(unit03)Ai lecture  12(unit03)
Ai lecture 12(unit03)vikas dhakane
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)vikas dhakane
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)vikas dhakane
 
Ai lecture 10(unit03)
Ai lecture  10(unit03)Ai lecture  10(unit03)
Ai lecture 10(unit03)vikas dhakane
 
Ai lecture 10(unit03)
Ai lecture  10(unit03)Ai lecture  10(unit03)
Ai lecture 10(unit03)vikas dhakane
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)vikas dhakane
 
Ai lecture 07(unit03)
Ai lecture  07(unit03)Ai lecture  07(unit03)
Ai lecture 07(unit03)vikas dhakane
 
Ai lecture 05(unit03)
Ai lecture  05(unit03)Ai lecture  05(unit03)
Ai lecture 05(unit03)vikas dhakane
 
Ai lecture 05(unit03)
Ai lecture  05(unit03)Ai lecture  05(unit03)
Ai lecture 05(unit03)vikas dhakane
 
Ai lecture 04(unit03)
Ai lecture  04(unit03)Ai lecture  04(unit03)
Ai lecture 04(unit03)vikas dhakane
 
Ai lecture 04(unit03)
Ai lecture  04(unit03)Ai lecture  04(unit03)
Ai lecture 04(unit03)vikas dhakane
 
Ai lecture 03(unit03)
Ai lecture  03(unit03)Ai lecture  03(unit03)
Ai lecture 03(unit03)vikas dhakane
 
Ai lecture 03(unit03)
Ai lecture  03(unit03)Ai lecture  03(unit03)
Ai lecture 03(unit03)vikas dhakane
 
Ai lecture 003(unit03)
Ai lecture  003(unit03)Ai lecture  003(unit03)
Ai lecture 003(unit03)vikas dhakane
 
Ai lecture 003(unit03)
Ai lecture  003(unit03)Ai lecture  003(unit03)
Ai lecture 003(unit03)vikas dhakane
 
Ai lecture 02(unit03)
Ai lecture  02(unit03)Ai lecture  02(unit03)
Ai lecture 02(unit03)vikas dhakane
 

More from vikas dhakane (20)

Ai lecture 14(unit03)
Ai lecture  14(unit03)Ai lecture  14(unit03)
Ai lecture 14(unit03)
 
Ai lecture 13(unit03)
Ai lecture  13(unit03)Ai lecture  13(unit03)
Ai lecture 13(unit03)
 
Ai lecture 13(unit03)
Ai lecture  13(unit03)Ai lecture  13(unit03)
Ai lecture 13(unit03)
 
Ai lecture 12(unit03)
Ai lecture  12(unit03)Ai lecture  12(unit03)
Ai lecture 12(unit03)
 
Ai lecture 12(unit03)
Ai lecture  12(unit03)Ai lecture  12(unit03)
Ai lecture 12(unit03)
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)
 
Ai lecture 11(unit03)
Ai lecture  11(unit03)Ai lecture  11(unit03)
Ai lecture 11(unit03)
 
Ai lecture 10(unit03)
Ai lecture  10(unit03)Ai lecture  10(unit03)
Ai lecture 10(unit03)
 
Ai lecture 10(unit03)
Ai lecture  10(unit03)Ai lecture  10(unit03)
Ai lecture 10(unit03)
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)
 
Ai lecture 07(unit03)
Ai lecture  07(unit03)Ai lecture  07(unit03)
Ai lecture 07(unit03)
 
Ai lecture 05(unit03)
Ai lecture  05(unit03)Ai lecture  05(unit03)
Ai lecture 05(unit03)
 
Ai lecture 05(unit03)
Ai lecture  05(unit03)Ai lecture  05(unit03)
Ai lecture 05(unit03)
 
Ai lecture 04(unit03)
Ai lecture  04(unit03)Ai lecture  04(unit03)
Ai lecture 04(unit03)
 
Ai lecture 04(unit03)
Ai lecture  04(unit03)Ai lecture  04(unit03)
Ai lecture 04(unit03)
 
Ai lecture 03(unit03)
Ai lecture  03(unit03)Ai lecture  03(unit03)
Ai lecture 03(unit03)
 
Ai lecture 03(unit03)
Ai lecture  03(unit03)Ai lecture  03(unit03)
Ai lecture 03(unit03)
 
Ai lecture 003(unit03)
Ai lecture  003(unit03)Ai lecture  003(unit03)
Ai lecture 003(unit03)
 
Ai lecture 003(unit03)
Ai lecture  003(unit03)Ai lecture  003(unit03)
Ai lecture 003(unit03)
 
Ai lecture 02(unit03)
Ai lecture  02(unit03)Ai lecture  02(unit03)
Ai lecture 02(unit03)
 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
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
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
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
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
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
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 

Recently uploaded (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
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
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
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, ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
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
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 

Ai lecture 8(unit02)

  • 1. Topic To Be Covered: Water Jug Problem Solution Using State Space Search Jagdamba Education Society's SND College of Engineering & Research Centre Department of Computer Engineering SUBJECT: Artificial Intelligence & Robotics Lecture No-08(UNIT-02) Prof.Dhakane Vikas N
  • 2. Water Jug Problem With State Space Search What is Water Jug Problem?????  The state space for this problem can be described as of ordered pair of integers(x, y)  Such that x->0,1,2,3,4 (Representing the number of gallon or liter of water into the 4-litre jug.)  x->0,1,2,3(Representing the number of gallon or liter of water into the 3-litre jug.)  Goal state is (n,2) for any value of n, since the problem does not specify how many liters need to be in the 4-litre Jug
  • 3. Water Jug Problem With State Space Search General Solution to Water Jug Problem  We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug) Step-1:x=0,y=0 Step-2:x=0,y=3 Step-3:x=3,y=0 Step-4:x=3,y=3 Step-5:x=4,y=2  Now, we have to solve this problem using artificial intelligence(Means ,how computer will know that this problem has to solved in particular way.)  For this we use state Space.
  • 4. Water Jug Problem With State Space Search Rule Set TO Solve Water Jug Problem Using State Space We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug) Rule:1 (For filling X-Jug Completely) (x, y)->(4,y) Rule:2 (For filling Y-Jug Completely) (x, y)->(x,3) Rule:3 (To take some water out of X) (x, y)->(x-d, y) when X>0
  • 5. Water Jug Problem With State Space Search Rule Set TO Solve Water Jug Problem Using State Space We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug) Rule:4 (To take some water out of Y) (x, y)->(x, y-d) when Y>0 Rule:5 (TO Empty X-Completely) (x, y)->(0,y) when X>0 Rule:6 (TO Empty Y-Completely) (x, y)->(x,0) when Y>0
  • 6. Water Jug Problem With State Space Search Rule Set TO Solve Water Jug Problem Using State Space We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug) Rule:7 (To Fill X using Y) (x, y)->(4, y-(4-X)) when Y>0,x+y>=4 Rule:8 (To Fill Y using X) (x, y)->(x-(3-Y),3) when X>0,x+y>=3 Rule:9 (TO add everything from X& Y into->X ) (x, y)->(x+y,0) when x+y<=4,y>0 Rule:10 (TO add everything from Y&X into->Y ) (x, y)->(0,x+y) when x+y<=3,x>0
  • 7. Water Jug Problem With State Space Search Solution to Water Jug Problem Using State Space We want exact 2-litre water into 3-litre jug(X->4-litre Jug & Y->3-liter Jug)  We can apply above rules and solve water jug problem using Graphical or Tree representation & Another way to solve this is Tabular Representation.  We will solve WJP using Tabular Representation As Below. X Y Rules 0 0 - 0 3 (2) 3 0 (9) 3 3 (2) 4 2(DesiredAnswer) (7) 0 2 (5) 2(DesiredAnswer) 0 (9)