Assignment 2 AI PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

it Could be ia One Seve yol possible initial Sheta, r

eah dchon miqt thexe fexe lead to Cne sevexal Doi


Succesox Strtex
An aget widhcut SensoBs, thus, must &eaion bouS
SAote dKof id
miqt qet do, xadfhex tham Singke Statd
At each inataat h e aqet ha a belief
in uhc
Stote it miqkt be
Hente, The achion happen ia the Powex set PlE) dne
State
Space,uhich Containa Rbeliestates
ASolution i new a pat to that Jeada do belief a
State, a whose ntenbexs ae gaal saates
he emvisonme ig paatially ob.sexvath Ox i t dke efai
Action ade uncextain , the each new actions yielda
me indox.mation
Evexy po&sible Contingentydthat migkt axiae duxing
execution need Considening
The Case d Uncextainidy mau be anotiex aqt, n

aduexsax
Lwhen tRe Gtates e envixonmet dnd actions ae Unceto
e aagnt has to exploxe t environment to gcdhex

index.mation
detcxmine a
n apGxthially obsexvable luoxiA butCamnot
Gne

neds to Canditio ns
ixed actions Sequence in advamce,
Gction 0n tuture percept
ha dhe Gçent Cam qathex neuRmouledge dhrouge i t
achions, it is Oftn net Usettl to plm tox each possi Le
Siduation Scaadh amd Xeciion
Rthea,it a bettex to intexVeave
how ta deal widh it?
Avoidling RepeatedStete

Do net SetU8n to ttiepA xevit Stafe Le.q., in 8 Du 22e


Down
Daoblem, do net alow he Up move 8iqht attx a
MOve)

Do not Cseate
SQkution patfa with cycdez
need do Store amd
Do not qenexdte auyepeated Stare
chech a pottrtially axge numbea o Stata)
e., stad
"

This ia done by Reeping ao expandedA Statu


iat

whose daughtexs have aleadu been put on dthe eng.eued Jist


ernq.eued Jist" amd
"

Thia entails xemaving State om the

lacin tem On am " expanded ist" Tn dhe Standard algaainm


Jiheatuxe ,he list cexpanded stateg is Called dhe closet
Jist", thus, we woule move state tom dhe 0pem list to
dhe closee i s t )
Sometimea, bepeated stata ade Unavailoble probXema wheas
he action axe sevess aldle
Route finding
S0idinq blocks
Stole Space Seaxch ree
A
Avoidina iepected Stotu
fxingeeus,
tunttion RAPH-Seaxch Dodlem,
Ox filue

Cesed dn Bmphy Ser


xinqe TNSERT MAKE- NODE
INITAL STAIE Cpaoblen,
dinge.
wop do
tsinge ia empty Hhen xetusn tailuxe
mode Remove - Fsont finqe
if G0AL-TEST LpxoblenSTATE
CNodel hen xehuxn nede
ad STATE [madel to clesed
finqe TNSERT ALL CExPAND
nade pxobem, xings
Cnd

Wxite he detailed nate On


Seaxching uidk paaticd indormdhia
Unseddliatically A&umed dhat he enuixon metis tuly
obsexvalbe Gmd datexminiskc
Moxeovex, we Oumed that fhe aqent Rmaus dat ts
eftets each action axe
The se toxe, the agent Con Calculate
which 6tate xeault from exatly which exncty
amy Seqence cactions R
alwaw Rnouß which state it u in.
t pexcepTa
paovide Do new information alfex each
n a mase Ga
xealiahic
states Gnd Gchiond
siduotion dhe
aqevts, AMewles
is incomplet
dhe aqet ha no Semaors ot alC, HRen as fa_ai it
Submitted by Monika Sharma, on May 29, 2019
In the water Jug problem In Artficlal
Intelligence, we are provided with two jugs: one
having the capacty to hold 3 gallons of water and the other has the capacity to hold
gallons of water. There is no other
also do not have
measuring equipment avallable and the jugs
any kind of marking on them. so, the
agent's task here is to fill the
4-gallon jug with 2 gallons of water by
material. Initially, both our
using only these two jugs and no other
Jugs are empty.
So, to solve this problem, following set of rules were
proposed
Producton rules for soMng the water Jug problem
Here, let x denote the 4-gallon jug and ydenote the 3-8allon jug.
Initial
S.No State
state
Condition state Description of acton taken
x.y) f
x44y) Fll the 4
gallon jug completely
fye3 x3) Fll the 3
gallon jug completely
. (x.y) f >0(xd.y) Pour some
part from the 4
gallon jug
(x.y) yo 4yd) Pour some
part from the 3
gallon jug
(x.y) 0(0y) Empty the 4 gallon Jug
.
ityo (x0) Empty the 3 gallon jug
%.y) I f (x+y7yt4 Pour some water from the 3 gallon jug to fill the four

gallon jug
. some water from the 4
(My) f
(x*y)<7 (x-[3-yly)r gallor jug to fil the 3
gallon
xy) If (xyc4 (k*y.0) Pour all water from 3
0. (x.y) f
gallon jug to the 4
gallon jug
(x*yk3 (0, x*y) Pour all water from the 4
gallon jug to the 3 gallon jug
The listed
production rules contalin all the actions that could be
agent in transferring the contents of performed by the
jugs. But, to solve the water jug problem in a
minimum number of moves,
following set of rules in the given sequence should be
performed:
Solution of water
Jug problem according to the productlon rules:
S.No.
4gllon Jug contents 3 gallon Jug contents
O gallon
Rule followed
O gallon
Initial state
O gallon
3 gallons
3 gllons
Ruleno.2
gallon Rule no. 9
gallons 3 gallons
5. Rule no. 2
4gallons 2 gallons
Rule no. 7
gallon 2 gallons
7. Rule no. 5
2 gallons
O gallon
Rule no. 9

On
reaching the 7"
attempt, we reach a state which is
this state,
our
goal state. Therefore, at
our
problem is solved.
The man and the chicken Crass the riuer (the fox and
chicken the
corn are safe together), he Leaves the on

other side and g0es back aCross,

The man then takes the fOx aChOSs the rueh n d snce

he cont leaue the fox and chicken toge then he brings

the chicken back,

Again, since the chicken ond con can't be left


together, he leaves the chicken and he tokes the con

aChOSs and Leaves it with the fox.

He then returns to pick up the chicken and heads


across the river one last time.

Puzzle supplied by Richard Rider

You might also like