SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
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

PDF
8.6 applications of logarithms
PDF
12 Bivariate
PPTX
Problem Formulation
PPTX
AI-State Space Representation.pptx
PPTX
AI-State Space Representation.pptx
PPSX
Cs 361 2015 lec 1-2
PPSX
Cs 361 2015 lec 1-2
PPTX
Problems problem spaces and search
8.6 applications of logarithms
12 Bivariate
Problem Formulation
AI-State Space Representation.pptx
AI-State Space Representation.pptx
Cs 361 2015 lec 1-2
Cs 361 2015 lec 1-2
Problems problem spaces and search

Similar to Ai lecture 8(unit02) (14)

PPTX
Water jug problem ai part 6
PPTX
Searching in Artificial Intelligence for UG
PPTX
AI problem solving.pptx
PPTX
Ncit 1st ai lab
PPTX
Signals And Systems Assignment Help
PPTX
K12105 sharukh...
PPTX
Definite Integrals 8/ Integration by Parts
PDF
nr_exams.pdf
PPTX
Abstraction
PDF
6. Multiple Integrals - RPMjkldajNDvNSDmnvS<MDv
PPTX
Lecture 7 - Spring-Mass Problem.pptx
DOCX
Sreeku
PDF
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
PDF
Fo ode-1
Water jug problem ai part 6
Searching in Artificial Intelligence for UG
AI problem solving.pptx
Ncit 1st ai lab
Signals And Systems Assignment Help
K12105 sharukh...
Definite Integrals 8/ Integration by Parts
nr_exams.pdf
Abstraction
6. Multiple Integrals - RPMjkldajNDvNSDmnvS<MDv
Lecture 7 - Spring-Mass Problem.pptx
Sreeku
Asymptotic Behavior of Solutions of Nonlinear Neutral Delay Forced Impulsive ...
Fo ode-1
Ad

More from vikas dhakane (20)

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

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Sustainable Sites - Green Building Construction
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPT
introduction to datamining and warehousing
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Digital Logic Computer Design lecture notes
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mechanical Engineering MATERIALS Selection
Lecture Notes Electrical Wiring System Components
Sustainable Sites - Green Building Construction
Embodied AI: Ushering in the Next Era of Intelligent Systems
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
introduction to datamining and warehousing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Digital Logic Computer Design lecture notes
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CYBER-CRIMES AND SECURITY A guide to understanding

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)