WaterJugProblem
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 2 liters of water in
to the 4-liter jugs?
Solution:-
The state space for this problem can be
defined as
{ ( i ,j ) i = 0,1,2,3,4 j =
0,1,2,3}
‘i’ represents the number of liters of
water in the 4-liter jug and ‘j’ represents the number of liters of 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 .
Liters in 4 lt jug - Liters in 3 lt jug
ReplyDelete4 - 0
1 - 3
0 - 1
4 - 1
2 - 3
This is the optimal solution
Anchor Charan
No, this is -
Delete0 - 3
3 - 0
3 - 3
4 - 2
------
0 - 2
2 - 0
Litres in 4 ltr jug - litres in 3 ltr jug
ReplyDelete0-3
3-0
3-3
4-2
0-2
2-0
.
This also a possible solution
What is a “Water Jug” Problem? Explain with an Example.
ReplyDeleteSolve 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.
0-3
Delete3-0
3-3
5-1
0-1
1-0
1-3
4-0
5ltr jug. 3 ltr jug
Delete5 0
2 3
2 0
0 2
5 2
4 3
Here is 4 ltr water in 5ltr jug.
This comment has been removed by the author.
ReplyDeleteImpressive!Thanks for the post
ReplyDeleteArtificial intelligence Solutions
Thank You For Sharing this information.
ReplyDeleteArtificial intelligence Solutions
What techniques are used to solve this problem in AI??
ReplyDeleteGood Explanation to Water jug problem.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for information.
ReplyDeleteWater Jug Problem Simple Solution
Thanks for information.
ReplyDeleteLink
can anyone write program for this solution....
ReplyDeleteThat's interesting! Can you please share more about it? Thank you.
ReplyDeleteclick here
Very nice, you are doing a great job, keep going...
ReplyDeleteextratorrent proxy
gbwhatsapp new version download
gb whatsapp app download apk
social bookmarking sites list
blog commenting sites
profile creation sites
video submission sites
article submission sites
bigrock coupon
tekken 3 install download
smm panel
ReplyDeleteSMM PANEL
İş ilanları blog
instagram takipçi satın al
Hırdavatçı
beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi
maltepe bosch klima servisi
ReplyDeletebeykoz vestel klima servisi
üsküdar vestel klima servisi
beykoz bosch klima servisi
üsküdar bosch klima servisi
beykoz arçelik klima servisi
üsküdar arçelik klima servisi
pendik samsung klima servisi
pendik mitsubishi klima servisi