Sie sind auf Seite 1von 4

8/11/2017 AI problems & solutions: Water Jug Problem

More Next Blog» Create Blog Sign In

AI problems & solutions

SATURDAY, 15 JUNE 2013 BLOG ARCHIVE


▼ 2013 (3)
Water Jug Problem ▼ June (3)
Water Jug Problem
WaterJugProblem 8 Puzzle Problem
Statement :- We are given 2 jugs, a 4 liter one and a 3- liter one. Neither has any measuring
markers on it. There is a pump that can be used to fill the jugs with water. How can we get exactly Artificial Intelligence
2 liters of water in to the 4-liter jugs?
Solution:-
The state space for this problem can be defined as ABOUT ME
Siva nantham
{ ( i ,j ) i = 0,1,2,3,4 j = 0,1,2,3} Follow 25

‘i’ represents the number of liters of water in the 4-liter jug and ‘j’ represents the number of liters of View my complete profile
water in the 3-liter jug. The initial state is ( 0,0) that is no water on each jug. The goal state is to
get ( 2,n) for any value of ‘n’.

To solve this we have to make some assumptions not mentioned in the problem. They are

1. We can fill a jug from the pump.

2. we can pour water out of a jug to the ground.

3. We can pour water from one jug to another.

4. There is no measuring device available.

The various operators (Production Rules) that are available to solve this problem may be stated
as given in the following figure .

http://problemsandsolutionsforai.blogspot.in/2013/06/water-jug-problem.html 1/4
8/11/2017 AI problems & solutions: Water Jug Problem

http://problemsandsolutionsforai.blogspot.in/2013/06/water-jug-problem.html 2/4
8/11/2017 AI problems & solutions: Water Jug Problem

Posted by Siva nantham at 10:07

7 comments:

Unknown 12 November 2016 at 23:12


Liters in 4 lt jug - Liters in 3 lt jug
4-0
1-3
0-1
4-1
2-3
This is the optimal solution
Anchor Charan

Reply

Replies

Arun Kumar 28 January 2017 at 03:50


No, this is -
0-3
3-0
3-3
4-2
------
0-2
2-0

Reply

Zeel Patel 20 November 2016 at 12:15


Litres in 4 ltr jug - litres in 3 ltr jug
0-3
3-0
3-3
4-2
0-2
2-0
.
This also a possible solution
Reply

4‫ اﻟـــوﻟــﯾــم اﻟــﺗـــﻛـــﻧـــوﻟـــوﺟــﻲ‬December 2016 at 11:23


What is a “Water Jug” Problem? Explain with an Example.
Solve the following Water Jug problem with step by step representation.

You have a 5 liter can and 3 liter can. Fill exact 4 liters in 5 liter can.
Reply

Replies

Pratik Vaishnav 25 February 2017 at 12:00


0-3
3-0
3-3
5-1
0-1
1-0
1-3
4-0

Reply

Prof. Abhinav Vidwans 6 March 2017 at 22:00

http://problemsandsolutionsforai.blogspot.in/2013/06/water-jug-problem.html 3/4
8/11/2017 AI problems & solutions: Water Jug Problem
Good information
Reply

Ishan Mahajan 7 May 2017 at 05:10


This comment has been removed by the author.
Reply

Enter your comment...

Comment as: Select profile...

Publish Preview

Home Older Post

Subscribe to: Post Comments (Atom)

Picture Window theme. Powered by Blogger.

http://problemsandsolutionsforai.blogspot.in/2013/06/water-jug-problem.html 4/4

Das könnte Ihnen auch gefallen