Search' How"do"we"plan"our"holiday?" How"do"we"plan"our"holiday?" Many"problems"can"be"solved"by"search:"

Size: px
Start display at page:

Download "Search' How"do"we"plan"our"holiday?" How"do"we"plan"our"holiday?" Many"problems"can"be"solved"by"search:""

Transcription

1 CSC384"Introduc0on"to"Ar0ficial"Intelligence" Search OneofthemostbasictechniquesinAI UnderlyingsubBmoduleinmostAIsystems Cansolvemanyproblemsthathumansarenot goodat(achievingsuperbhumanperformance) Veryusefulasageneralalgorithmictechniquefor solvingmanynonbaiproblems. How"do"we"plan"our"holiday?" Wemusttakeintoaccountvariouspreferencesand constraintstodevelopaschedule. Animportanttechniqueindevelopingsuchascheduleis hypothejcal reasoning. Example:OnholidayinEngland CurrentlyinEdinburgh FlightleavestomorrowfromLondon Needplantogettoyourplane IfItakea6amtrainwherewillIbeat2pm?WillIbesJllable togettotheairportonjme? 1" 2" How"do"we"plan"our"holiday?" Many"problems"can"be"solved"by"search:" ThiskindofhypotheJcalreasoninginvolvesasking whatstatewillibeinauertakingcertainacjons,orauer certainsequencesofevents? FromthiswecanreasonaboutparJcularsequencesof eventsoracjonsoneshouldtrytobringaboutto achieveadesirablestate. SearchisacomputaJonalmethodforcapturinga parjcularversionofthiskindofreasoning. 3" 4"

2 Why"Search?" Successful Successingameplayingprogramsbasedonsearch. ManyotherAIproblemscanbesuccessfullysolvedbysearch. PracJcal Manyproblemsdonthavespecificalgorithmsforsolvingthem. CasJngassearchproblemsisoUentheeasiestwayofsolving them. SearchcanalsobeusefulinapproximaJon(e.g.,localsearchin opjmizajonproblems). ProblemspecificheurisJcsprovidessearchwithawayof exploijngextraknowledge. SomecriJcalaspectsofintelligentbehaviour,e.g., planning,canbenaturallycastassearch. Limita0ons"of"Search" TherearemanydifficultquesJonsthatarenotresolved bysearch.inparjcular,thewholequesjonofhowdoes anintelligentsystemformulatetheproblemitwantsto solveasasearchproblemisnotaddressedbysearch. Searchonlyshowshowtosolvetheproblemoncewe haveitcorrectlyformulated. 5" 6" Search" Represen0ng"a"problem:"The"Formalism" Search"" " FormulaJngaproblemassearchproblem(representaJon) HeurisJcSearch GameBTreeBSearch Toformulateaproblemasasearchproblemweneedthe followingcomponents: 1. STATE"SPACE:"Formulateastatespaceoverwhichwe performsearch.thestatespaceisawayorrepresenjng inacomputerthestatesoftherealproblem. Readings IntroducJon:Chapter UninformedSearch:Chapter3.4 HeurisJcSearch:Chapters3.5, ACTIONS"or"STATE"SPACE"Transi0ons:"FormulateacJons thatallowonetomovebetweendifferentstates.the acjonsreflecttheacjonsonecantakeinthereal problembutoperateonthestatespaceinstead. 7" 8"

3 Represen0ng"a"problem:"The"Formalism" Toformulateaproblemasasearchproblemweneedthe followingcomponents: 3. INITIAL"or"START"STATE"and"GOAL:"IdenJfytheiniJal statethatbestrepresentsthestarjngcondijons,andthe goalorcondijononewantstoachieve. 4. Heuris0cs:"FormulatevariousheurisJcstohelpguidethe searchprocess. The"Formalism" Oncetheproblemhasbeenformulatedasastatespace search,variousalgorithmscanbeujlizedtosolvethe problem. AsoluJontotheproblemwillbeasequenceofacJons/moves thatcantransformyourcurrentstateintoastatewhereyour desiredcondijonholds. 9" 10" Example"1:"Romania"Travel." Example"1." CurrentlyinArad,needtogettoBucharestbytomorrowto catchaflight.whatisthestatespace? Statespace. States:thevariousciJesyoucouldbelocatedin. OurabstracJon:weareignoringthelowleveldetailsof driving,stateswhereyouareontheroadbetweencijes,etc. AcJons:drivebetweenneighboringciJes. IniJalstate:inArad DesiredcondiJon(Goal):beinastatewhereyouarein Bucharest.(HowmanystatessaJsfythiscondiJon?) SoluJonwillbetheroute,thesequenceofciJesto travelthroughtogettobucharest. 11" 12"

4 Example"2." WaterJugs Wehavea3gallon(liter)juganda4gallonjug.Wecanfill eitherjugtothetopfromatap,wecanemptyeitherjug,orwe canpouronejugintotheother(atleastunjltheotherjugis full). States:pairsofnumbers(gal3,gal4)wheregal3isthenumber ofgallonsinthe3gallonjug,andgal4isthenumberofgallons inthe4gallonjug. AcJons:EmptyB3BGallon,EmptyB4BGallon,FillB3BGallon,FillB4B Gallon,PourB3BintoB4,Pour4BintoB3. IniJalstate:Various,e.g.,(0,0) DesiredcondiJon(Goal):Various,e.g.,(0,2)or(*,3)where* meanswedontcare. Example"2." WaterJugs Ifwestartoffwithgal3andgal4asinteger,canonlyreach integervalues. Somevalues,e.g.,(1,2)arenotreachablefromsomeiniJal state,e.g.,(0,0). SomeacJonsarenoBops.Theydonotchangethestate,e.g., (0,0)!EmptyB3BGallon!(0,0) 13" 14" Example"3."The"8WPuzzle" Example"3."The"8WPuzzle" Rule:CanslideaJleintotheblankspot. AlternaJveview:movetheblankspotaround. Statespace. States:ThedifferentconfiguraJonsoftheJles.Howmany differentstates? AcJons:Movingtheblankup,down,leU,right.Canevery acjonbeperformedineverystate? IniJalstate:e.g.,stateshownonpreviousslide. DesiredcondiJon(Goal):beinastatewheretheJlesareall intheposijonsshownonthepreviousslide. SoluJonwillbeasequenceofmovesoftheblank thattransformtheinijalstatetoagoalstate. 15" 16"

5 Example"3."The"8WPuzzle" Althoughthereare9!differentconfiguraJonsofthe Jles(362,880)infactthestatespaceisdividedinto twodisjointparts. Onlywhentheblankisinthemiddleareallfour acjonspossible. OurgoalcondiJonissaJsfiedbyonlyasinglestate. ButonecouldeasilyhaveagoalcondiJonlike The8isintheupperleUhandcorner. HowmanydifferentstatessaJsfythisgoal? More"complex"situa0ons" PerhapsacJonsleadtomulJplestates,e.g.,flipa cointoobtainheadsortails.orwedontknowfor surewhattheinijalstateis(prizeisbehinddoor1, 2,or3).Nowwemightwanttoconsiderhowlikely differentstatesandacjonoutcomesare. ThisleadstoprobabilisJcmodelsofthesearchspace anddifferentalgorithmsforsolvingtheproblem. Laterwewillseesometechniquesforreasoning underuncertainty. 17" 18" Algorithms"for"Search" Algorithms"for"Search" Inputs: aspecifiedinijalstate(aspecificworldstate) asuccessorfuncjons(x)={setofstatesthatcanbereached fromstatexviaasingleacjon}. agoaltestafuncjonthatcanbeappliedtoastateand returnstrueifthestatesajsfiesthegoalcondijon. AnacJoncostfuncJonC(x,a,y)whichdeterminesthecostof movingfromstatextostateyusingacjona.(c(x,a,y)= if adoesnotyieldyfromx).notethatdifferentacjonsmight generatethesamemoveofx!y. Output: asequenceofstatesleadingfromtheinijalstatetoa statesajsfyingthegoaltest. Thesequencemightbe,opJmalincostforsome algorithms,opjmalinlengthforsomealgorithms,come withnoopjmalityguaranteesfromotheralgorithms. 19" 20"

6 Algorithms"for"Search" ObtainingtheacJonsequence. Thesetofsuccessorsofastatexmightarisefromdifferent acjons,e.g., x a y x b z SuccessorfuncJonS(x)yieldsasetofstatesthatcanbereached fromxviaanysingleacjon. Ratherthanjustreturnasetofstates,weannotatethese statesbytheacjonusedtoobtainthem: S(x)={<y,a>,<z,b>} yviaacjona,zviaacjonb. S(x)={<y,a>,<y,b>} yviaacjona,alsoyviaalternajveacjonb. Template"Search"Algorithms" Thesearchspaceconsistsofstates"andacJonsthatmove betweenstates. Apath"inthesearchspaceisasequence"ofstatesconnected byacjons,<s 0,s 1,s 2,,s k >, foreverys i anditssuccessors i+1 theremustexistanacjona i thattransijonss i tos i+1. Alternatelyapathcanbespecifiedby (a)aninijalstates 0,and (b)asequenceofacjonsthatareappliedinturnstarjngfroms 0. Thesearchalgorithmsperformsearchbyexamining alternatepathsofthesearchspace.theobjectsused inthealgorithmarecallednodes eachnode containsapath. 21" 22" Template"Algorithm"for"Search" Template"Algorithm"for"Search" WemaintainasetofFronJernodesalsocalledtheOPENset. ThesenodesarepathsinthesearchspacethatallstartattheiniJal state. IniJallywesetOPEN={<StartState>} Thepath(node)thatstartsandterminatesatthestartstate. AteachstepweselectanodenfromOPEN.Letxbethestate nterminatesat.wecheckifxsajsfiesthegoal,ifnotweadd allextensionsofntoopen(byfindingallstatesins(x)). Search(OPEN, Successors, Goal? ) While(Open not EMPTY) { n = select node from OPEN Curr = terminal state of n If (Goal?(Curr)) return n. OPEN = (OPEN {n}) U s Successors(Curr) <n,s> /* Note OPEN could grow or shrink */ } return FAIL WhendoesOPENgetsmallerinsize? 23" 24"

7 {<Arad>}, {<A,Z>,"<A,T>,"<A,"S>}, {<A,Z>,<A,T>,<A,S,A>,"<A,S,O>,"<A,S,F>,"<A,S,R>} {<A,Z>,<A,T>,<A,S,A>,<A,S,O>,<A,S,R>,<A,S,F,S>,"<A,S,F,B>} {<Arad>}, {<A,Z>,"<A,T>,"<A,"S>}, {<A,Z>,<A,T>,<A,S,A>,"<A,S,O>,"<A,S,F>,"<A,S,R>} {<A,Z>,<A,T>,<A,S,A>,<A,S,O>,<A,S,F>,<A,S,R,S>,"<A,S,R,C>,"<A,S,R,P>} {<A,Z>,<A,T>,<A,S,A>,<A,S,O>,<A,S,F>,"<A,S,R,S>,<A,S,R,C>,<A,S,R,P,R>,<A,S,R,P,C>,<A,S,R,P,B>} Solu0on:"Arad"W>"Sibiu"W>"Fagaras"W>"Bucharest" "Cost:"""""""""140"""+""""99"""+""""211""""="""""450" 25" Solu0on:"Arad"W>"Sibiu"W>"Rimnicu"Vilcea"W>"Pites0"W>"Bucharest" Cost:""""""""""140"""+"""80"""""+""""""""""""""""97"""""""""+""""101"""""=""""418" 26" Selec0on"Rule" TheorderpathsareselectedfromOPENhasacriJcal effectontheoperajonofthesearch: WhetherornotasoluJonisfound ThecostofthesoluJonfound. TheJmeandspacerequiredbythesearch. {<Arad>}, {<A,Z>,<A,T>,<A,S>}, {<A,Z>,<A,T>,<A,S,A>,<A,S,O>,<A,S,F>,<A,S,R>} {<A,Z>,<A,T>,"<A,S,A>,<A,S,O>,<A,S,R>,<A,S,F,S>,<A,S,F,B>}.. cyclescancausenonbterminajon! wedealwiththisissuelater 27" 28"

8 How"to"select"the"next"path"from"OPEN?" AllsearchtechniqueskeepOPENasanorderedset(e.g.,a priorityqueue)andrepeatedlyexecute: IfOPENisempty,terminatewithfailure. GetthenextpathfromOPEN. Ifthepathleadstoagoalstate,terminatewithsuccess. Extendthepath(i.e.generatethesuccessorstatesofthe terminalstateofthepath)andputthenewpathsinopen. Cri0cal"Proper0es"of"Search" Completeness:willthesearchalwaysfindasoluJonifa solujonexists? OpJmality:willthesearchalwaysfindtheleastcost solujon?(whenacjonshavecosts) Timecomplexity:whatisthemaximumnumberofnodes (paths)thancanbeexpandedorgenerated? Spacecomplexity:whatisthemaximumnumberof nodes(paths)thathavetobestoredinmemory? HowdoweorderthepathsonOPEN? 29" 30" Uninformed"Search"Strategies" ThesearestrategiesthatadoptafixedruleforselecJng thenextstatetobeexpanded. TheruledoesnotchangeirrespecJveofthesearch problembeingsolved. Thesestrategiesdonottakeintoaccountanydomain specificinformajonabouttheparjcularsearch problem. Uninformedsearchtechniques: BreadthBFirst,UniformBCost,DepthBFirst,DepthBLimited,andIteraJveB Deepeningsearch BreadthWFirst"Search" 31" 32"

9 BreadthWFirst"Search" Placethenewpathsthatextendthecurrentpathatthe endofopen. WaterJugs.Start=(0,0),Goal=(*,2) Green=NewlyAdded. 1. OPEN={<(0,0)>} 2. OPEN={<(0,0),(3,0)>,"<(0,0),(0,4)>} 3. OPEN={<(0,0),(0,4)>,<(0,0),(3,0),(0,0)>,"" """"""""""""""""<(0,0)",(3,0),(3,4)>,"<(0,0),(3,0),(0,3)">} 4. OPEN={<(0,0),(3,0),(0,0)>,<(0,0),(3,0),(3,4)>, <(0,0),(3,0),(0,3)>,<(0,0),(0,4),(0,0)>,"" """""""""""""""<(0,0),(0,4),(3,4)>,"<(0,0),(0,4),(3,1)>} 33" BreadthWFirst"Search" Level0 Level1 Level2 #2:(3,0) #4:(0,0) #5:(3,4) #6:(0,3) #1:(0,0) #3:(0,4) #7:(0,0) #8:(3,4) #9:(3,1) " Aboveweindicateonlythestatethateachnodesterminatesat.The pathrepresentedbyeachnodeisthepathfromtheroottothatnode. " BreadthBFirstexploresthesearchspacelevelbylevel. 34" BreadthWFirst"Proper0es" Completeness? ThelengthofthepathremovedfromOPENisnonBdecreasing. wereplaceeachexpandednodenwithanextensionofn. Allshorterpathsareexpandedpriorbeforeanylongerpath. Hence,eventuallywemustexamineallpathsoflengthd,and thusfindasolujonifoneexists. OpJmality? BytheabovewillfindshortestlengthsoluJon leastcostsolujon? Notnecessarily:shortestsoluJonnotalwayscheapest solujonifacjonshavevaryingcosts Beadth"first"Solu0on:"Arad"W>"Sibiu"W>"Fagaras"W>"Bucharest" "Cost:"""""""""140"""+""""99"""+""""211""""="""""450" Lowest"cost"Solu0on:"Arad"W>"Sibiu"W>"Rimnicu"Vilcea"W>"Pites0"W>"Bucharest" Cost:""""""""""140"""+"""80"""""+""""""""""""""""97"""""""""+""""101"""""=""""418" 35" 36"

10 BreadthWFirst"Proper0es" MeasuringJmeandspacecomplexity. letbbethemaximumnumberofsuccessorsofany node(maximalbranchingfactor). letdbethedepthoftheshortestsolujon. Rootatdepth0isapathoflength1 Sod=lengthofpathB1 TimeComplexity? BreadthWFirst"Proper0es" SpaceComplexity? O(b d+1 ):Ifgoalnodeislastnodeatleveld,allofthe successorsoftheothernodeswillbeonopenwhenthe goalnodeisexpandedb(b d 1) 1+b+b 2 +b 3 + +b db1 +b d +b(b d 1)=O(b d+1 ) 37" 38" BreadthWFirst"Proper0es" Spacecomplexityisarealproblem. E.g.,letb=10,andsay100,000nodescanbeexpandedper secondandeachnoderequires100bytesofstorage: Depth Nodes Time Memory UniformWCost"Search" millisec. 100bytes sec. 100MB min. 10GB hrs. 100GB TypicallyrunoutofspacebeforewerunoutofJme inmostapplicajons. 39" 40"

11 UniformWCost"Search" KeepOPENorderedbyincreasingcostofthepath. Alwaysexpandtheleastcostpath. IdenJcaltoBreadthfirstifeachacJonhasthesamecost. UniformWCost"Proper0es" Completeness? IfeachtransiJonhascosts ε>0. Thepreviousargumentusedforbreadthfirstsearchholds:the costofthepathrepresentedbyeachnodenchosentobe expandedmustbenonbdecreasing. OpJmality? FindsopJmalsoluJonifeachtransiJonhascost ε>0. Explorespathsinthesearchspaceinincreasingorderofcost. Somustfindminimumcostpathtoagoalbeforefindingany highercostspaths. 41" 42" UniformWCost"Search."Proof"of"Op0mality" UniformWCost"Search."Proof"of"Op0mality" LetusproveOpJmalitymoreformally.Wewillreusethis argumentlateronwhenweexamineheurisjcsearch Lemma"1." Letc(n)bethecostofnodenonOPEN(costofthepath representedbyn).ifn2isexpandedimmediately auern1then c(n1) c(n2). Proof:thereare2cases: a. n2wasonopenwhenn1wasexpanded: We#must#have#c(n1)# #c(n2)#otherwise#n2#would#have#been#selected#for# expansion#rather#than#n1# b. n2wasaddedtoopenwhenn1wasexpanded ##########Now#c(n1)#<#c(n2)#since#the#path#represented#by#n2#extends##the#path# represented#by#n1#and#thus#cost#at#least#ε#more.# 43" 44"

12 UniformWCost"Search."Proof"of"Op0mality" Lemma"2." Whennodenisexpandedeverypathinthesearchspacewith coststrictlylessthanc(n)hasalreadybeenexpanded. Proof: Letnk=<Start,s1,,sk>beapathwithcostlessthanc(n).Letn0= <Start>,n1=<Start,s1>,n2=<Start,s1,s2>,,ni=<Start,s1,,si>,, nk=<start,s1,,sk>.letnibethe#last#node#in#this#sequence#that#has# already#been#expanded#by#search.# So,ni+1mustsJllbeonOPEN:itwasaddedtoopenwhenniwas expanded.alsoc(ni+1) c(nk)<c(n):c(ni+1)isasubpathofnkwehave assumedthatc(nk)is<c(n). ButthenuniformBcostwouldhaveexpandedni+1notn. Soeverynodeniincludingnkmustalreadybeexpanded,i.e.,thislower costpathhasalreadybeenexpanded. 45" UniformWCost"Search."Proof"of"Op0mality" Lemma"3." ThefirstJmeuniformBcostexpandsanoden terminajngatstates,ithasfoundtheminimalcost pathtos(itmightlaterfindotherpathstosbutnone ofthemcanbecheaper). Proof: Allcheaperpathshavealreadybeenexpanded,noneofthemterminatedat S. AllpathsexpandedaUernwillbeatleastasexpensive,sonocheaperpath toscanbefoundlater. So,whenapathtoagoalstateisexpandedthepathmust beopjmal(lowestcost). 46" UniformWCost"Proper0es" TimeandSpaceComplexity? O(b C*/ε )wherec*isthecostoftheopjmalsolujon. Theremaybemanypathswithcost C*:therecanbeasmany asb d pathsoflengthdintheworstcase. PathswithcostlowerthanC*canbeaslongasC*/ε(whyno longer?),somighthaveb C*/ε pathstoexplorebeforefindingan opjmalcostpath. DepthWFirst"Search" 47" 48"

13 DepthWFirst"Search" Placethenewpathsthatextendthecurrentpathatthe frontofopen. WaterJugs.Start=(0,0),Goal=(*,2) Green=NewlyAdded. 1. OPEN={<(0,0)>} 2. OPEN={<(0,0),"(3,0)>,"<(0,0),"(0,4)>} 3. OPEN={<(0,0),(3,0),(0,0)>,"<(0,0),(3,0),(3,4)>,"" """"""""""""""""<(0,0),(3,0),(0,3)>,<(0,4),(0,0)>} 4. OPEN={<(0,0),(3,0),(0,0),(3,0)>,"<(0,0),(3,0),(0,0),(0,4)>"" """""""""""""""<(0,0),(3,0),(3,4)>,<(0,0),(3,0),(0,3)>, <(0,0),(0,4)>} DepthWFirst"Search" Level0 Level1 Level2 Level3 #1:(0,0) #2:(3,0) (0,4) #3:(0,0) (3,4) (0,3) #4:(3,0) (0,4) " Rednodesarebacktrackpoints(thesenodesremainonopen). 49" 50" DepthWFirst"Proper0es" DepthWFirst"Proper0es" Completeness? Infinitepaths?Causeincompleteness! Prunepathswithcycles(duplicatestates) Wegetcompletenessifstatespaceisfinite TimeComplexity? O(b m )wheremisthelengthofthelongestpathinthestate space. Verybadifmismuchlargerthand(shortestpathtoagoal state),butiftherearemanysolujonpathsitcanbemuch fasterthanbreadthfirst.(canbygoodluckbumpintoasolujon quickly). OpJmality? No! 51" 52"

14 DepthWFirst"Proper0es" DepthBFirstBacktrackPoints=unexploredsiblingsof nodesalongcurrentpath. ThesearethenodesthatremainonopenaUerweextracta nodetoexpand. SpaceComplexity? O(bm),linearspace! OnlyexploreasinglepathataJme. OPENonlycontainsthedeepestnodeonthecurrentpath alongwiththebacktrackpoints. AsignificantadvantageofDFS DepthWLimited"Search" 53" 54" Depth"Limited"Search" Depth"Limited"Search" Breadthfirsthasspaceproblems.Depthfirstcanrunoffdowna verylong(orinfinite)path. Depthlimitedsearch PerformdepthfirstsearchbutonlytoapreBspecifieddepthlimitD. THEROOTisatDEPTH0.ROOTisapathoflength1. NonoderepresenJngapathoflengthmorethanD+1isplacedonOPEN. We truncate thesearchbylookingonlyatpathsoflengthd+1orless. Nowinfinitelengthpathsarenotaproblem. ButwillonlyfindasoluJonifasoluJonofDEPTH Dexists. DLS(OPEN, Successors, Goal?) /* Call with OPEN = {<START>} */ WHILE(OPEN not EMPTY) { n= select first node from OPEN Curr = terminal state of n If(Goal?(Curr)) return n If Depth(n) < D //Dont add successors if Depth(n) = D OPEN = (OPEN {n}) U s Successors(Curr) <n,s> Else OPEN = OPEN {n} CutOffOccured = TRUE. } return FAIL WewilluseCutOffOccuredlater. 55" 56"

15 Depth"Limited"Search"Example" Itera0ve"Deepening"Search" 57" 58" Itera0ve"Deepening"Search" Itera0ve"Deepening"Search"Example" SolvetheproblemsofdepthBfirstandbreadthBfirstby extendingdepthlimitedsearch StarJngatdepthlimitL=0,weiteraJvelyincreasethe depthlimit,performingadepthlimitedsearchforeach depthlimit. StopifasoluJonisfound,orifthedepthlimitedsearch failedwithoutcu~ngoffanynodesbecauseofthe depthlimit. Ifnonodeswerecutoff,thesearchexaminedallpathsinthe statespaceandfoundnosolujon!nosolujonexists. 59" 60"

16 Itera0ve"Deepening"Search"Example" Itera0ve"Deepening"Search"Example" 61" 62" Itera0ve"Deepening"Search"Example" Itera0ve"Deepening"Search"Proper0es" Completeness? YesifaminimaldepthsoluJonofdepthdexists. WhathappenswhenthedepthlimitL=d? WhathappenswhenthedepthlimitL<d? TimeComplexity? 63" 64"

17 Itera0ve"Deepening"Search"Proper0es" TimeComplexity (d+1)b 0 +db 1 +(db1)b 2 + +b d =O(b d ) E.g.b=4,d=10 (11)* *4 1 +9* = 1,864, =1,048,576 Mostnodeslieonboomlayer. BFS"can"explore"more"states"than"IDS!" " ForIDS,theJmecomplexityis (d+1)b 0 +db 1 +(db1)b 2 + +b d =O(b d ) " ForBFS,theJmecomplexityis 1+b+b 2 +b 3 + +b d +b(b d 1)=O(b d+1 ) E.g.b=4,d=10 " ForIDS (11)* *4 1 +9* = 1,864,131(statesgenerated) " ForBFS (4 10 1)=5,592,401(statesgenerated) InfactIDScanbemoreefficientthanbreadthfirstsearch:nodesatlimitare notexpanded.bfsmustexpandallnodesunjlitexpandsagoalnode.soa theboomlayeritwilladdmanynodestoopenbeforefindingthegoal node. 65" 66" Itera0ve"Deepening"Search"Proper0es" SpaceComplexity O(bd)SJlllinear! OpJmal? WillfindshortestlengthsoluJonwhichisopJmalifcostsare uniform. Ifcostsarenotuniform,wecanusea cost boundinstead. Path/Cycle"Checking" Onlyexpandpathsofcostlessthanthecostbound. Keeptrackoftheminimumcostunexpandedpathineach depthfirstiterajon,increasethecostboundtothisonthe nextiterajon. Thiscanbemoreexpensive.NeedasmanyiteraJonsofthe searchastherearedisjnctpathcosts. 67" 68"

18 Path"Checking" Example:"Arad"to"Neamt" Ifnkrepresentsthepath<s 0,s 1,,s k >andweexpands k toobtain childc,wehave <S,s 1,,s k,c> Asthepathto c. Pathchecking: Ensurethatthestatecisnotequaltothestatereachedbyany ancestorofcalongthispath. PathsarecheckedinisolaJon! 69" 70" Path"Checking"Example" Cycle"Checking" Arad CycleChecking Keeptrackofallstatespreviouslyexpandedduringthesearch. Timisoara Sibiu Whenweexpandn k toobtainchildc Ensurethatcisnotequaltoanypreviouslyexpandedstate. Arad Lugoj Arad R. Vilcea Fagaras Thisiscalledcyclechecking,ormulJplepathchecking. WhathappenswhenweuJlizethistechniquewithdepthBfirst search? Timisoara Mehadia Sibiu Craiova Pitesti What"happens"to"space"complexity?" Lugoj Drobeta R. Vilcea Drobeta Pitesti 71" 72"

19 Cycle"Checking"Example"(BFS)" Cycle"Checking" Arad Higherspacecomplexity(equaltothespacecomplexityof breadthbfirstsearch. Timisoara Sibiu ThereisanaddiJonalissuewhenwearelookingforan opjmalsolujon" Arad Timisoara Lugoj Lugoj Mehadia Drobeta Arad R. Vilcea Sibiu Craiova R. Vilcea Drobeta Pitesti Fagaras Pitesti WithuniformBcostsearch,wesJllfindanopJmalsoluJon ThefirstJmeuniformBcostexpandsastateithasfoundthe minimalcostpathtoit. Thismeansthatthenodesrejectedsubsequentlybycycle checkingcanthavebeerpaths. Wewillseelaterthatwedontalwayshavethispropertywhen wedoheurisjcsearch. 73" 74" Heuris0c"Search" Heuris0c"Search" (Informed"Search)" Inuninformed"search,wedonttrytoevaluatewhich ofthenodesonopenaremostpromising.wenever lookbahead tothegoal. E.g.,inuniformcostsearchwealwaysexpandthecheapest path.wedontconsiderthecostofge~ngtothegoalfrom theendofthecurrentpath. OUenwehavesomeotherknowledgeaboutthemerit ofnodes,e.g.,goingthewrongdirecjoninromania. 75" 76"

20 Heuris0c"Search" MeritofanOPENnode:differentnoJonsof merit. IfweareconcernedaboutthecostofthesoluJon, wemightwanttoconsiderhowcostlyitistoget tothegoalfromtheterminalstateofthatnode. Ifweareconcernedaboutminimizing computajoninsearchwemightwanttoconsider howeasyitistofindthegoalfromtheterminal stateofthatnode. Wewillfocusonthe costofsolujon nojonof merit. Heuris0c"Search" TheideaistodevelopadomainspecificheurisJc funcjonh(n). h(n)guessesthecostofge~ngtothegoalfromnoden (i.e.,fromtheterminalstateofthepathrepresentedby n). Therearedifferentwaysofguessingthiscostindifferent domains. heurisjcsaredomainspecific. 77" 78" Example:"Euclidean"distance" Heuris0c"Search" Ifh(n 1 )<h(n 2 )thismeansthatweguessthatitis cheapertogettothegoalfromn 1 thanfromn 2. Werequirethat h(n)=0foreverynodenwhoseterminalstatesajsfiesthegoal. ZerocostofachievingthegoalfromnodethatalreadysaJsfies thegoal. Planning a path from Arad to Bucharest, we can utilize the straight line distance from each city to our goal. This lets us plan our trip by picking cities at each time point that minimize the distance to our goal. 79" 80"

21 Using"only"h(n):"Greedy"bestWfirst"search" Greedy"bestWfirst"search"example" Weuseh(n)torankthenodesonOPEN AlwaysexpandnodewithlowesthBvalue. WearegreedilytryingtoachievealowcostsoluJon. However,thismethodignores"the"cost"of"geing"to"n,soitcanbeleadastray exploringnodesthatcostalotbutseemtobeclosetothegoal: step cost = 10 step cost = 100 h(n1) = 20 10" n1 S 100" n3 h(n3) = 10 10" n2 10" 10" Goal 81" 82" A*"search" A * "example" Takeintoaccountthecostofge~ngtothenodeaswellasour esjmateofthecostofge~ngtothegoalfromthenode. DefineanevaluaJonfuncJonf(n) f(n)=g(n)+h(n) g(n)isthecostofthepathrepresentedbynoden h(n)istheheurisjcesjmateofthecostofachievingthegoalfromn. AlwaysexpandthenodewithlowestfBvalueonOPEN. ThefBvalue,f(n)isanesJmateofthecostofge~ngtothegoal viathenode(path)n. I.e.,wefirstfollowthepathnthenwetrytogettothegoal.f(n)esJmates thetotalcostofsuchasolujon. 83" 84"

22 A * "example" A * "example" 85" 86" A * "example" A * "example" 87" 88"

23 A * "example" Proper0es"of"A*"depend"on"condi0ons"on"h(n)" Wewanttoanalyzethebehavioroftheresultantsearch. Completeness,Jmeandspace,opJmality? Toobtainsuchresultswemustputsomefurther condijonsontheheurisjcfuncjonh(n)andthesearch space. 89" 90" Condi0ons"on"h(n):"Admissible" Consistency"(aka"monotonicity)" Wealwaysassumethatc(s1,a,s2) ε>0foranytwo statess1ands2andanyacjona:thecostofany transijonisgreaterthanzeroandcantbearbitrarily small. Leth*(n)bethecost"of"anop0mal"pathfromntoagoal node( ifthereisnopath).thenanadmissible heurisjcsajsfiesthecondijon h(n) h*(n) AstrongercondiJonthanh(n) h*(n). Amonotone/consistentheurisJcsaJsfiesthetriangle inequality:forallnodesn1,n2andforallacjonsa h(n1) C(n1,a,n2)+h(n2) WhereC(n1,a,n2)meansthecostofge~ngfromtheterminal stateofn1totheterminalstateofn2viaacjona. anadmissibleheurisjcneveroverbesjmatesthecosttoreach thegoal,i.e.,itisopjmisjc Henceh(g)=0,foranygoalnodeg Alsoh*(n)= ifthereisnopathfromntoagoalnode NotethattheremightbemorethanonetransiJon(acJon) betweenn1andn2,theinequalitymustholdforallofthem. Monotonicityimpliesadmissibility. (foralln1,n2,a)h(n1) C(n1,a,n2)+h(n2)#(foralln)h(n) h*(n) 91" 92"

24 Consistency"#"Admissible" Intui0on"behind"admissibility" Assume"consistency:"h(n) c(n,a,n2)+h(n2)" "Prove"admissible:"h(n) h*(n) Proof:" Letn!n1!!n*beanOPTIMALpathfromntoagoal(with acjonsa1,a2).notethecostofthispathish*(n),andeachsubpath (ni!!n*)hascostequaltoh*(ni). Ifnopathexistsfromntoagoalthenh*(n)= andh(n) h*(n) Otherwiseproveh(n) h*(n)byinducjononthelengthofthis opjmalpath. Base"Case:"n"="n*" ByourcondiJonsonh,h(n)=0 h(n)*=0 Induc0on"Hypothesis:"h(n1)" h*(n1)"" h(n) c(n,a1,n1)+h(n1) c(n,a1,n1)+h*(n1)=h*(n) 93" h(n) h*(n)meansthatthesearchwon tmissanypromisingpaths. Ifitreallyischeaptogettoagoalvian(i.e.,bothg(n)andh*(n) arelow),thenf(n)=g(n)+h(n)willalsobelow,andthesearch won tignoreninfavorofmoreexpensiveopjons. Thiscanbeformalizedtoshowthatadmissibilityimplies opjmality. MonotonicitygivessomeaddiJonalproperJeswhenitcomesto cyclechecking. 94" Consequences"of"monotonicity" 1. ThefBvaluesofnodesalongapathmustbenonBdecreasing. Let<Start s1 s2 sk>beapath.letnibethesubpath <Start s1 si>: Weclaimthat:f(ni) f(ni+1) Proof f(ni)=c(start ni)+h(ni) c(start ni)+c(ni ni+1)+h(ni+1) c(start ni ni+1)+h(ni+1) g(ni+1)+h(ni+1)=f(ni+1) Consequences"of"monotonicity" 2. Ifn2isexpandedimmediatelyaUern1,then f(n1) f(n2) (thefbvalueofexpandednodesismonotonicnonbdecreasing) Proof:" Ifn2wasonOPENwhenn1wasexpanded, thenf(n1) f(n2)otherwisewewouldhaveexpandedn2. Ifn2wasaddedtoOPENaUern1sexpansion,thenn2extends n1spath.thatis,thepathrepresentedbyn1isaprefixofthe pathrepresentedbyn2.byproperty(1)wehavef(n1) f(n2)as thefbvaluesalongapatharenonbdecreasing. 95" 96"

25 Consequences"of"monotonicity" 3. Corollary:thesequenceoffBvaluesofthenodes expandedbya*isnonbdecreasing.i.e,ifn2is expandedaker(notnecessarilyimmediatelyauer)n1, thenf(n1) f(n2) (thefbvalueofexpandednodesismonotonicnonbdecreasing) Proof: Ifn2wasonOPENwhenn1wasexpanded, thenf(n1) f(n2)otherwisewewouldhaveexpandedn2. Ifn2wasaddedtoOPENaUern1sexpansion,thenletnbe anancestorofn2thatwaspresentwhenn1wasbeing expanded(thiscouldben1itself).wehavef(n1) f(n)since A*chosen1whilenwaspresentonOPEN.Also,sincenis alongthepathton2,byproperty(1)wehavef(n) f(n2).so, wehavef(n1) f(n2). 97" Consequences"of"monotonicity" 4. WhennisexpandedeverypathwithlowerfBvaluehasalready beenexpanded. Proof:AssumebycontradicJonthatthereexistsapath<Start, n0,n1,nib1,ni,ni+1,,nk>withf(nk)<f(n)andniisitslast expandednode. ni+1mustbeonopenwhilenisexpanded,so a)by(1)f(ni+1) f(nk)sincetheyliealongthesamepath. b)sincef(nk)<f(n)sowehavef(ni+1)<f(n) c)by(2)f(n) f(ni+1)becausenisexpandedbeforeni+1. ContradicJonfromb&c! 98" Consequences"of"monotonicity" Consequences"of"monotonicity" 5. WithamonotoneheurisJc,thefirstJmeA*expandsa state,ithasfoundtheminimumcostpathtothatstate. Proof: LetPATH1="<Start,"s0,"s1,","sk,"s>bethe"firstpathtoastates found.wehavef(path1)=c(path1)+h(s). LetPATH2"="<Start,"t0,"t1,","tj,"s>beanotherpathtosfoundlater. wehavef(path2)=c(path2)+h(s). Noteh(s)isdependentonlyonthestates(terminalstateofthe path)itdoesnotdependonhowwegottos. Byproperty(3),f(path1) f(path2) hence:c(path1) c(path2) Complete." Yes,consideraleastcostpathtoagoalnode SoluJonPath=<Start n1 G>withcostc(SoluJonPath).Sinceh(G)= 0,thismeansthatf(SoluJonPath)=cost(SoluJonPath) SinceeachacJonhasacost ε>0,thereareonlyafinitenumberofpaths thathavefbvalue<c(solujonpath).noneofthesepathsleadtoagoalnode sincesolujonpathisaleastcostpathtothegoal. SoeventuallySoluJonPath,orsomeequalcostpathtoagoalmustbe expanded. Time"and"Space"complexity." Whenh(n)=0,forallnhismonotone. A*becomesuniformBcostsearch! Itcanbeshownthatwhenh(n)>0forsomenandsJlladmissible,thenumber ofnodesexpandedcanbenolargerthanuniformbcost. HencethesameboundsasuniformBcostapply.(Theseareworstcasebounds). SJllexponenJalunlesswehaveaverygoodh! Inrealworldproblems,wesomeJmesrunoutofJmeandmemory.IDA*can somejmesbeusedtoaddressmemoryissues,butida*isn tverygoodwhen manycyclesarepresent. 99" 100"

26 Consequences"of"monotonicity" OpJmality " Yes,by(5)thefirstpathtoagoalnodemustbeopJmal. CycleChecking 5. WithamonotoneheurisJc,thefirstJmeA*expandsastate, ithasfoundtheminimumcostpathtothatstate. " WecanuseasimpleimplementaJonofcyclechecking (muljplepathchecking)bbbjustrejectallsearchnodes visijngastatealreadyvisitedbyapreviouslyexpanded node.byproperty(5)weneedkeeponlythefirstpathto astate,rejecjngallsubsequentpaths. Admissibility"without"monotonicity" When" h "is"admissible"but"not"monotonic." TimeandSpacecomplexityremainthesame.Completenessholds. OpJmalitysJllholds(withoutcyclechecking),butneedadifferent argument:dontknowthatpathsareexploredinorderofcost. 101" 102" Admissibility"without"monotonicity" Space"Problems"with"A*" What"about"Cycle"Checking?" NolongerguaranteedwehavefoundanopJmalpathtoanodethe$first$ (mewevisitit. So,cyclecheckingmightnotpreserveopJmality. Tofixthis:forpreviouslyvisitednodes,mustremembercostof previouspath.ifnewpathischeapermustexploreagain. A*hasthesamepotenJalspaceproblemsasBFSorUCS IDA*BIteraJveDeepeningA*issimilartoIteraJve DeepeningSearchandsimilarlyaddressesspaceissues. 103" 104"

27 IDA*"W"Itera0ve"Deepening"A*" ObjecJve:reducememoryrequirementsforA* LikeiteraJvedeepening,butnowthe cutoff isthefbvalue(g+h)rather thanthedepth AteachiteraJon,thecutoffvalueisthesmallestfBvalueofanynodethat exceededthecutoffonthepreviousiterajon Construc0ng"Heuris0cs" Avoidsoverheadassociatedwithkeepingasortedqueueofnodes,andthe openlistoccupiesonlylinearspace. Twonewparameters: curbound(anynodewithabiggerfbvalueisdiscarded) smallestnotexplored(thesmallestfbvaluefordiscardednodesina round)whenopenbecomesempty,thesearchstartsanewroundwith thisbound. EasiertoexpandallnodeswithfBvalueEQUALtothefBlimit.Thisway wecancompute smallestnotexplored moreeasily. 105" 106" Building"Heuris0cs:"Relaxed"Problem" Building"Heuris0cs:"Relaxed"Problem" Oneusefultechniqueistoconsideraneasierproblem,andlet h(n)bethecostofreachingthegoalintheeasierproblem. 8BPuzzlemoves. CanmoveaJlefromsquareAtoBif Aisadjacent(leU,right,above,below)toB andbisblank CanrelaxsomeofthesecondiJons 1. canmovefromatobifaisadjacenttob(ignorewhetherornot posijonisblank) 2. canmovefromatobifbisblank(ignoreadjacency) 3. canmovefromatob(ignorebothcondijons). #3" can#move#from#a#to#b#(ignore#both#condicons).## "leads"to"the"misplaced"0les"heuris0c." Tosolvethepuzzle,weneedtomoveeachJleintoitsfinalposiJon. Numberofmoves=numberofmisplacedJles. Clearlyh(n)=numberofmisplacedJles theh*(n)thecostofanopjmal sequenceofmovesfromn. #1" can#move#from#a#to#b#if#a#is#adjacent#to#b#(ignore#whether#or#not# posicon#is#blank) # "leads"to"the"manhaoan"distance"heuris0c. TosolvethepuzzleweneedtoslideeachJleintoitsfinalposiJon. WecanmoveverJcallyorhorizontally. Numberofmoves=sumoveralloftheJlesofthenumberofverJcaland horizontalslidesweneedtomovethatjleintoplace. Againh(n)=sumofthemanhaandistances h*(n) inarealsolujonweneedtomoveeachjleatleastthatfarandwe canonlymoveonejleatajme. 107" 108"

28 Building"Heuris0cs:"Relaxed"Problem" Building"Heuris0cs:"Relaxed"Problem" ComparisonofIDSandA*(averagetotalnodesexpanded): Depth IDS A*(Misplaced)h1" A*(Manhaan)h2" 10 47, ,473, BBB 39,135 1,641 Leth1=Misplaced,h2=Manhaan Doesh2alwaysexpandfewernodesthanh1? Yes!Notethath2"dominates"h1,i.e.foralln:h1(n) h2(n).from thisyoucanproveh2isfasterthanh1(oncebothareadmissible). Therefore,amongseveraladmissibleheurisJctheonewithhighest valueisthefastest. Theop0malcosttonodesintherelaxedproblemisan admissibleheurisjcfortheoriginalproblem! Proof"Idea:theopJmalsoluJonintheoriginalproblemisa solujonforrelaxedproblem,thereforeitmustbeatleastas expensiveastheopjmalsolujonintherelaxedproblem. SoadmissibleheurisJcscansomeJmesbeconstructedby findingarelaxajonwhoseopjmalsolujoncanbeeasily computed. 109" 110" Building"Heuris0cs:"Paoern"databases" TrytogenerateadmissibleheurisJcsbysolvinga subproblemandstoringtheexactsolujoncostforthat subproblem SeeChapter3.6.3ifyouareinterested. 111"

Tree/Graph Search. q IDDFS-? B C. Search CSL452 - ARTIFICIAL INTELLIGENCE 2

Tree/Graph Search. q IDDFS-? B C. Search CSL452 - ARTIFICIAL INTELLIGENCE 2 Informed Search Tree/Graph Search q IDDFS-? A B C D E F G Search CSL452 - ARTIFICIAL INTELLIGENCE 2 Informed (Heuristic) Search q Heuristic problem specific knowledge o finds solutions more efficiently

More information

AI Programming CS S-06 Heuristic Search

AI Programming CS S-06 Heuristic Search AI Programming CS662-2013S-06 Heuristic Search David Galles Department of Computer Science University of San Francisco 06-0: Overview Heuristic Search - exploiting knowledge about the problem Heuristic

More information

Solutions. Dynamic Programming & Optimal Control ( ) Number of Problems: 4. Use only the provided sheets for your solutions.

Solutions. Dynamic Programming & Optimal Control ( ) Number of Problems: 4. Use only the provided sheets for your solutions. Final Exam January 26th, 2012 Dynamic Programming & Optimal Control (151-0563-01) Prof. R. D Andrea Solutions Exam Duration: 150 minutes Number of Problems: 4 Permitted aids: One A4 sheet of paper. Use

More information

Problem solving and search. Chapter 3. Chapter 3 1

Problem solving and search. Chapter 3. Chapter 3 1 Problem solving and search Chapter 3 Chapter 3 1 eminders ssignment 0 due 5pm today ssignment 1 posted, due 2/9 Section 105 will move to 9-10am starting next week Chapter 3 2 Problem-solving agents Problem

More information

Deterministic Planning and State-space Search. Erez Karpas

Deterministic Planning and State-space Search. Erez Karpas Planning and Search IE&M Technion to our Problem-solving agents Restricted form of general agent def Simple-Problem-Solving-Agent (problem): state, some description of the current world state seq, an action

More information

Game Engineering CS F-12 Artificial Intelligence

Game Engineering CS F-12 Artificial Intelligence Game Engineering CS420-2011F-12 Artificial Intelligence David Galles Department of Computer Science University of San Francisco 12-0: Artifical Intelligence AI in games is a huge field Creating a believable

More information

Local search algorithms. Chapter 4, Sections 3 4 1

Local search algorithms. Chapter 4, Sections 3 4 1 Local search algorithms Chapter 4, Sections 3 4 Chapter 4, Sections 3 4 1 Outline Hill-climbing Simulated annealing Genetic algorithms (briefly) Local search in continuous spaces (very briefly) Chapter

More information

CS:4420 Artificial Intelligence

CS:4420 Artificial Intelligence CS:4420 Artificial Intelligence Spring 2017 Problem Solving by Search Cesare Tinelli The University of Iowa Copyright 2004 17, Cesare Tinelli and Stuart ussell a a These notes were originally developed

More information

22c:145 Artificial Intelligence

22c:145 Artificial Intelligence 22c:145 Artificial Intelligence Fall 2005 Problem Solving by Search Cesare Tinelli The University of Iowa Copyright 2001-05 Cesare Tinelli and Hantao Zhang. a a These notes are copyrighted material and

More information

Artificial Intelligence Methods. Problem solving by searching

Artificial Intelligence Methods. Problem solving by searching rtificial Intelligence Methods Problem solving by searching In which we see how an agent can find a sequence of actions that achieves its goals, when no single action will do. Dr. Igor Trajkovski Dr. Igor

More information

State Space Representa,ons and Search Algorithms

State Space Representa,ons and Search Algorithms State Space Representa,ons and Search Algorithms CS171, Fall 2016 Introduc,on to Ar,ficial Intelligence Prof. Alexander Ihler Reading: R&N 3.1-3.4 Architectures for Intelligence Search? Determine how to

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Chapter 1 Chapter 1 1 Outline Course overview What is AI? A brief history The state of the art Chapter 1 2 intelligent agents search and game-playing logical systems planning systems

More information

Solving Problems By Searching

Solving Problems By Searching Solving Problems By Searching Instructor: Dr. Wei Ding Fall 2010 1 Problem-Solving Agent Goal-based agents: considering future actions and the desirability of their outcomes. Decide what to do by finding

More information

Artificial Intelligence (Künstliche Intelligenz 1) Part II: Problem Solving

Artificial Intelligence (Künstliche Intelligenz 1) Part II: Problem Solving Kohlhase: Künstliche Intelligenz 1 76 July 12, 2018 Artificial Intelligence (Künstliche Intelligenz 1) Part II: Problem Solving Michael Kohlhase Professur für Wissensrepräsentation und -verarbeitung Informatik,

More information

CSC242: Artificial Intelligence. Lecture 4 Local Search

CSC242: Artificial Intelligence. Lecture 4 Local Search CSC242: Artificial Intelligence Lecture 4 Local Search Upper Level Writing Topics due to me by next class! First draft due Mar 4 Goal: final paper 15 pages +/- 2 pages 12 pt font, 1.5 line spacing Get

More information

Problem-Solving via Search Lecture 3

Problem-Solving via Search Lecture 3 Lecture 3 What is a search problem? How do search algorithms work and how do we evaluate their performance? 1 Agenda An example task Problem formulation Infrastructure for search algorithms Complexity

More information

CMU Lecture 4: Informed Search. Teacher: Gianni A. Di Caro

CMU Lecture 4: Informed Search. Teacher: Gianni A. Di Caro CMU 15-781 Lecture 4: Informed Search Teacher: Gianni A. Di Caro UNINFORMED VS. INFORMED Uninformed Can only generate successors and distinguish goals from non-goals Informed Strategies that can distinguish

More information

CSC242: Intro to AI. Lecture 5. Tuesday, February 26, 13

CSC242: Intro to AI. Lecture 5. Tuesday, February 26, 13 CSC242: Intro to AI Lecture 5 CSUG Tutoring: bit.ly/csug-tutoring League of Legends LAN Party: Sat 2/2 @ 2PM in CSB 209 $2 to benefit Big Brothers Big Sisters bit.ly/urlol ULW Topics due to me by tomorrow

More information

Artificial Intelligence Prof. Dr. Jürgen Dix

Artificial Intelligence Prof. Dr. Jürgen Dix Artificial Intelligence Prof. Dr. Jürgen Dix Computational Intelligence Group TU Clausthal Clausthal, SS 2012 Time and place: Tuesday and Wednesday 10 12 in Multimediahörsaal (Tannenhöhe) Exercises: See

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Prof. Dr. Jürgen Dix Computational Intelligence Group TU Clausthal Clausthal, SS 2014 Prof. Dr. Jürgen Dix Clausthal, SS 2014 1 Time and place: Tuesday and Wednesday 10 12 in Multimediahörsaal

More information

Last time: Summary. Last time: Summary

Last time: Summary. Last time: Summary 1 Last time: Summary Definition of AI? Turing Test? Intelligent Agents: Anything that can be viewed as perceiving its environment through sensors and acting upon that environment through its effectors

More information

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro CMU-Q 5-38 Lecure 3: Search algorihms: Informed Teacher: Gianni A. Di Caro UNINFORMED VS. INFORMED SEARCH Sraegy How desirable is o be in a cerain inermediae sae for he sake of (effecively) reaching a

More information

Informed Search. Chap. 4. Breadth First. O(Min(N,B L )) BFS. Search. have same cost BIBFS. Bi- Direction. O(Min(N,2B L/2 )) BFS. have same cost UCS

Informed Search. Chap. 4. Breadth First. O(Min(N,B L )) BFS. Search. have same cost BIBFS. Bi- Direction. O(Min(N,2B L/2 )) BFS. have same cost UCS Informed Search Chap. 4 Material in part from http://www.cs.cmu.edu/~awm/tutorials Uninformed Search Complexity N = Total number of states B = Average number of successors (branching factor) L = Length

More information

Uninformed Search Lecture 4

Uninformed Search Lecture 4 Lecture 4 Wht re common serch strtegies tht operte given only serch problem? How do they compre? 1 Agend A quick refresher DFS, BFS, ID-DFS, UCS Unifiction! 2 Serch Problem Formlism Defined vi the following

More information

Informed Search. Day 3 of Search. Chap. 4, Russel & Norvig. Material in part from

Informed Search. Day 3 of Search. Chap. 4, Russel & Norvig. Material in part from Informed Search Day 3 of Search Chap. 4, Russel & Norvig Material in part from http://www.cs.cmu.edu/~awm/tutorials Uninformed Search Complexity N = Total number of states B = Average number of successors

More information

Artificial Intelligence Prof. Dr. Jürgen Dix

Artificial Intelligence Prof. Dr. Jürgen Dix Artificial Intelligence Prof. Dr. Jürgen Dix Department of Informatics TU Clausthal Summer 2007 Time and place: Mondays and Tuesdays 10 12 in Multimediahörsaal (Tannenhöhe) Exercises: Approximately every

More information

2 Chapter 1. Introduction

2 Chapter 1. Introduction 1 INTRODUCTION 1 2 Chapter 1. Introduction Axonal arborization Axon from another cell Dendrite Synapse Axon Nucleus Synapses Cell body or Soma Figure 1.2 FILES: figures/neuron.eps (Tue Nov 3 16:23:13 2009).

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Time and place: Tuesday and Wednesday 10 12 in Multimediahörsaal (Tannenhöhe) Exercises: Approximately every other Tuesday. Prof. Dr. Jürgen Dix Department of Informatics TU Clausthal

More information

Big-O Notation and Complexity Analysis

Big-O Notation and Complexity Analysis Big-O Notation and Complexity Analysis Jonathan Backer backer@cs.ubc.ca Department of Computer Science University of British Columbia May 28, 2007 Problems Reading: CLRS: Growth of Functions 3 GT: Algorithm

More information

CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University

CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University http://cs224w.stanford.edu Find most influential set S of size k: largest expected cascade size f(s) if set S is activated

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 9 Last time: Converting a PDA to a CFG Pumping Lemma for CFLs Today: Pumping Lemma for CFLs Review of CFGs/PDAs Sofya Raskhodnikova 2/9/2016 Sofya Raskhodnikova;

More information

5 Context-Free Languages

5 Context-Free Languages CA320: COMPUTABILITY AND COMPLEXITY 1 5 Context-Free Languages 5.1 Context-Free Grammars Context-Free Grammars Context-free languages are specified with a context-free grammar (CFG). Formally, a CFG G

More information

CTL satisfability via tableau A C++ implementation

CTL satisfability via tableau A C++ implementation CTL satisfability via tableau A C++ implementation Nicola Prezza April 30, 2015 Outline 1 Introduction 2 Parsing 3 Data structures 4 Initial sets of labels and edges 5 Cull 6 Examples and benchmarks The

More information

I may not have gone where I intended to go, but I think I have ended up where I needed to be. Douglas Adams

I may not have gone where I intended to go, but I think I have ended up where I needed to be. Douglas Adams Disclaimer: I use these notes as a guide rather than a comprehensive coverage of the topic. They are neither a substitute for attending the lectures nor for reading the assigned material. I may not have

More information

1 Matchings in Non-Bipartite Graphs

1 Matchings in Non-Bipartite Graphs CS 598CSC: Combinatorial Optimization Lecture date: Feb 9, 010 Instructor: Chandra Chekuri Scribe: Matthew Yancey 1 Matchings in Non-Bipartite Graphs We discuss matching in general undirected graphs. Given

More information

Finite Automata and Formal Languages TMV026/DIT321 LP Useful, Useless, Generating and Reachable Symbols

Finite Automata and Formal Languages TMV026/DIT321 LP Useful, Useless, Generating and Reachable Symbols Finite Automata and Formal Languages TMV026/DIT321 LP4 2012 Lecture 13 Ana Bove May 7th 2012 Overview of today s lecture: Normal Forms for Context-Free Languages Pumping Lemma for Context-Free Languages

More information

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation Lecture 20: PSPACE November 15, 2016 CS 1010 Theory of Computation Recall that PSPACE = k=1 SPACE(nk ). We will see that a relationship between time and space complexity is given by: P NP PSPACE = NPSPACE

More information

CERTIFICATE. Str. Aurel Vlaicu, nr Satu Mare Romania

CERTIFICATE. Str. Aurel Vlaicu, nr Satu Mare Romania CERTIFICATE This is to certify that with the organizational units/sites as listed in the annex has implemented and maintains a Quality Management System. : Packaging, labelling, storage, distribution and

More information

Section 1 (closed-book) Total points 30

Section 1 (closed-book) Total points 30 CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes

More information

Recitation 4: Converting Grammars to Chomsky Normal Form, Simulation of Context Free Languages with Push-Down Automata, Semirings

Recitation 4: Converting Grammars to Chomsky Normal Form, Simulation of Context Free Languages with Push-Down Automata, Semirings Recitation 4: Converting Grammars to Chomsky Normal Form, Simulation of Context Free Languages with Push-Down Automata, Semirings 11-711: Algorithms for NLP October 10, 2014 Conversion to CNF Example grammar

More information

CFG Simplification. (simplify) 1. Eliminate useless symbols 2. Eliminate -productions 3. Eliminate unit productions

CFG Simplification. (simplify) 1. Eliminate useless symbols 2. Eliminate -productions 3. Eliminate unit productions CFG Simplification (simplify) 1. Eliminate useless symbols 2. Eliminate -productions 3. Eliminate unit productions 1 Eliminating useless symbols 1. A symbol X is generating if there exists: X * w, for

More information

Properties of Context-free Languages. Reading: Chapter 7

Properties of Context-free Languages. Reading: Chapter 7 Properties of Context-free Languages Reading: Chapter 7 1 Topics 1) Simplifying CFGs, Normal forms 2) Pumping lemma for CFLs 3) Closure and decision properties of CFLs 2 How to simplify CFGs? 3 Three ways

More information

3/11/18. Final Code Generation and Code Optimization

3/11/18. Final Code Generation and Code Optimization Final Code Generation and Code Optimization 1 2 3 for ( i=0; i < N; i++) { base = &a[0]; crt = *(base + i); } original code base = &a[0]; for ( i=0; i < N; i++) { crt = *(base + i); } optimized code e1

More information

Progressive & Algorithms & Systems

Progressive & Algorithms & Systems University of California Merced Lawrence Berkeley National Laboratory Progressive Computation for Data Exploration Progressive Computation Online Aggregation (OLA) in DB Query Result Estimate Result ε

More information

CMSC 330: Organization of Programming Languages. Pushdown Automata Parsing

CMSC 330: Organization of Programming Languages. Pushdown Automata Parsing CMSC 330: Organization of Programming Languages Pushdown Automata Parsing Chomsky Hierarchy Categorization of various languages and grammars Each is strictly more restrictive than the previous First described

More information

TOC. Search Paradigms: And Tree Search. Formal Definitions. And-tree-based Search. Formal Definitions

TOC. Search Paradigms: And Tree Search. Formal Definitions. And-tree-based Search. Formal Definitions TOC CPSC 33 - Artificial Intelligence Search Paradigms: And Tree Search Adapted from slides by Jörg Rob Kremer Denzinger ICT 8 kremer@cpsc.ucalgary.ca http://pages.cpsc.ucalgary.ca/~kremer/ Introduction

More information

Planning and search. Lecture 6: Search with non-determinism and partial observability

Planning and search. Lecture 6: Search with non-determinism and partial observability Planning and search Lecture 6: Search with non-determinism and partial observability Lecture 6: Search with non-determinism and partial observability 1 Today s lecture Non-deterministic actions. AND-OR

More information

CPS 220 Theory of Computation Pushdown Automata (PDA)

CPS 220 Theory of Computation Pushdown Automata (PDA) CPS 220 Theory of Computation Pushdown Automata (PDA) Nondeterministic Finite Automaton with some extra memory Memory is called the stack, accessed in a very restricted way: in a First-In First-Out fashion

More information

Analysis of Uninformed Search Methods

Analysis of Uninformed Search Methods nalysis of Uninformed earch Methods rian. Williams 16.410-13 ep 21 st, 2004 lides adapted from: 6.034 Tomas Lozano Perez, Russell and Norvig IM rian Williams, Fall 04 1 ssignments Remember: Problem et

More information

Automata: a short introduction

Automata: a short introduction ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Plan for 2 nd half. Just when you thought it was safe. Just when you thought it was safe. Theory Hall of Fame. Chomsky Normal Form

Plan for 2 nd half. Just when you thought it was safe. Just when you thought it was safe. Theory Hall of Fame. Chomsky Normal Form Plan for 2 nd half Pumping Lemma for CFLs The Return of the Pumping Lemma Just when you thought it was safe Return of the Pumping Lemma Recall: With Regular Languages The Pumping Lemma showed that if a

More information

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions? Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)

More information

2.6 Complexity Theory for Map-Reduce. Star Joins 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51

2.6 Complexity Theory for Map-Reduce. Star Joins 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51 Star Joins A common structure for data mining of commercial data is the star join. For example, a chain store like Walmart keeps a fact table whose tuples each

More information

Lecture 12 Simplification of Context-Free Grammars and Normal Forms

Lecture 12 Simplification of Context-Free Grammars and Normal Forms Lecture 12 Simplification of Context-Free Grammars and Normal Forms COT 4420 Theory of Computation Chapter 6 Normal Forms for CFGs 1. Chomsky Normal Form CNF Productions of form A BC A, B, C V A a a T

More information

Algorithm Robust For The Bicriteria Discrete Optimization Problem

Algorithm Robust For The Bicriteria Discrete Optimization Problem Algorithm Robust For The Bicriteria Discrete Optimization Problem Department of Mathematics University of Kaiserslautern 21.05.07 Example from Electrical Engineering Example from Electrical Engineering

More information

GTRAC FAST R ETRIEVAL FROM C OMPRESSED C OLLECTIONS OF G ENOMIC VARIANTS. Kedar Tatwawadi Mikel Hernaez Idoia Ochoa Tsachy Weissman

GTRAC FAST R ETRIEVAL FROM C OMPRESSED C OLLECTIONS OF G ENOMIC VARIANTS. Kedar Tatwawadi Mikel Hernaez Idoia Ochoa Tsachy Weissman GTRAC FAST R ETRIEVAL FROM C OMPRESSED C OLLECTIONS OF G ENOMIC VARIANTS Kedar Tatwawadi Mikel Hernaez Idoia Ochoa Tsachy Weissman Overview Introduction Results Algorithm Details Summary & Further Work

More information

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where Recitation 11 Notes Context Free Grammars Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x A V, and x (V T)*. Examples Problem 1. Given the

More information

Fundamentals of Programming. Efficiency of algorithms November 5, 2017

Fundamentals of Programming. Efficiency of algorithms November 5, 2017 15-112 Fundamentals of Programming Efficiency of algorithms November 5, 2017 Complexity of sorting algorithms Selection Sort Bubble Sort Insertion Sort Efficiency of Algorithms A computer program should

More information

6.830 Lecture 11. Recap 10/15/2018

6.830 Lecture 11. Recap 10/15/2018 6.830 Lecture 11 Recap 10/15/2018 Celebration of Knowledge 1.5h No phones, No laptops Bring your Student-ID The 5 things allowed on your desk Calculator allowed 4 pages (2 pages double sided) of your liking

More information

Properties of Context-Free Languages

Properties of Context-Free Languages Properties of Context-Free Languages Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr

More information

Data Structures and Algorithms CMPSC 465

Data Structures and Algorithms CMPSC 465 ata Structures and Algorithms MPS LTUR ellman-ford Shortest Paths Algorithm etecting Negative ost ycles Adam Smith // A. Smith; based on slides by K. Wayne,. Leiserson,. emaine L. Negative Weight dges

More information

Local Search and Optimization

Local Search and Optimization Local Search and Optimization Outline Local search techniques and optimization Hill-climbing Gradient methods Simulated annealing Genetic algorithms Issues with local search Local search and optimization

More information

Faraday s Law. Including electrochemical reactions in stoichiometry

Faraday s Law. Including electrochemical reactions in stoichiometry Faraday s Law Including electrochemical reactions in stoichiometry copyright by James B. Condon (2013) all rights reserved Some of the graphics are supplied by Corel Corporation with their permission.

More information

Alpha-Beta Pruning: Algorithm and Analysis

Alpha-Beta Pruning: Algorithm and Analysis Alpha-Beta Pruning: Algorithm and Analysis Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction Alpha-beta pruning is the standard searching procedure used for 2-person

More information

Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules).

Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules). Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules). 1a) G = ({R, S, T}, {0,1}, P, S) where P is: S R0R R R0R1R R1R0R T T 0T ε (S generates the first 0. R generates

More information

CS 341 Homework 16 Languages that Are and Are Not Context-Free

CS 341 Homework 16 Languages that Are and Are Not Context-Free CS 341 Homework 16 Languages that Are and Are Not Context-Free 1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure

More information

König s Lemma and Kleene Tree

König s Lemma and Kleene Tree König s Lemma and Kleene Tree Andrej Bauer May 3, 2006 Abstract I present a basic result about Cantor space in the context of computability theory: the computable Cantor space is computably non-compact.

More information

Graph Search Howie Choset

Graph Search Howie Choset Graph Search Howie Choset 16-11 Outline Overview of Search Techniques A* Search Graphs Collection of Edges and Nodes (Vertices) A tree Grids Stacks and Queues Stack: First in, Last out (FILO) Queue: First

More information

CpSc 421 Final Exam December 6, 2008

CpSc 421 Final Exam December 6, 2008 CpSc 421 Final Exam December 6, 2008 Do any five of problems 1-10. If you attempt more than five of problems 1-10, please indicate which ones you want graded otherwise, I ll make an arbitrary choice. Graded

More information

Chapter 4 Beyond Classical Search 4.1 Local search algorithms and optimization problems

Chapter 4 Beyond Classical Search 4.1 Local search algorithms and optimization problems Chapter 4 Beyond Classical Search 4.1 Local search algorithms and optimization problems CS4811 - Artificial Intelligence Nilufer Onder Department of Computer Science Michigan Technological University Outline

More information

Parsing. Unger s Parser. Laura Kallmeyer. Winter 2016/17. Heinrich-Heine-Universität Düsseldorf 1 / 21

Parsing. Unger s Parser. Laura Kallmeyer. Winter 2016/17. Heinrich-Heine-Universität Düsseldorf 1 / 21 Parsing Unger s Parser Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Winter 2016/17 1 / 21 Table of contents 1 Introduction 2 The Parser 3 An Example 4 Optimizations 5 Conclusion 2 / 21 Introduction

More information

Strength; Weakest Preconditions

Strength; Weakest Preconditions 12/14: solved Strength; Weakest Preconditions CS 536: Science of Programming, Spring 2018 A. Why To combine correctness triples, we need to weaken and strengthen conditions. A weakest precondition is the

More information

Fun with Recursion and Tree Drawings

Fun with Recursion and Tree Drawings Fun with Recursion and Tree Drawings Timothy Chan U. of Illinois I like recurrences! From Klee s measure problem made easy [C. 12]: T (n) = 2 T n 2 2/3 + O(n) T (n) = O(n 3/2 ) From Transdichotomous results

More information

An Efficient Implementation of a Quasi-Polynomial Algorithm for Generating Hypergraph Transversals and its Application in Joint Generation

An Efficient Implementation of a Quasi-Polynomial Algorithm for Generating Hypergraph Transversals and its Application in Joint Generation An Efficient Implementation of a Quasi-Polynomial Algorithm for Generating Hypergraph Transversals and its Application in Joint Generation E. Boros K. Elbassioni V. Gurvich L. Khachiyan Abstract Given

More information

Multiset-Algebraic Cryptanalysis of Reduced Kuznyechik, Khazad, and secret SPNs

Multiset-Algebraic Cryptanalysis of Reduced Kuznyechik, Khazad, and secret SPNs Multiset-Algebraic Cryptanalysis of Reduced Kuznyechik, Khazad, and secret SPNs Alex Biryukov 1,2, Dmitry Khovratovich 2, Léo Perrin 2 1 CSC, University of Luxembourg 2 SnT, University of Luxembourg https://www.cryptolux.org

More information

Modeling and solving the Euclidean Steiner Problem

Modeling and solving the Euclidean Steiner Problem Modeling and solving the Euclidean Steiner Problem Marcia Fampa Work done in collaboration with: Kurt Anstreicher, Claudia D'Ambrosio, Jon Lee, Nelson Maculan, Wendel Melo, Stefan Vigerske DIMACS Workshop

More information

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)}

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} Graph Theory Graph G = (V, E). V ={vertices}, E={edges}. a b c h k d g f e V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} E =16. Digraph D = (V, A). V ={vertices}, E={edges}.

More information

On the Effectiveness of Symmetry Breaking

On the Effectiveness of Symmetry Breaking On the Effectiveness of Symmetry Breaking Russell Miller 1, Reed Solomon 2, and Rebecca M Steiner 3 1 Queens College and the Graduate Center of the City University of New York Flushing NY 11367 2 University

More information

Asymptotic Running Time of Algorithms

Asymptotic Running Time of Algorithms Asymptotic Complexity: leading term analysis Asymptotic Running Time of Algorithms Comparing searching and sorting algorithms so far: Count worst-case of comparisons as function of array size. Drop lower-order

More information

CS415 Compilers Syntax Analysis Top-down Parsing

CS415 Compilers Syntax Analysis Top-down Parsing CS415 Compilers Syntax Analysis Top-down Parsing These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University Announcements Midterm on Thursday, March 13

More information

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Deterministic Finite Automata 1 Pop quiz What is

More information

MA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments

MA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping Theorem Your Questions? Previous class days' material

More information

Theory of Computation - Module 3

Theory of Computation - Module 3 Theory of Computation - Module 3 Syllabus Context Free Grammar Simplification of CFG- Normal forms-chomsky Normal form and Greibach Normal formpumping lemma for Context free languages- Applications of

More information

1.2 MATHEMATICAL INDUCTION. Peano s Postulates and Induction. 10 Chapter 1 The Real Numbers

1.2 MATHEMATICAL INDUCTION. Peano s Postulates and Induction. 10 Chapter 1 The Real Numbers 10 Chapter 1 The Real Numbers 1. MATHEMATICAL INDUCTION If a flight of stairs is designed so that falling off any step inevitably leads to falling off the next, then falling off the first step is a sure

More information

Notes for Comp 497 (Comp 454) Week 10 4/5/05

Notes for Comp 497 (Comp 454) Week 10 4/5/05 Notes for Comp 497 (Comp 454) Week 10 4/5/05 Today look at the last two chapters in Part II. Cohen presents some results concerning context-free languages (CFL) and regular languages (RL) also some decidability

More information

Notes on the Bourgain-Katz-Tao theorem

Notes on the Bourgain-Katz-Tao theorem Notes on the Bourgain-Katz-Tao theorem February 28, 2011 1 Introduction NOTE: these notes are taken (and expanded) from two different notes of Ben Green on sum-product inequalities. The basic Bourgain-Katz-Tao

More information

Chapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009

Chapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009 Chapter 1 Formal and View Lecture on the 28th April 2009 Formal of PA Faculty of Information Technology Brno University of Technology 1.1 Aim of the Lecture 1 Define pushdown automaton in a formal way

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic and Theory of Computing Fuhua (Frank) Cheng Department of Computer Science University of Kentucky 1 Table of Contents: Week 1: Preliminaries (set algebra, relations, functions) (read Chapters

More information

Problem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y.

Problem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y. CSE2001, Fall 2006 1 Problem Session 5 (CFGs) Talk about the building blocks of CFGs: S 0S 1S ε - everything. S 0S0 1S1 A - waw R. S 0S0 0S1 1S0 1S1 A - xay, where x = y. S 00S1 A - xay, where x = 2 y.

More information

Country Romania Romania Romania Romania Romania Romania Romania Romania IIRUC SERVICE IIRUC SERVICE

Country Romania Romania Romania Romania Romania Romania Romania Romania IIRUC SERVICE IIRUC SERVICE Country Romania Romania Romania Romania Romania Romania Romania Romania DASP name Genesys Systems Address (incl. post code) and Company Name 8 th Dimitrie Pompei Blvd., 2 nd District, Bucharest, POST E

More information

FUNDAMENTELE PROGRAMĂRII

FUNDAMENTELE PROGRAMĂRII UNIVESITATEA BABEŞ-BOLYAI d M ş If UNDAMENTELE OGAMĂII L Dş Nb, 2017 2 gg h g Id î d dz fw g d g d T df d z d dz f T ș g gg h g Ag d Ag d Md d z b Nb, 2017 3 S d bz M E Aj ș dzj D? E Az f g Nb, 2017 4

More information

Optimization (168) Lecture 7-8-9

Optimization (168) Lecture 7-8-9 Optimization (168) Lecture 7-8-9 Jesús De Loera UC Davis, Mathematics Wednesday, April 2, 2012 1 DEGENERACY IN THE SIMPLEX METHOD 2 DEGENERACY z =2x 1 x 2 + 8x 3 x 4 =1 2x 3 x 5 =3 2x 1 + 4x 2 6x 3 x 6

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES JUNE 2014

AC68 FINITE AUTOMATA & FORMULA LANGUAGES JUNE 2014 Q.2 a. Show by using Mathematical Induction that n i= 1 i 2 n = ( n + 1) ( 2 n + 1) 6 b. Define language. Let = {0; 1} denote an alphabet. Enumerate five elements of the following languages: (i) Even binary

More information

Dynamic Programming. Reading: CLRS Chapter 15 & Section CSE 6331: Algorithms Steve Lai

Dynamic Programming. Reading: CLRS Chapter 15 & Section CSE 6331: Algorithms Steve Lai Dynamic Programming Reading: CLRS Chapter 5 & Section 25.2 CSE 633: Algorithms Steve Lai Optimization Problems Problems that can be solved by dynamic programming are typically optimization problems. Optimization

More information

THE SHIFT SPACE FOR AN INFINITE ITERATED FUNCTION SYSTEM

THE SHIFT SPACE FOR AN INFINITE ITERATED FUNCTION SYSTEM THE SHIFT SPACE FOR AN INFINITE ITERATED FUNCTION SYSTEM ALEXANDRU MIHAIL and RADU MICULESCU The aim of the paper is to define the shift space for an infinite iterated function systems (IIFS) and to describe

More information

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}.

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. 1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. (a) 0(010) 1 (b) (21 10) 0012 Examples: 001, 001222, 21001, 10001, 210012,

More information

NAME... Soc. Sec. #... Remote Location... (if on campus write campus) FINAL EXAM EE568 KUMAR. Sp ' 00

NAME... Soc. Sec. #... Remote Location... (if on campus write campus) FINAL EXAM EE568 KUMAR. Sp ' 00 NAME... Soc. Sec. #... Remote Location... (if on campus write campus) FINAL EXAM EE568 KUMAR Sp ' 00 May 3 OPEN BOOK exam (students are permitted to bring in textbooks, handwritten notes, lecture notes

More information

Algorithm Analysis Divide and Conquer. Chung-Ang University, Jaesung Lee

Algorithm Analysis Divide and Conquer. Chung-Ang University, Jaesung Lee Algorithm Analysis Divide and Conquer Chung-Ang University, Jaesung Lee Introduction 2 Divide and Conquer Paradigm 3 Advantages of Divide and Conquer Solving Difficult Problems Algorithm Efficiency Parallelism

More information

A fast algorithm for the Kolakoski sequence

A fast algorithm for the Kolakoski sequence A fast algorithm for the Kolakoski sequence Richard P. Brent Australian National University and University of Newcastle 13 December 2016 (updated 30 Dec. 2016) Joint work with Judy-anne Osborn The Kolakoski

More information