### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Artificial Intelligence CS 4710

UVA

GPA 3.71

### View Full Document

## 25

## 0

## Popular in Course

## Popular in ComputerScienence

This 150 page Class Notes was uploaded by Mrs. Carolyne Abbott on Monday September 21, 2015. The Class Notes belongs to CS 4710 at University of Virginia taught by Worthy Martin in Fall. Since its upload, it has received 25 views. For similar materials see /class/209685/cs-4710-university-of-virginia in ComputerScienence at University of Virginia.

## Reviews for Artificial Intelligence

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/21/15

CS 41 6 Artificial Intelligence Lecture 21 Making Complex Decisions Chapter 17 Markov decision processes MDP Initial State 5D Tran5ition Model e Ts as Mavkuv almiv nele 7 s ibie S 32 R eWai d Function RS Fuveacnstale Building an optimal policy Value Iteration 7 Calculate tne utility of eacn State 7 Use tne State utilities to Select an optimal action in eacn State 7 Your poiicv is sirnpie 7 go to the state With the best utiiitv 7 Your state utiiities rnust be accurate Through an iterative process vou assign correct vaiuesto the state utiiitv vaiues Iterative solution of Bellman 7 Start With arbitrarv initiai vaiues ror state utiiities 7 Update the utiiitv or each state as a runction orits ign iiieiii wornzii uii iui in ii iiiii ii iisi ii ii iiiiiii iiiiiiii iiii iii iii I iii ii 7 Repeat this process until an equiiibriurn is reached Example Lety 1 and Rs 004 Notice eutiiities higher nearg 3 1 reriecting rewereo 04 ps in surn Building a policy Hovv might We acquire and store a solution 7 e is this a search problem isni evElvlninm e Avoid lucal rnins e Avoid dead ends e Avoid needless lepetitiun iltev observation if the number orstates is small consider evaluating states rather than evaluating action sequences Page 1 Policy Iteration Policy Iteration lmagine someone gave you a policy Checking a policy 7 How go ls W7 e Jus f r klo 5 let s compute a urne we knuvvy and R 3 utlilty at tnls partlcuiar lteratlon t oftne policy l oreacn state Eyeball lt7 Trya rewpatns and see nbwlt vvurks7 l Let s be more preelse aooordlng to Bellman s equatlon HM lv l39 illumhl turgid Policy iteration Checking a policy Elutvve don t ow Uls l lnll39lril 7ND a rublem n aellrn n eduailbns n unknbwns equations are lineal in value iteratiun the equatinnshadthe nunrlinear WaXWEW ean solve tortne n unknowns n3 tlrne using standard ar algebra rnetnb gm ln ilne Policy iteration Checking a policy lilti 39 l ll 39 Iv llal n39il is i e owweknowulstoraiis rForeacns co mm X I l n s l M lf nls aetlbn ls different from pulicy update tne pulicy Policy Iteration Olten the most ef cient approach 7 Requires srnaii sta eApproklrnatlons Spaces to be tractable 0 n3 sslble Rathertnan solve for U exactly approximate wltn a speedy lteratlve teennldue Explore spaee update tne pulicy or only a subset uftutal state 7 Don t beinel updailne Pans you inlnk are bad Can MDPs be used in real situations Remember our assumptions 7 e know wnat state we are ill 5 evye know tne reward at s evye know tne available actlo l a 7We know tne transltlon functionl ils a 539 Page 2 ls life fully observable We don t always know what state we are in 7 Frequently the environrnent l5 partially observable agent cannot look up a iuri1rs agenteannotealeulate utilities We Carl build a model ofthe State uncertaintyal39ld We call them Our robot problem as a POMDP No knowledge of state 7 Robot has no idea of What state it l5 in i rWhat s a good policv7 The Drunken Hooquot stra egy Partlally observable MDPs POMDPs Observation Model Belief state To help model uncertainty To help model uncertainty rObseNatlol l Model 05 0 rAbellef stat b speeitiestne probability ot perceiving the observa ion o the probability distribution over being in eaen state 75 When in state 5 rlnnlalb1 1 1 1 1 1 1 1 1 UU e lri uurexample 00 returns riolniriownn prob 1 bsvvlll be updated vvlth eaen nevvobservation aetion u oriorrnalizeseouatiori so osurnstol n iiisi ivri Z Insight about POMDPs Belie are more important than reality 7 Optirnal action Will depend on agent s belief state nut its actual state 1rbrnaps beliet state to actions rThll lk about The Matrix PO M DP agent A POMDP agent iterates through following steps 7 Given current belief state b execute the action a zap e Recelve tne observation 0 7 Use a and oto update tne belietstate rRepeat Page 3 Mapping MDPs to POMDPs What is the probability an agent transitions 39om one beliefstate to another alter action a We would have to execute tne action to obtain tne new observation irwe were to use tnis equation muhmuzh mm 7 instead use conditional probabilities to s construct o by umming over aii states agent mignt reacn Predicting future observation Prob of perceiving 0 given a starting in oeiierstate n 7 action a was executed e s39 is tne set or potentially reacneo states min i ZI liiiii iiii iu iii eri39nJi39iiii Zuis uiiTimm vitxi Predicting new belief state Previously we predicted observation Now predict new beliefstate e o a o39 prob orreacning o39 from o giten action a minii iitii39uJii Zriiinm iiiPiniiiii Zruxin i bizuiu vi Ii iiwiiiiu This is a transition model for beliefstates Computing rewards for belief states We saw that Rs was required rHow aboutPb7 call it ato l U39 Z quotWM l Puing it together We ve de ned an observable MDP to model this POMDP e no a o39 and pay repiace is a 5 and R s rThe optimal policy 1WD is aiso an optimal policy ror tne onginai POMDP An important distinction The state is continuous in this representation e cell is an obstacle as between 0 and The state in Bur elder pmblems was a discrete cell D 7We cannot reuse tne exactvaluepolicv iteration aigontnms Summing ever states is now impussible There are ways to make tnem Wurk tnougn Page 4 CS 41 6 Artificial Intelligence Lecture 9 Adversarial Search Chapter 6 Games Shall we play a gamequot 6 Let s play tictactoe Minimax What data do we need to play initiai State 7 How duestne game start Successor Function 7 A list or iegai muvei state pairsfur eacn state Tenninal Test 7 Determineswnen game is river 39Utility Function 7 F39ruyides numericvalue furall terminal states Minimax Strategy Optimal Stragtegy r Leads to outcomes at least as good as any Otnei39 strategy wnen playing an infallible opponent 7 Pick tne option tnat most max minimizes tne damage youropponen can do maximize tne Wurstecase outcome because yuur sxiiirui uppunentvvill certainiyring tne must damaging move Minimax Algorithm 7 Minimaxyaiuem Utili n itnisatemiinalslale max Minimaxyaiues WSW 5 itnisaMAXnade min Minimaxyalues BMW 5 iimsenin Wee Page 1 Minimax Minimax Algorithm We wish to identify minimax decision at the root 7 Recursive evaluation of all l lO deS ll l game tree rTime co Feasibility of minimax Pruning minimax tree How about a nice game of chess M Are there times when you know you need not rAyg branching 35 and avg it moves 50 foreach explore a particular e player rWherithe rnoyeispooi 0651 time curnplexity in154 nude 7 p00 compared 0 We 7 low eisihci homes 7 Poor compared to What you have explored so far Minimax is impractical if directly applied to chess Alphabeta pruning Alphabeta pruning on the value or the best highest huice so far in Search or MAX rder of COl iSl dei lde the value Elf the best luWEs t EhuiEE SD far in Search Elf MW e o tih previous Si ll ig successors matters look at step f possible cunsider best successorshrst Page 2 Realtime decisions What ifyou don t have enough time to explore entire search tree 7 e ot search all the Way down to terrninai state for all decision sequences 7 e a heunsticto approximate guess eventual terrninai state Evaluation Function The heuristic that estimates expected utility 7 Cannot take too long otherWise recurse to get answer 7 it should preserve the ordering among terrninai states otherwise it can cause bad decision rnahng 7 De ne features ofgame state that assist in evalua ion What are features of chess Truncating minimax search When do you recurse or use evaluation Jnction e Cutofchest state depth returns 1 or 0 Whe is returned use evaluation runctien e Cutoffbeyond a certain depth 7 Cutorrirstate is stable rnore predictaoie e Cutoffrnoves you know are bad rorward pruning Benefits of truncation Comparing Chess ply rAverage Human 6c8 ply rUsii ig alphacbe a iOply e inteiiigent pruning i4 ply Games with chance How to include chance in game tree 7 Add chance nodes Expectiminimax Expectiminimax n e utilityU i i n is a terrninai state m in mi mgwmtalmmu ifi i is a chance node Page 3 Pruning History of Games Can we prune search in games of chance Chess Deep Blue Think about alphabeta pruning IBM 30 RS6000 comps with 480 custom VLSI don t explore nodes that you know are worse than what chess chips Y have Deep Thought design came from Campbell and Hsu we don t know what we have at CMU 7 chance node values are average of successors 126 mil nodess 30 bil positions per move routine reaching depth of 14 iterative deepening alphabeta search Deep Blue Checkers evaluation function had 8000 features Arthur Samuel of IBM 1952 4000 opening moves in memory program learned by playing against itself 700000 grandmaster games from WniCn beat a human in 1962 but human clearly made recommendations extracted error many endgames solved for all ve piece combos 19 KB of memory 0000001 Ghz processor Chinook Jonathan Schaeffer 1990 Othello Alphabeta search on regular PCs Smaller search space 5 to 15 legal moves database of all 444 billion endgame positions with 8 Humans are no match for computers pieces Played against Marion Tinsley world champion for over 40 years lost only 3 games in 40 years Chinook won two games but lost match Rematch with Tinsley was incomplete for health reasons Chinook became world champion Page 4 CS 416 Artificial Intelligence Lecture 24 Statistical Learning Chapter 20 Al Creating rational agents The pursuit ofautonomous rational agents It s all about search Varying amounts of model information 7 tree searching informeduninformed Simulated annealing e valuepolicylteratlon Searching for an explanation of observations 7 Used to develop a model Searching for explanation of observations f can explain observations can I predict the future Can I explain why ten coin tosses are 6 H and 4 T Cari lpredictthe 11m coin toss Running example Candy Surprise Candy Comes in two avors cherry yum A candy is wrapped in same opaque wrapper Candy is packaged in large bags containing five different allocations of cherry and Ii Statistics Given a bag of candy what distribution of flavors will it have Let H be the random variable corresponding to your hypothesis H all chenv H2 all llrne H3 5050 chenv li e As you open pieces of candy let each observation of data D1 D2 D3 be eit er cherry or lime D chenv D2 chenv D3 llrne Predict the avor ofthe next piece of can 39 lf l1 t e data caused vou to believe H was correct you d pick chenv Bayesian Learning Use available data to calculate the probability of each hypothesis and make a prediction Because each h sis has an independent likelihood we use all their relative likelihoods when making a prediction Probabilistic inference using Bayes rule 39 Pbil d otPdl bi PW hypothesis likelihood prl The probablllty of of hvpothesis h being active given vou ooseived hvpothesis h multiplied ov the likelihood of hvpothesis i being active Page 1 Prediction of an unknown quantity X Details of Bayes rule mxldi Z I ledJiill llnld 2 PL eTne likelihood ofgtlt nappening given d has already dis a function ofhow much each Hypothesls predicts x can happen given d has JPll39ildi Pllnldl nPIliPi rAll observations Within d are inde en identically distributed rThe probability of a HypotHeSlS explaining a series of happened observations d Even thuugh a hyputhesls has a nign prEdl lEIn hatgtlt Will is the mum Bf expiammg each mmmem happen inis predl lun Wille discuunted lf the hyputhesls itself l u nlikely m be true given the ubservatiun er d l ldilil H I irlilliii Example Example Prior distribution across hypotheses h1 um eneny u Probabilities for each hypothesis starts at prior value lt 4 2 1gt 1 2 I 2354 233123 Plluld wanimam h 5 mew mew Probability ofh3 hypothesis n5 EIEI nlirnEE1 as 10 lime candies are quot quot Prediction observed mi 7 Pidimlt051 mini iiiW Pidlm Pins lt05 lt04 Prediction of 11m candy Overfitting Remember over tting from NN discussion lfwe ve observed 10 lime candies is 11 h lime 7 Build weignted sum ofeach nypotneSis s prediction i Pledl Z rideJnll39inld Z l lX iPildl n hyrmlhvss in quot in quot quot ii quot We ghted Sum can become expenwe to compute Ine number or nypolneses Innuences predictions lnstead use must prubable hyputhesis and lgnure uthers T00 MW hypotheses can lead to overfitting MAP maximum 5 posienon Page 2 CS 416 Artificial Intelligence Lecture 13 FirstOrder Logic Chapter 8 Question about Final Exam I will have a date for you by Tuesday of next week Firstorder logic We saw how propositional logic can create intelligent behavior But propositional logic is a poor representation for complex environments First order logic is a more expressive and powerful representation What do we like about propositional logic It is Declarative Rela ionships between variables are described A method for propagating relationships Expressive Can represent partial information using disjunction Compositional lfA means foo and B means bar A A B means foo and bar What don t we like about propositional logic Lacks expressive power to describe the environment concisely Separate rules for every squaresquare relationship in Wumpus wortd Natural Language Engish appears to be expressive Squares adjacent to pits are breezy But natural language is a medium of communication not a knowledge representation Much ofthe information and logic conveyed by language is dependent on context Information exchange is not well de ned Not compositional combining sentences may mean something different It is ambiguous But we borrow representatlonal Ideas from natural language Natural language syntax Nouns and noun phrases refer to objects People houses cars Verbs and verb phrases refer to relationships btw objects Red round nearby eaten Some relationships are cl only one output for a give Bestrriendrirsttningplus We build rst order logic around objects and relations early de ned functions where there is rl input Ontology a speci cation of a conceptualization A description of the objects and relationships that an exist Propositional logic had only truefalse relationships Firstorder logic has many more relationships The ontological commitment of languages is different How much can you infer 39om what you know 7 Temporal logic oerines addltlorlal ontological commitments because of timing constraints Higherorder logic Firstorder logic is rst because you relate objects the firstorder entities that actually exist in the world There are 10 chickens chickensnumber10 There are 10 ducks ducksnumber You cannot build relationships between relations or functions 0 There are as many chickens as ducks chickensnumber ducksnumber the number of objects belonging to a gro of he group and not the objects themse Cannot represent Leibniz s law lfx and yshare all properties x is y up must be a property Ives Another characterization of a logic Epistemological commitments The possible states of knowledge permitted with respect to each fact In rstorder logic each sentence is a statement that is e True false or unknown Formal structure of firstorder logic Models of rstorder logic contain A set of objects its domain Allce Allce s left arm Bob Bob s hat Relationships between objects epreserlted as tuples e Slbllrlg Alice Elub Slbllrlg Elub Alice 7 On head Elub at e Persun Elub Persun Alice object in a certain way Alice gt Allce s left aim Firstorder logic syntax Constant Symbols A B Bob Alice Hat Predicate Symbols ls onHead hasColor person Function Symbols Mother le Leg Each predicate and function symbol has an arity A constant the xes the number of arguments Page 2 Firstorder logic syntax Names ofthings are abitrary 7 Knowledge base adds meaning Number of possible domain elements is unbounded 7 Nurnberorrnodeis l5 unbounded Checking Enumeratiun by entaiirnent lS impussible Syntax Term 7A logical expression tnat refers to an obiect Cuns tants 7m could asSlE EVEN slime my Functiun symbuls 7 um in place are curis1arit meul onLeitFuutubnn n namestu all ublEctSi like pinyiuinu a nameibi uur closet Atomic Sentences Forrned by a predicate symbol followed by parenthesized list of terms 7 Sibling Alice Hub 7 Married ratnertAiicer MutnErElub Ari atomic sentence l5 true in a giyen rnodel under a giyen interpretation irtne relation rererred o by tne pre icate symbol holds among tne objects rererred to by tne argurnen s Complex sentences We can use logical connectives 7s biingLertLegAiicei Bob rSiblil igAliCe BobA Sibling BobAlice Quantifiers Away to express properties of entire collections of objects 7 Uniyersai quantification all Tne puvver br rirstbruer lugl Furallx angtlt gt Persungtlt Universal Quantification Forallx P 7 P l5 true roreyery obiect x 7 Forall x Ki ggtlt gt Personx Richardtne Linnheart King ubnn Richard sle leg Junn s iertie Tne ErEIWn Page 3 U n ive rsal Q u antificati o n Richard the Lionlrean is a king King Jolm 1S u k King Ex istenti al Qu antificati on Richard me 1 ionheartis upmon Rullunl ele lem Mnu Richard39slc lcg ist person 01 lohn39 left leg is a person Llic crown IS a arson k The noun 13 a kmr s There exist Note that all of these are true There exists an x such that Crownx quot OnHeadx John Implication is true if premise is false It is true for at least one object Using AND instead of implication is overly strong ltuli ml Ilrc l whimii n unum Rh ml Ilrt l willimn n um lulmk lisml kl lnlr kll irixuii h39 l A vlm lrcul hHAl vl mull my ll 4 l quot ll iwri Lih lm By asserting a universally quantified sentence AND A is the appropriate connedive you assert a whole list of indivrdual implications Existential Quantification Nested Quantifiers What if we used implication as the connective Buiding more complex sentences r ti i ll lrilii l ll ll W h 3 WWW krill ml I running l i mm H rlicl l IHNJH h nu lrrllll39x limit 39 mm mg n rlrm Ritlmnl lclil h u A win Ru ILHK lle lc l mu lulrii hm Implication istrue if J both premise and conclusion are true or if premise is false Th i i Huisloved by everyone Richard the Lionheart is not a crovrm rst assertion is true I quotnames and parentheses When and existential is satisfed appropna e Combining Combining Everyone who dislikes parsnips De Morgan s rules apply there does not exist someone who likes parsnips I I I r 39 r 39 ll l 39 I ii i I39 139 ii I u Luw 12er Hullllhlli ullii r loll r rm I y p y l r U39 m l r l r I39 if i 139 m Everyone likes ice cream there is no one who does not like ice cream l lul In39rliliwlurilhn l r r rm rim Page 4 Equality Two terms refer to the same object Father John Henry Richard has at least two brothers An Example A TellAsk interface for a firstorder knowledge base Sentences are added with Tell TelllltB Forallx Klriggtltgt Personx Queries are made with Ask Wm H IJ i mi l Ask KB KingJohn MM w A5lltlltB PersonJ0hn Iliulluii Ilium ill immul i will An Example The Wumpus World Quanti ed queries Ask KB exist x Personx KB should return a list of variableterm pairs that satisfy the query More precise axioms than with propositional logic Percept has ve values Time is important Atypical sentence Percept81ench Breeze Glitter None Nonel 5 rms right Turnleft Forward Shoot Grab Release Compu ing best action with a query Exist a BestActiona 5 02 HI 8 o w 939 3 Turn The Wumpus World After executing query KB responds with variableterm list aGrab Then tell the KB the action taken Raw percept data is easily encoded r mirml it w minim ll Wumpus World of alternative atomic Adjacency between two squares De ning the environment withxy reference instead name l l i mil Mm ml l ill it i in i Location of Wumpus is constant Home Wumpus Location of agent changes At Agent H t 1 ii iwil t in m m 1 CS 416 Arti cial Intelligence Chess Article Deep Blue IBM 418 processors 200 million positions per second Deep Junior Israeli Co 8 processors 3 million posi ions per second Kasparov Lecture 2 100 billion neurons in brain 2 moves per se no Agents But there are 85 billion ways to play the rst four moves Chess Article 1997 Kasparov Lost to Deep Blue 2002 Kramnik tied Deep Junior current World Champion 2003 Kasparov current number 1 plays Deep Junior Jan 26 Feb 7 Chess Article Cognitive psychologists report chess is a game of pattern matching for humans But what patterns do we see What rules do we use to evaluate perceived patterns What is an agent Perception Sensors receive input 39om environment Keyboard Dicks Camera data Bump sensor Action Actuators impact the environment Move a robotic arrn Generate uutputfurcumputerdisplav Perce ptio n Percept Perceptual inputs at an instant May include perception of internal state Percept Sequence Complete history of all prior percepts Do you need a percept sequence to play Chess Page 1 An agent as a function Agent maps percept sequence to action Agent fpsa VFSEF Set of all inputs known as state space Agent Function If inputs are nite a table can store mapping Scalable Reverse Engineering Evaluating agent programs We agree on Wnat an agent must do Can we evaluate its quality Performance Metrics Very Important Frequentlythe hardest part ofthe research problem Design these to suit what you really want to happen Rational Agent For each percept sequence a rational agent should select an action that maximizes its performance measure Example autonomous vacuum cleaner What is the performance measure Penalty for eating the cat How much Penalty for missing a spot Reward for speed Reward for conserving power Learning and Autonomy Learning To update the agent function in light of observed performance ofperceptsequence to action pairs Change internal variables that in uence ac ion selection Adding intelligence to agent function At design time Some agents are designed with clear procedure to improve performance over time Really the engineers intelligence Camerarbased useridentificatiun At ru nti m e Agent executes complicated equation to map input to output Between trials Wth experience agent changes its program parameters How big is your percept Dung Beetle Largely feed forward Sphex Wasp Reacts to environment feedback but not learning A Dog Reacts to environment and can signi cantly alter behavior Qualities of a task environment Qualities of a task environment Fuly Observable Deterministic Agent need not store any aspects of state Always the same outcome for stateaction pair The Brady Bunch as intelligent agents stochastic Volume of observables may be overwhelming Not always predictable random 39Pamally Observable Partially Observable vs Stochastic Some data is unavailable Maze My cats think the world is stochastic Noisy sensors Physicists think the world is deterministic Qualities of a task environment Qualities of a task environment Markovian Static Future state only depends on current state Environment doesn t change over time Episodic Crossword puzzle Percept sequence can be segmented into independent Dynamic temporal categories Environment changes over time Behavior attrafficlight independent ufpreviuus traffic Drivingacar Sequential Semidynamic Current decision could affect all future decisions Environment is static but performance metrics are dynamic Which is easiest to program Drag lama Qualities of a task environment Qualities of a task environment Discrete Towards a terse description of problem domains Values of a state space feature dimension are State space features dimensionality degrees of constrained to distinct values 39om a nite set freedom Blackjack your cards exposed cards action observame Continuous Predictable Variable has in nite variation Antilock brakes fvehicle speed wheel velocity unlock Continuous Are computers really continuous Dynamic Perform ance m etric Page 3 Building Agent Programs The table approach Build atable mapping states to actions Chess has 1015 entries 10BEI atoms in the universe I ve said memory Is 39ee but keep it wi hin the con nes of the boundable universe Still tables have their place Discuss four agent program principles Simple Re ex Agents Sense environment Match sensationswith rules in database Rule prescribes an ac ion Re exes can be bad Don t put your hands down when falling backwards lnaccurate information Misperception can trigger re ex when inappropriate But rules databases can be made large and complex Simple Re ex Agents Randomization The vacuum cleaner problem Modelbased Reflex Agents 80 when you can t see something you model it Create an internal variable to store your expectation of variables you can t observe If I throw a ball to you and it falls short do I know wh Aerodynamics mass my energy levels I do have a model 7 Ball falls shun thruvv harder Modelbased Reflex Agents Admit it you can t see and understand everything Models are very important We all use models to get through our lives Psychologists have many names forthese context sensitive models Agents need models too Goalbased Agents Lacking momenttomoment performance measure Overall goal is known How to get from A to B Current actions have future consequences Search and Planning are used to explore paths through state space from A to B Final Exam Reminder CS 416 rFinaiExamisTuesday May haHprn Amflolal Intelllgence e Let me know ifyou have a iegitirnate con ict Making Complex Decisions Chapter 17 Zerosum games Optimal strategy Payofis in each ceii surn to zero von Neumann 1928 developed optimal mixed orra strategy for twoplayer zer Tvvu piayers Ddd and EVEN what one piayerwms the other ioses r A iun Earn piavev sirnuttaneuusN iSP WS une uvtwu Myers 7 Evaiuatiun just keep track gr eme piayer s payurr m earn eeii Eyen assume this piayervvisnes tn rnaxirn er 7 Maxtmm tech vengivestdaiiarsgataodd even oee givest daiiars em Even the tutai numbevut ng s nique e m we rnake game a turnrtaking game and anaiyze Maximin Maximin Change the rules ofMorra for analysis 7 Force Eyen to reyeai strategy rst Change the rules ofMorra for analysis 7 Force Odd to reyeai strategy rs Appiy rninirnax aigu it and tnus tne nutcurne uftne game is a 0nd Wm Eyen night get better in reai game 7 The utii v uttnis garnetu Eve gt 3 r nrn aiwavs seiect onetu mmmze onus iuss 7 Even Wuuid aivaVS ie t netu maximize Evan s gain This gam r u rTne utiiiW um i Page 1 Combining two games Even s combined utility e EVel iFii SLUtility lt Eve siUtility lt OddFil SLUtility a lt Eyen sytiiity lt 2 Considering mixed strategies 7 Mixed strategy select uneiirieeiwtn prub p selecltwu ngers with prob iii 7 if one player reyeais strategy first seenng playervyill always use a pure strategy wanted util y eii a mixed strategy U1p unoirpuu expected util y eii a pure shatEW nzenaxtuwuwi U2 is always ereatertnan ut Modeling as a game tree Because the second player will always use a xed strateg H 7 Still pretending Even gues nrst in iiit ii iii iiini ii iii ri in in ii What is outcome of this game Player0dd nas a encice i e Representtwuchuicesasiunctiunsofp e is lmyes1 i e Eyen maximizesutill39v by g p te bEWnEVE iines s Pretend Odd must go first iiir n Even s outcome decided by in i pure strategy dependent on q 7 Eyen will always pick maximum of two encices 7 Odd will minimize tne rnawrnurn o i two encices ogg eneeses interseetien puirit 5a u g 7iZ egt Emmat2 Final results Both players use same mixed strategy pm 712 am My Outeurne ufthe garne lSrllz to Even Page 2 Generalization Two players with n action choices mixed strategy is not as simple as p 1p 03192 ipiii pi 9 DM Solving for optimal p vector requires nding optimal point in n 1dimensional space lines become nyperplanes some nyperplanes will be clearly worse ror all p rind intersection among remaining nyperplanes linear programming can solyetnis problem Repeated games Imagine same game played multiple times payoffs accumulate for each player optimal strategy is a function of game history must select optimal action roreacn possible game nistory Strategies perpetual punisnment 7 cross me once and Hi take us botn down roreyer tit for ta russ me once and Hi cross you tne subsequentmuve The design of games Let s invert the strategy selection process to design faireffective games edy ofthe commons indiyidual rarmers bringtneir liyestocllt to tnetown commons to graze commons is destroyed and all experlence negatiye utility someone else would eat lt e Externalltles are a way to place a yalue on cnanges in global utility 7 Power utilities pay rortne utility tney depriye neignboring communities yet notner Nobel prize in Econ rortnis e Cuase Auctions English Auction auctioneer incrementally raises bid price until one bidder remains 7 bidder gets tne item at tne ni nest price or anotner bidder plustne increment pernaps tne nignest bidder would naye spent more strategy is simple keep bidding until price is nignertnan utility strategy or otner bidders is irreleyant Auctions Seaed bid auction place your bid in an envelope and highest bid is selected 7 say your nignest bid isy say you belieye tne nignest competing bid is b 7 bid min y b c 7 player witn nignestyalue on good may not win tne good and players must contemplate otner player s yalues Auctions Vickery Auction V nner pays the price ofthe next highest bid Dominant strategy is to bid what item is worth to you Page 3 CS 416 Artificial Intelligence Lecture 25 Hidden Markov Models Chapter 15 Hidden Markov Models An attempt to understand Markov Processes r We knowthe state of tne system at an instant state U in in at times U Lz tJi 7 transitions to new states are only dependent on tne current state Use a matrixMu representtransitiuns r tne transitions between states are well understood all elements air are gtaj and lti parameters are time independent Transition model A matrix called A aij P system in state system was in state i Transition Model Weather Transition Matrix What if states aren t observable bik Probability k is observed system in state Use seaweed as an indicator ofweather 39 seaweed is dry dryish darnp soggy new matrleS 06 02 L15 0 5 B 025 025 025 025 005 01 035 05 What s the hidden part There is a disconnect between the states you ve created and the true states you are modeling The state of seaweed may or may not be well correlated to tomorrow s weather lfit works it works Page 1 CS 416 Artificial Intelligence Lecture 13 FirstOrder Logic Chapter 8 Guest Speaker Topics in Optimal Control Minimax Control and Game Theory Marc 8 2 pm OLS 00 Onesimo HernandezLe a Department of Mathematics 39CINVESTAVIPN Mexico City This is a nontechnical introduction mainlythru examples to some minimax control aka quotworstcase controlquot or quotgames against naturequot p a wiiuuiieu cooperative and noncooperative game equilibria etc Ii Firstorder logic We saw how propositional logic can create intelligent behavior But propositional logic is a poor representation for mplex environments Firstorder logic is a more expressive and powerful representation Diagnostic Rules Rules leading from observed effects to hidden causes Atteryou ve observed something this rule offers an explanation These rules explain what happened in the past Breezy implies pltS i in i l39l Not breezy implies no pltS m i i Combining Causal Rules Some hidden property causes percepts to be generated These are predictions of perceptions you expect to have in the future given current conditions A pit causes adjacent squares to be breezy l39ni Lilmi iiii mi ii lfall squares adjacent to a square a pitless it will not be breezy i iniiii mi i The causal rules formulate a model Knowledge of how the environment operates Model can be very useful and important and replace straightforward diagnostic approaches Causal Rules Page 1 Conclusion lfthe axioms correctly and completely describe the way the world works and the way percepts are produced then any complete logical inference procedure will infer the strongest possible description of the world state given the available perce ts The agent designer can focus on getting the knowledge right without worrying about the processes of deduction Discussion of models Let s think about how we use models every day Daily stock prices Seasonal stock prices Seasonal temperatures Annual temperatures Knowledge Engineering Understand a particular domain How does stock trading work Learn what concepts are important in the domain features Buyer con dence strength ofthe dollar company earnings interest rate Create a formal representation of the objects and relations in the domain Forall stocks price low quot con dence high gt pro tability high Identify the task What is the range of inputs and outputs V ll the stock trading system have to answer questions about the weather Perhaps ifyou re buying wheat Jtures Must the agent store daily temperatures or can it use another agent Assemble the relevant knowledge You know what information is relevant How can you accumulate the information Not formal description of knowledge at this point Just principled understanding ofwhere information resides Formalize the knowledge Decide on vocabulary of predicates functions and constants Beginning to map domain into a programmatic structure You re selecting an ontology A particular theory ofhow the domain can be simpli ed and represented at its basic elements Mistakes here cause big problems Page 2 Encode general knowledge Vrite down axioms for all vocabulary terms De ne the meaning ofterms Errors will be discovered and knowledge assembly and formalization steps repeated Map to this particular instance Encode a description of the specific problem instance Should be an easy step Vrite simple atomic sentences Derived from sensorspercepts Derived from external data Use the knowledge base Pose queries and get answers Use inference procedure Derive new facts Debug the knowledge base There will most likely be bugs lf inference engine works bugs will be in knowledge base Missing axioms Axioms that are too weak Con icting axioms Enough talk let s get to the meat Chapter9 Inference in FirstOrder Logic We want to use inference to answer any answerable question stated in rstorder logic Propositional Inference We already know how to perform inference in propositional logic Transform rstorder logic to propositional logic Firstorder logic makes powerful use of variables Universal quanti cation for all x Existential quanti cation there exists an x Page 3 Converting universal quantifiers Universal lnstantiation Examp e li39iinii rl ii inniii l l s 39iiill l l r substitution xJohn XRlchal d xFathenJohn becornes lrlillJiltiil r39 Frilltil iirill A lflrll 7iitil iiirniirn llilnl lr iullirliiliiiitll Lllln rillilrll ri39nniiraiilnii rrrlinii v luililrilliiqutilill rniirnilnri ruin We ve replaced the variable Witn all possible ground terrns tenns Wlthoutvanables Converting existential quantifiers 39EXlStel ltlal lnstantiation Example I lnir rll l UriHnnl i tini i 7 There is sorne thing that is a Crown and e Let seall it C1 rnes is on John s head r39iuttnrc39ii n nirHi viim Julr1 You can replace the variable Witn a constant syrnbol tnat does not appearelsevvhel39e in the knowledge b The constant syrnbol is a Skolern constant Existential lnstantiation Only perform substitution once etnere eXlStS an x st lltill xi victirn Someone kllled the viot Maybe rnore than Existential quantiri 7 Replacement is Klll Murderer Vl lm irn onee person kllled the vie irn er says at least one person was lltlller Complete reduction 7 Convert existentially quantitieo sentences Creates une lnstantiatan 7 Convert unlversally quantitieo sentences Creates all possible instantiations Every rstorder knowledge base and query can be propositionalized in such a way that entailment is preserved Trouble ahead Unlvel sal quantlflcatlon Wlth iLlnCtlonS It39nnii rnniir zlrrrttyl rolnil 7 If li lnlrni li39iniiimlniplir zliniliiiritlninli riili39irrinili Ii39irniiFnllnil allllHl ti unltill39nilitiiltlnlr es ljiii39ilfnllnri lnlin WhataboutFatherFatherFatherJohn7 isn t it possible to have innnite number or subs ltutluns7 7 How Well vvlll the propositional algorithms Wurkvvlth innnite n rnber Elf sentences A theorem of completeness lf e a sentence is entaileo by the original firstrurder knowledge base then e tnere is a proof involving lust a finite subset of he propositional knowledge base We Want to flnd that nlte subset 7 First try proving the sentence vvitn constant syrnbols 7 Then add all terms of depthl Father Rleha 7 Then add all terrns or oeptn 2 Father Father RiehardD Page 4 Still more trouble Completeness says that ifstatement is true in rstorder logic it will also be true in propositions 7 But wnat nappens lr you ye oeen waltlng for you proposltlol lrbased algontnrn to return an answer and lt nas been a WHlle ls the statement nut true s tne staternentlust requlnng lots or substltutluns You don t know 7 You can Wn sentence bu yes y t y ucan ls notent r Alan Turlng and Alonzo cnurcn proyeo The Halting Problem te an algurltnmtnat says yesto eyery entalled t 7 You no algurltnrn exlststnat says no to eyery nunentalled sentence So lryour enlallrnerllrcnecklrlg algontnrn Hasn t returne not know lflnal s oecause tne sentence El ltallrnel lt forflrstrol39del39 loglc l5 Semlrdecldable Adapting Modus Ponens Did you notice how inef cient previous method was r lnstantlate unlyersal quantlners by perrorrnlng lots or suostltutlons untll noperully qulckly a proofwas round vvnyootnersuostltutlng r M r H Rlcnardfor wne quotquot l know lt Won t lea o of 7 Clearly John l5 the ght Substltutlol l f0rgtlt Modus Ponens for propositional logic n d d l Generalized Modus Ponens atornlc sentences p pi e Wnere tnere ls a suostltutlon e sucn tnat Subsllq p Subsllq pl n An 39lln Tl 1 mo 7 ql I rumor rum nun l tummy ltmllmnnltrml rlrlrn pl Ann ll r slnnlnrn lru n mm Winm llllllll Wmm lull no Ixrllll n39hnlmnlnmr rm tnmlnrn Generalized Modus Ponens This is a li ed version 7 ll ralSeS Modus Porlel39ls to rstrol del loglc 7We Want to nno lllteo yers backward Chall lll lg and reso utlon lons orrorwaro Chall lll lg algontnrns Ll ed yersrens make unlytnuse substltutluns requlred to alluvvpanlcular rnrereneeste pree tnat are eed Page 5 Unification good substitutio 7 Logical expressions rnust looK identical 7 Otheriifted inference rules require this as well Generalized Modus Ponens requires nding ns Uni cation is the process of nding substitutions Unification Unify takes two sentences and returns a uni er i one exists lJNirvtpiHiinoic H1il Slll15Tl 39m Examples to answer the query Knows John x rWhorn does John Know twiititi iiioiii iiiii ii i39iiiiiii iiiii he ii iiiiiii Hiiiiiiiiimi iiiii ir iiiiiiiiiii niiiii ii Ni ii Iiiiiii i39uirrritiiiiiiuiriiiii ii Ii39riiiisiir iiiiiiiriiir 7 iii iriiiitiiiiiiiiiiii iiiiiiiii t39xiiiviiiiiio Vi iiiiii ii ii iiiriisir Ili iiiiiuii iii Unification Consider the last sentence umm It ririirriJiriiiiuri It39iirruisir Eiiiiiir Hi i fiiil r This raiis because x cannot taKe on two yaiu s 7 But Eyeryone Knows Eiizaoeth and it shouid not raii 7 Must standardize apart one ofthe two sentences to eiirninate reuse oryariaoie iixiiiiiiriiiiisiiriiiii ii Iiiiiiiiii i l li iiiiiiiii ii iiiiiiiiii is iiiiiiii Unification Muitipie uniriers are pos o e liNll Yi iiriiuisi liriiii i i ii39irriiritiii i ii ii iiir i i c iiiJuror i mirror i Mir Which is petteri Knows John 2 orKnows John John 7 Second eouid be obtained frumfirstvvith Extra subs 7 First unirier is rnore general than seeond oeeause it piaees rewer rEs triEIiuns on the yaiues or the yariaoies There is a singie rnost generai unirier roreyery uniriaoie pair of expressions Storage and Retrieval Remember Asko and Tell from propositions 7 Replace with Stores and Fe c o store puts a sentences into the KB Fetch returns aii uniriers sueh that query o unifiesvvith sorne sentenee in the KB Ari Example iswren we asK Knows Johni x and returns i39Niiiiiiiiiiiiiniiiii iiiiiirinioiii iniiiiie ii Iiiiiii iixiriiiiiiiiisiiiiiii i riiiiyiwi itiiii i on i iiiiiii tiuiriiiiiiiiiisiiiiiiir iiiiiiiii iiiiiiiiiiiiiieiii ioiiii iiuiiiiiiiiiiiiiiiii i39niiiiiiiiiiiiii iiiiii iiiiiiiiiii Lli iiiiiiiiiie iiii Fetch Simple 7 Store all facts in KB as one long list 7 For each retchqi caii Unity or s for eyery sentence s in list inerrieient oeeause We re perrorrning so rnany uniries Complex 7 Only attempt unrications that haye some chance of succeeding Page 6 CS 416 Artificial Intelligence Lecture3 Uninformed Searches mostly copied from Berkeley Outline Problem Solving Agents Restricted form of general agent Problem Types Fully vs partially observable deterministic vs stochastic Problem Formulation State space initial state successor func ion goal test path cost Example Problems Basic Search Algorithms Problem Solving Agents Restricted form of general agent function SMLEPROBLEMSOLVING mpercept returns an action static seq an action sequence initially empty state some description of the current world state goal a goal initially null problem a problem definition state lt UPDATESTATEstate percept if seq is empty then goal lt FORMULATEGOAL state problem lt FORMULAiEPROBLEMstate goal seq lt SEARCHQDroblem action lt RECOMMENDATION seq state seq lt RMINDERseq state return action Note This is of ine problem solving solu ion with eyes closed Online problem solving involves acting vvi hout complete knowledge Example Romania On holiday in Romania currently in Arad Flight leaves tomorrow from Bucharest Formulate Goal be in Bucharest Formulate Problem states various cities actions drive between citites Find Solution Sequence of cities eg Arad Sibiu Fagaras Bucharest Example Romania Hirsova Problem Types oDeterministic fully observable 9 singlestate problem Agent knows exactly what state it will be in solution is a sequence Nonobservable 9 conformant problem Agent may have no idea where it is solu ion if any is a sequence Nondeterministic andor partially observable Percepts provide new information about current state Solu ion is a tree or policy Often interleave search execution Unknown state space 9 exploration problem online Page 1 Example Vacuum World Singlestate start in 5 Solution Example Vacuum World Singlestate start in 5 Solution Right Suck Conformant start in 12345678 Eg right goes to 2468 Solution Example Vacuum World Singlestate start in 5 SolutionRight Suck Conformant start in 1 2345678 Eg right goes to 2468 Solution Right Suck Left Suck Contingency start in 5 Murphy s Law Suck can dirty a clean carpet Local sensing dirt location only Solution Example Vacuum World Singlestate start in 5 Solution Right Suck Conformant start in 1 2345678 Eg right goes to 2468 Solution Right Suck Left Suck Contingency start in 5 Murphy s Law Suck can dirty a clean carpet Local sensing dirt location only Solution Right if dirtthen Suck Singlestate problem formation A problem is de ned by four items n itial state Eg at Aradquot Successor function Sx set of action state pairs Eg SArad ltArad92erindZerindgt ltArad98ibiuSibiugt Goaltest can be Explicit eg at Bucharestquot Implicit eg NoDirtx Path cost additive Eg a sum of distances number of actions executed etc Cxay is the step cost assumed to be nonnegative Asolution is a sequence of actions leading from the initial state to a goal state State Space Real world is absurdly complex state space must be abstracted for problem solving Abstract state set of real states Abstract ac ion complex combina ion of real actions eg Arad Zerind represents a complex set of possible routes detours rest stops etc Abstract solution set of real paths that are solutions in he real world Each abstract action should be easier than the original problem Page 2 Example Vacuum World state space Example Vacuum World state space graph States Integer dirt and robot locations ignore dirt amounts Actions Left Right Suck NoOp Goal test No dirt Path cost 1 per action 0 forNoOp States Actions Goal test Path cost Other Examples Tree Search Algorithms Eight puzzle Basic idea Offline simulated exploration of state space by generating RObOtIC Assembly successors of already explored states AKA expanding states States Actions Goal test Path cost function TREE SEARCHprOblEHL strategy returns a solution or failure initialize the search tree using the initial state of problem loop do if there are no more candidates for expansion then return failure choose a leaf node for expansion according to strategy if the node contains a goal state then return the corresponding solution else expand the node and add the resulting nodes to the search tree end Implementation states vs nodes Implementation general tree search function TREE SEARCH problem fringe returns a solution or failure fringe 6 INSERTMAKE NODElNlTlAL STATEproblem fringe loop do Representation of a physrcal configureation 1f mm is empty theireturn false node 6 REMOVE FRONT fringe if GOAL TESTproblem applied to STATEnode succeeds return node fringe 6 lNSERTALLEXPANDnode problem fringe Data structure constituting part of a search tree function EXPAND node problem returns a set of states Includes parent children depth path cost gx successors 6 the empty set I for each action result in SUCCESSOR FNproblem STATEnode do 0 s 6 a new NODE PARENT NODEls 6 node ACTIONis 6 action STATEs 6 result PATH COSTis PATH COSTlnode STEP COSTnode action s DEPTHls DEPTHlnode 1 add s to successors return successors Find the error on this page Page 3 Search strategies A strategy is de ned by pickingthe order of node expansion Strategies are evaluated along the following dimensions 7 Completenessr does it alWays nd a solution ifone exists 7 Time complexity 7 number 0 nodes generatedexpanded 7 Space complexityr maximum nodes in memory 7 Optimality 7 does it alWays nd a least cost solution Time and space complexity are measured in terms of r or maximum brancning factor oftne seai cn tree 7 d7 deptn oftne leastrcost solution 7 in maximum depth oftne state space may be infinite Uninformed Search Strategies Uninformed strategies use only the information available in the problem definition Breadth rst search Uniform cost search Depth rst search Depthlimited search Iterative deepening search Breadth rst search Expand shallowest unexpanded node Implementation Fringeis a FIFO queue ie new successors go at end Execute rst few expansions ofArad to Bucharest using Breadth rst search Properties of breadthfirst search Complete Yes if b is finite Time1 b b2 bd bbd1 Obd ie exp in d Space Obdl keeps every node in memory Optimal If cost I per step not optimal in general Space is the big problem can easily generate nodes at 10 MBs so 24hrs 860GB Uniformcost search Expand leastrcost unexpanded node lmplementation e Fling u urdered by path Bust Equivae7I Io breadlhrfilslif Compele77 r siep eosi e 5 Win 9 cost of opiimasoulion oare Where c is we cost of we opiima soulion Space77 ofnodes win 9 coslofoplima soulion owee Oplima77 Yearnodes expanded in increasing aideof gn searcn Depth rst search Expand deepest unexpanded node Implementation Fringe LIFO queue Le a stack Execute rst few expansions of Arad to Bucharest using Depth rst search Depth rst search Complete Depth rst search Complete Nu faiis if in nitB depth aoEs spacesvvtn in 5e ups Time Can be modmed m avuid repeated states aiong path eempiece if finite spaees 77 Time 39 Space e om terribie mm much iargertnan at but r Semen are dense may be mleh faaerihan breadthfirst Optimal ex e om r e iinearspacei Optimal Nu Depthlimited search Depthlimited search Depth first search with depth limit I Complete ie nodes at depth have no successors Time mm nemelmlrenesmen ipzoblex 11116 xelunls spacen salnfallcucaff Recumvemsimmunerlulmlesmmrarlen rrarle 11116 Optimal77 un llnn Recunslvenls mode ploblel llslcr xeluxns salnfallcucaff euea eaeeurrede e mse l selleresrrpzobleaismrzraoaelr um remquot node nemraoae e llsle men 1 else 1 eum cutoff else i c n iaoae ploble r n resale e Recunslveemsisaeeessol ploblel llslcr u lesll off u uxxe e l 1112 um I Inn xesul enen remquot cutoff else remquot fallule Iterative deepening search function mammvssnmeamuesmcuproblem retluns a solumon 39 pr em a a resale e Dealuelmenesmcmprable aepea if resale 9 cutoff eher reem resale ens Properties of iterative deepening Complete Time Space Optimal Page 5 CS 416 Artificial Intelligence Lecture 6 Informed Searches Chess Match Kasparov 1 Deep Junior 1 Draws 2 Compare two heuristics iii itiii ms i tiii mx Mi Compare these two heuristics h2 is always better than h1 e for anv node n nztn gt h1rl e n2 dominates n1 e Recall all nodes Witn rm lt c Will be expanded tnis means all nodes hm lt v 7 din vvlll pe expanded All nodes n2 expandsvvlll also pe expanded pv n1 and because n1 is smaller uthersvvlll pe expanded asvvell Inventing admissible heuristic funcs How can you create hn e Simplirv proolem ov reducing restrictions on actions Allovv Eepuzzle pieces to sit atop on anotner Call tnis a relaxed proplem The cost of optimal sulut on to relaxed problem is admissible heurlstlt fur original problem e II isat least as expensiveioitne oiioinal pioplem Examples of relaxed problems A tile can move trom square Ato square B it A is norizontallv orverticallv adlacerlt to B and B is blank 7 A tile ean move rromA to B irA is adlacerlt to B overlap n move rromA to B it B is planx telepoit Witnoot searcn and tnererore heurlstlc is easvto compute Page 1 Multiple Heuristics If multiple heuristics available a nn max inini n2ni innnl Use solution to subproblem as heuristic at is optimal cost of solving some portion of original problem 7 supproolem solution is neunstic or original problem im uit Pattern Databases Store optimal solutions to subproblems in database 7We use an exhaustive searcn to solve everv permutation oftne 234 piece supproolem oftne 87 puzzle 7 During solution of 8rpuzzle loolltup optimal cost to solve tne 234 piece supproolem and use as neuristic Learning Could also build pattern database while solving cases ofthe 8puzzle 7 Must keep track of intermediate states and tme final cost of solution 7 lnductive learning ouilds mapping of state egt cost 7 Because too manv permutations of actual states Construct important featurestu reduce SiZE or space Local Search Algorithms and Optimization Problems Characterize Techniques Uninformed Search 7 Looking fora solution wnei39e solution is a patn from start oal e t eacn intermediate point along a patn We nave no prediction of value ofpatn nformed Search 7 Again loollting for a patn from start to goal 7 Tnis time We nave insignt regarding tne value or intermediate solutions Page 2 Now change things a bit What ifthe path isn t important just the goal 7 So the goal is unknown rThe path to the goal heed not be solved Examples 7 What quantities of quarte up to 513i 7 45 coins rs motels and dimes add and minimizes the total humbei of a is the price of Microsoit stock going up tomorrow Local Search Local search does not keep track ofprevious solutions 7 instead it keeps track of current solution current state i c 8 m of g nerating alternative soiution 7 Use a smaii amount of memory usually constant a nt ino reasonable note We aren t optimal soiutions in innnite search space saying s Optimization Problems Objective Function 7 A function With vector inputs and scalaroutput guai is to search tnrougn canoioate inputvecturs in urdertu minimize ur maximize ooiective functiun Example 7 HQ d h 1000000 ifq O 25 t d O i t h O 05 l 17 45 o n o otherwise a mihimiZet Search Space The ealrn of feasible ihputvectors numoeioioimensionsaioiouicnanoeexampie oomamoioimensionsmisoisci natuie oiieiationsmp between in naveiatianship sniamnlvvavwig uisconiinuiiies eteiiom Ellu ea Put vectuv ano ubiecwe iunction output Search Space Looking for global maximum or minimum immunian iiitonwiwmiiaim u Mi Hill Climbing Also called Greedy Search 7 Select a starting point and set cun e evaluate cunent 7 loop do neighbur highest vaqu successor of cunent it Evaluate heighbur lt Evaluate cunent e vetumcunem eise unentneignoor Page 3 Hill climbing gets stuck Hiking metaphor you are wearing glasses that limit your vision to 10 feet Lomlllrmmllrma Platsuul minty iis this a radium Hill Climbing Gadgets Variants on hill climbing play special roles stochastic hill climbing don t always cnoose tne best successor rstchoice hill climbing plcllt tnenrst good successor you nnd 7 useful lfnurnber of successurslslarge random restart follow steepest ascent from multlple startlng states probablllty otnndlng global max lncreases wlth number of starts Hill Climbing Usefulness lt Depends Shape of state space greatly influences hill climbing local maxima are the Achilles heel what is cost of evaluation what is cost of nding a random starting location Simulated Annealing A term borrowed from metalworking We want metal molecules to find a stable location relative to neighbors heating causes metal molecules to move around and to take on undesirable locations during cooling molecules reduce their movement and settle into a more stable position annealing is process of heating metal and letting it cool slowly to lock in the stable locations of the molecules Simulated Annealing Be the Ball You have a wrinkled sheet of metal Place a BB on the sheet and what happens 39 BB rolls dovvrlh ll BB stops at bottom of nlll local or global mln BB momentum cames lt out of nlll lnto another local or global By shaking metal sheet your are adding energy heat How hard do you shake Our Simulated Annealing Algorithm You re not being the ball Danny WWW Gravity is great because it tells the ball which way is downhill at all times We don t have gravity so how do we decide a successor state 7 aka Stochastlc Page 4 CS 416 Artificial Intelligence Lecture 15 FirstOrder Logic Chapter 9 Guest Speaker L 0nesirnei Hernandeererm Depart ClNVES ntrudumiun mainly thm examples tu some i n irig adaptive cunlrul trula a wurslrcasecunlrul gamesaga parliallyubservable systems 3 ka eeniieie nidden Mai p more and neneeepeiawe game Equlllblla etc Final Exam Forward Chaining Final Exam will be May 6 at 700 pm Remember this 39om propositional logic 7 Start With atomic Sel ltel lC This con icts with the fewest number of other APW MOMS pone exams add new sentenee to K diseeintinue wnen no new se tenees eHo ruii in e sentence you are looking rorintne generated senten s Lifting forward chaining Example Firstorder defnite clause rThe law says it is a crime for an American to sell 7 all sentences are de ned tnis way to Simplify weap m 0 05 9 quotmm The 0 p ocessmg enernyorArnenoai disiunetiein or iiterais wtn exactiy one pEISitiVE clause is eitner ateirnie or an irnpiieatiein minus anteeedent is a eoniunetiein or pEISitiVE iiterais and wneise eonsequent is a sin ie pEISitiVE iiterai rt iiinin i rmdim e Euriii ri39ni Juli n awnin ntryNon n orne rnissiies and all orits rnissiies were soid to it by Colonel West w Arne icai i eWe wiii prove West is a criminal Page 1 Topies in Optirnai controii Minimax controii and Game Tneory March 2m 2 p rn 0 ans Example crime forari American to Seii Weapons to hostiie iinnnmii ii 7 it is a neiinne iiiwniii iiuni i quotwin in 7 None nas sorne rnissiies ONrisWunu Mi Missiie Mi eAii orits rnissiies were soid to it by Coionei West e mil iii i n Almeili i i i k our immunii Example 7 We aiso need to know tnat rnissiies are weapons Mimi tr ii39mlniiriri e and we rnust know tnat an enerny or America counts as hostiir EVANHI z iiriu mii Imi i39lrirmi 7 West wno is American Arm INHI ith e The country Nonoi an enerny or America ErimiyiNinu iniprmi Forwardchaining Starting from the facts 7 find aii ruies With satis ed premises 7 add their conciusions to kriOWri facts 7 repeat untii ery is answered nu newraets are added First iteration of forward chaining Look at the implication sentences rst iiiuiinmirir iiniiiniiiii Mimi i lliiwlii4i i minnmtiii e rnus atisry unknown premises eWe can satisrytnis ruie i wit Liti wivrii nimii xiin um i Mimi by substituting rx and adding Seiierest Mi Nunu u KB First iteration of forward chaining e We can satisry Mimi r 3 lii mlinnii witntkMi andWeapunWiJisadded e We can satisry WEnaniutu Airu39r lm e Imti39chri and Hustiie menu is added Second iteration of forward chaining 7We can satisry J39i w ir IIiiiih lei I iiiiiiiinliii iiiminiii gtltlWEsL yMi i zNunu is added witnr and crirninai West Page 2 Analyze this algorithm Sound Does it only derive sentences that are entailed es because only Modus Ponens is used and it is sound Complete Does it answer every query whose answers are entailed by the KB Yes if the clauses are de nite clauses Provmg completeness ssume KB only has sentences with no function symbols What s the most number of iterations through algorithm Depends on the number of facts h t can be added Let x be tne arlty tne max number of arguments of any predicate and Letp be tne number of predicates Let N be the number of constant symbols At most pnk distinct ground facts Fixed point is reached a er this many iterations A proof by contradiction shows that the nal KB is complete Complexit of this algorithm Three sources of complexity inner loop requires nding all unifiers such that premise of rule uni es with facts of database this pattern matchingquot is expensive must check every rule on every iteration to check if its premises are satisfied many facts are generated that are irrelevant to goal Pattern matching Conjunct ordering Missile x quot Owns Nono x gt Sells West x Nono Look at all items owned by None call them X for each element x in X check if it is a missile Look for all missiles call them X for each element x in X check if it is owned by None Optimal ordering is NPhard similarto matrix mult Incremental forward chaining Pointless redundant repetition Some rules generate new information this information may permit unification of existing rules some rules generate preexisting information we need not revlsltthe unification of tne existing rules Every new fact inferred on iteration t must be derived from at least one new fact inferred on iteration t1 Irrelevant facts Some facts are irrelevant and occupy computation of forwardchaining algorithm at If Nono example included lots of facts about food preferences Not related to conclusions drawn about sale ofweapons How can we eliminate them 7 Backward chaining l5 orievvay Page 3 Magic Set ReWriting the rule set 7 5o angemus 7 Add eiernents tn premisesthat restrict andidatesthat Will match aeeee eiememsare based on eesnee eeai 7 Let goal Criminal West MauicOO Americanw quot WeapuVW quot Sells vi Z quot HDS1llEZ 3 Criminal X Add Magic Wes1lu Knowledge Base Backward Chaining Start with the premises ofthe goal 7 Each pre lSe must be supported byKB 7 Start With rst premise and look forsupporl rrorn KB ioohng fur clauses With a head that rnatehes premise the heads premise mus tthen be supported by KB A recursive depth rst algorithm 7 Suffers rrorn repetition and incompleteness Resolution We saw earlier that resolution is a complete algorithm for refuting statemen s 7 Must put nrst7order sentences into coniunotive rrnai rorrn eoniunetron or clauses each is a ursiunctron or literals 7inerais ncunlainvariahieswhichareassumedluheuniversaiiv wartime Firstorder CNF For all X Amenangtlt A Weapuny A Sellsgtlt y z A Hostile z gt Criminaigtlt v v Seiisgtlt y 1 v Hus new v 7 Arneritarigtlt vvveapon Criminaigtlt very sentence othrstorderiogro can be converted into an inferentially equivalent CNF sentence they are both unsatisfiable in same conditions Example Everyone who loves all animals is loved by someone l39 Innwinn Lawn mi 7 at ownuni Example ilimdurducmnillrlm u irkmmlihr urn urn ulmhii it Wt trmnn mm mm tin nit n he n m n nit urnlrlm nus rwis more i no mtquot WW nit shuntrs ms m in r ii than t min r r liiirvih il m n tints in Alum rr m s m r7 iiw new mm W m m n is in im in Win a mi rhr it not it rm swim M a whim n Wit nnsmt Wt tram r nr trehrur n arm mil mun r tram r r Hr rm twirer Page 4 CS 416 Artificial Intelligence Lecture 11 Logical Agents Chapter7 Midterm Exam Midterm will be on Thursday March 13 It will cover material up until Feb 27 1 Reasoning w propositional logic Remember what we ve developed so far 7 Logical sentences rAl39id on not implies entailrnentt irr equivalence 7 syntax vs semantics 7 Truth tables 7 Satis ablllty proof bvcontradiction Logical Equivalences Know these equivalences Reasoning w propositional logic Inference Rules ii 2 1 1i u Ponerls l Whenever ntenees erreim egt p and e are glverl tne senten Bran be inferred ea cleanesvamai se 2 e R cieen rlnlerred Martian Reasoning w propositional logic nference Rules l l3 7 AndyEllmll latlol l Anv er eeniunets can be inferred 039 e n Martian Greerl e inienee Mamaquot 7 inieniee cieen Use truth tables ifyou want to con rm inference rules Page 1 Example of a proof llmmninpuiilll ii in I39ll MM m n n Imlurrhililmti innquot inertmin in Tlmlxiinlw new inn lirriiuuuimlmlciriwllliciiluniriwqr i m in im in nn ill I39m i m m m mine munMnnnnmmnnm km in imlmlullp nunn in in MN Mann nmai in n mum win nun n in k n n nwnnmnm mm m n m l in Example of a proof us In mm in rLin n m in mm m l liminnimrli m innni r r n lnurmliiwir Lrnmmnn u in in m nn i l r r n inn nimn m is in In i n i l nimv in IL m in im n n n 139 n munnim in u is i nil 7 mm mm mm Mm H mm n minimum Minn winkMi r n n Tlm n M in ii min i unnnm mn Constructing a proof Proving is like searching 7 Find sequence oflogical inference rules that lead to desired result 7 Note tne ekpiosron of propositions Gene pruuf methods lgriure the noun less irrelevant prupusi lEIriS Monotonioity of knowledge base lltriowledge base can only get larger 7 Adding new sentencestu knevvieege base can only make it get larger ll KB emails 4 KB emails at e Thisis irn unaninnen cuns iru irig pruufs A lugical cunclusiun drawn alunE puni cannul be invalidaled m a sunseeueni enlailmem How many inferences Previous example relied 0 rules to generate new sen rWneri have you drawn enougn inferences to prove something n application of inference tences Tun many make Search preeessiake longer Tun few halt logical progression and make weer process incumplete Resolution n rpm nmnmuein m mll ll Iquot iunillivicmliilimriiilv uninmi In Mr Winnnnn n in 1 lullimul in minim MW nun i uil l w L ninnn n U rill R esolutlori inference R ule e if mandl are umpiementary ll V39 39l literals nv vvl wmvu vr Page 2 Resolution Inference Rule Also works with clauses all v i ll v 1r But make sure each literal appears only once livu an we nhlum ll V l ii39wc iemlve l v Rliwih ll v Resolution and completeness Any complete search algorithm applying only the resolution rule can derive any conclusion entailed by any knowledge base in propositional lo 09 7 More specifically rerutation cornpleteness Able tb ebnrirrn br rerute anv sentenee Unable tb enurnerate all true sentenees What about and clauses Resolution only applies to orquot clauses 7 Eve ogicallv equivalent coniunction of disiunctions of lite Conjunctive Normal Form CNF 7A sentence expressed as coniunction of disiunction ofllterals 39 v in it 1 i v i i u iiiti iiiiimiii i i M i t i i i i iiiiii iiiiriuuiili iii iviim ll An algorithm for resolution We wish to prove KB entail 7 Must shovv KB A a is unsatisrable Nu possible way fur KB to entail nut 0 Pruuf bv Euntradl lun An algorithm for resolution Algorithm 7 KB Ao l5 put ll l CNF e Eacn pair Witn cornplernentarv literals is resolved to produce new clause wnic dedt e it no nevv clauses to add o is not entailed Cease it resolution rule derives ernptv elause eis d entaile Page 3 KB lfrlovel Example of resolution Formal Algorithm iii i39 Proof that there l5 not a pit in PM Pi 2 7 KB A P12 leadstu empty clause 7 Thererere 43912 istrue m iii Horn Clauses Horn Clauses Horn Clause Can be written as a special implication e DisiuhctiOh of literals With at most one l5 DOSlthe avb eve A gtc a v bvve Not a Hhm Liause e Morgan impiieatiuri eiirhiriatiuri Horn Clauses Horn Clauses Permit straightforward inference determination Permit determination of entailment in linear time 7 Forward chairiiri in order of knowledge base si e Backward chaihihg Page 4 CS 416 Artificial Intelligence ecture 20 BiologicallyInspired Neural Nets Modeling the Hippocampus Hippocampus 101 In 1957 Scoville and Milner reported on patient HM Since then numerous studies have used fMRl Numerous rat studies that monitor individual neurons demonstrate the existence of place cells Generally hippocampus is associated with intermediate term memory ITM Hippocampus 101 In 1994 Wilson and McNaughton demonstrated that sharp wave bursts SPW during sleep are teaches learned sequences to the neocortex as 39 random processes Levy also hypothesizes that erasurebias demotion happens when e neocortex signals to the hippocampus that the sequence w s acquired probably during slowwave sleep SW8 a m m 239 m m m a Cornu Ammonis The rnust Significant feature ill the hippucarnpus lStHE Curnu Arnrnunis CA Must Wurk in the Le CA1 regiun asvve Minimal Model Typical Equations Zw c z rl D hewlclz rl k z trllnKgt y WE mmzswwa othavwisa Wrwkmm1 1ZHWH H 52 quotOshawa Ik I n Fundamental Properties Neurons are McCullochPittstype threshold elements Synapses modify associatively on a local Hebbiantype rule Most connections are excitatory Recurrent excitation is sparse asymmetric and omly connected Inhibitory neurons approximately control net activity In CA3 recurrent excitation contributes more to activity than external excitation Activity is low but not too low Model Variables Functional Amai i Average activity i W Dr H r 2 Activity iiuctuations 2 percent mnnectmty 3 Sequence iengtn memory 3 rim 5 an or synaptic capacity associations 4 Averagelifetirne oflocal 4 Threshul t i come new 5 Feedback innioition Weight 5 Speed of iearning constant 6 Ratio of external to recurrent B reedruiwaro innioition Weight excitations uristarit Resting conductance c nstant of synaptic modification lriput cooe Eleven Problems Simple sequence completion Spontaneous rebroadcast Onetrial learning Jumpahead recall Sequence disambiguation context past Finding a sho cut Goal nding context future Combining appropriate subsequences Transverse patterning Transitive inference race conditioning A QWT QQF P NT T o39 Sequence Completion Train on sequence ABCDEFG Provide inputA Network recalls BCDEFG Rebroadcast Train network on one or more sequences Provide random input patterns All or part of one of the trained sequences is recalled Onetrial learning Requires high synaptic modification rate Does not use same parameters as other problems Models shortterm memory STM instead of intermediateterm memory ITM hippocampus Jumpahead recall With adjusted inhibition sequence completion can be shortcircuited Train network on ABCDEFG Provide A Inhibition in hippocampus does vary Network recalls G or possibly BDG etc Disambiguation Train network on patterns ABC456GH and abc456ghi Present pattern A to the network Network recalls BC456GH Requires patterns 4 5 and 6 to be coded differently depending on past context Shortcuts Train network on pattern ABC456GHIJKL456PQR Present pattern A to the network Network recalls BC456PQR Uses common neurons of patterns 4 5 and 6 to generate a shortcut Goal Finding Train network on pattern ABC456GHJKL456PQR Present pattern A and part of pattern K to the network Network recalls BC456GHJK Requires use of context future Combinations Train network on patterns ABC456GH and abc456ghi Present pattern A and part of pattern i to the network Network recalls BC456ghi Also requires use of context Jture Transverse Patterning Similar to rock paper scissors Train network on sequences ABa ABb BCb BCc ACc ACa Present AB and part of to network and network will generate a Present BC and part of to network and network will generate b Present AC and part of to network and network will generate c Model of Neurons Multiple inputsdendrites CS 416 10000 39 39 39 39 II b d rr ArtIfICIal Intelllgence Ce 0 Ysoma Pe orms computation Lecture 18 Single outputaxon Neural Nets Computation is typically Chapter 20 modeled as linear Early History of Neural Nets Cybernetics 9 Eons ago Neurons are invented The theoretical study of communication and 1863 Jy cm Mam Studies feedback control processes in biological mechanical and mechanisms electronic systems especially the comparison of these processes in biological and artificial 1942 we39ner at all mmuuate cybemetncs systems httpwwwdictionarycom 1943 McCulloohuPitts Neurons o 1949 Hebb indicates biological mechanism r 1962 Rosenblatt s Perception o 1969 Minsky and Papert decompose perceptrons McCullochPitts Neurons Hebbian Modification When an axon of cell A is near enough to excite cell B and repeatedly or persistently takes part in firing it some growth process or metabolic change takes place in one or both cells such that A s efficiency as one of the cells firing B is increased from Hebb s 1949 The Organization of Behavior p 62 One or two inputs to neuron Inputs are multiplied by weights If product exceeds a threshold the neuron res How would we create xor Page 1 Perceptrons Eachmputlsbmar and hasassumatedwlt lta W x elght X X 3 Nut gates are alluwed w2 W gt8 The s m utthe mner pruduct utthe mum and M M Welghtsls calculated ltthls sum exceeds a threshuld the perceptrun res em Error Correction Aw ec pee w Only updates Welghts for nonrzero mputs For postttve lnputs r the perceptmn shuuld have red but me nm the wetgm ls lncreased r lf the perceptmn red but shuuld hm have the wetgm ls decreased For negatlve lnputs 7 ehavlur ls uppuslte Perceptron Example Example modlfled from The Essence o g gantry lmtlallze all Welghts to o 2 Perceptron Example Flrst output lSl 5er e 0 20 20 be 5 onnectlons are decremented by Let epsllon 0 05 0 05 and threshold 0 5 Perceptron Example Next uutput ls u slnce u 15m 15m 2ltu 5 Shuuld be set Welghts Wlth actlve cunnectluns are lncremented by n ma Welghts wem rer Allsun tern and Gall OutputfurSlmun lsl Shuuld be Dr se Perceptron Example n 2m 25n15gtn 5 Welghts Wlth actlve cunnectluns are decremented by n ma Are We flnlshed Perceptron Example After prunessing all Wurwui all Examples hese rnean7 in generali huvv u eri shuuld We reprumass Class Exercise Find Wl WZ and Y theta such that x WE Thetaxlwlx2w 2 xi xoer Wi Or prove that it E can t e done em x xmxz 2 d Class Exercise x3 xiyx Findwl WZ 3 W4 andtheta such that Thetaxlwix2w 2 x xorx2 onpioyethat it can tb 3rd Class Exercise Find Wl WZ andto gtlt a 7 wa ttxi Wigtlt2 M 7 x xorx2 W i onpioye that it can t edorie 2W1 x mg Multilayered Perceptrons lnputlayeryoutput x2 lay a d hidderi Wl W2 iayeis Eliminates some 9 concerns at Minsky M M ha and ape Moditicationiuies Q are more cornphcatedi 4m Class Exercise Find wiwzwa x x2 my thetal arid Wl W2 theta2 uchthat ut utisxl xoer 9 0i pioye that it W3 mi n5 cantbe d Page 3 Recent History of Neural Nets 1969 Minsky amp Papert kill neural nets 1974 Werbos descr bes backpropagation 1982 Hopfield reinvigorates neural nets 1986 Parallel Distributed Processing Here s some source code httpwwwgeocitiescomCapeCanaveral1 6240 The report ofrny death is greatly exaggerated 7 Mark Twain Limitations of Perceptrons Minsky amp Papert published Perceptrons stressing the limitations of perceptrons Singlelayer perceptrons cannot solve problems that are linearly inseparable eg xor Most interesting problems are linearly inseparable Kills funding for neural nets for 1215 years BackPropagation The concept of local error is required We ll examine our simple 3layer perceptron with xor Initialweightsare random Initialweights WE BackPropagation xor Threshold is now sigmoidal function should W10 90 W2390 54 3 W5 have derivatives 130 21 W40 03 w5078 fx WlW e nypner It means buckle your seatbelt Dorothy because Kansas 5 going byerbye BackPropagation xor Input layer two unit XW Hidden layer one unit W5 Output layer one unit 5 Output is related to input by Ftr xffx w w 3 Performance is defined as i ax cz P Virgil Thatpmath 39 errors 39k h UGAstudem BackPropagation xor Error at last layer hidden output is defined as 51 Fwx c Error at previous layer input hidden is defined as 5 Wiek0k10k6k 6P Change in weight Awe ltXkT26jj Where aPxc 7 W 7 0 01 17 0 6 is BackPropagation xor BackPropagation xor x x2 x x2 0090 1st example W2 0191 2nd example W Input to hidden unit is O sigmoid005 W5 ihO54 oh03862 W5 Input to output unit is O50030015 9 io03862003O78O7699oo06683 9 504963 err0r04963 5 106g33 03167 5 70 4963 a 39 30 0P 038620683317068330316700252 0 50 496317 0 496370 4963 70 0620 aw 0w 8P 10683317068330316700685 45mm Example s contribution to Aw 4 is 00062 8W 5 70030683317 06833 03167 700021 8P 10368217 03682700021 700005 2 Why are we ignoring the other weight changes aw BackPropagation xor Hopfield Nets 39 ma39 perfrma e39 2696 W Created neural nets that have content After 100 iterations we have a w0913 05210036 0232 0288 wows addressable memory Performance02515 AfteMOOKitera onswehave Can reconstruct a learned Signal from w1575 76717146 7149 00022 3 fraction of as an input Performance01880 AfteriM iterations we have Prowded a biological interpretation w2138 1049 9798 9798 00002 Performance 01875 What is the Purpose of NN Quick List of Terms Presynaptic Modi ca ion Synapse weights are only modified when incoming afferent neuron fires Postsynaptic Modification Synapse weights are only modified when outgoing efferent neuron fires Error Correction Synapse weights are modified relative to an error can be pre or postsynaptic To create an Artificial Intelligence or Although not an invalid purpose many people in the AI community think neural networks do not provide anything that cannot be obtained through other techniques 0 To study hOW the human brain works requires some form of feedback Ironically those studying neural networks wi h selfSUPeWisedi Synapse weights are mOdified this in mind are more ikey to contribute to the relative to internal excitation of neuron can be previous purpose pre or postsynaptic Page 5 CS 416 Artificial Intelligence Lecture 5 Informed Searches Something to think about Compare space complexity of BFS and UCS Textbook lists BFS space complexity as Ob l 39fnigSQ ista t Textbook lists UCS space complexity as 0b when 5 1 that list rather than just moving across a depth level Could you transform the BFS algorithm to be 0b Informed Searches We are informed in some way aboutfuture states and future paths We use this information to make better decisions about which of many potential paths to pursue A Search Combine two costs ftquot 900 hn gn cost to getto n from the root u 0 we as 390 to Q a to o never overestimates cast at a solution through n Expand node with minimum fn What does amissible buy us Repeated states do not present problem for TreeSearch Went through proof last class or every suboptimal goal there is a node on the path towards the optimal goal that would be selected first Repeated States and GraphSearch GraphSearch always ignores all butthe first occurrence of a state during search Lower cost path may be tossed So don t throw away subsequent occurrences Or ensure that the optimal path to any repeated state is always the first one followed Additional constraint on heurisitic consistency Page 1 Consistent monotonic hn Examples of consistent hn Heuristic function must be monotonic hnlt onan nn 1quot 2 n g 1 e e for every node n and successon 72 obtained Witn rm W 5 admisslble 0 5mm 5 TheuuickesWuucanuettneveftumneveisl minmes itiiaimmemeniumesismmemey ted cost or ieaening goal from n is no greaterthan 7 Manama an am and ieammg the ma mi WWW m Fl mate 51 Di mm W lttuukvuutwu minutest gel have an Vuu s1ill have nine minutes tn en fmm n We cannot leavn itluukvuutwu minuteslu 921 have and vuu have hn lt tn a n hn swen minuteslu on eTnis implies fn along any patn are nondecreasing Proof of monotonicity of fn Contours lfhn is consistent monotonic then fn along any path is nondecreasing 7 Suppose n is successor ofn 39 Because fn l5 nondecreasing conto n Cn a n fursume a n hn e n am mnnmnmcnyimrnes ti W a lt n hlnl in zin39l hln39l explore cuntuurs lESS than c Properties of A A is Optimally Efficient 7N expands all nodes With fn lt C Compared to other algorithms that search from root 7 At expands some at least one ofthe nodes on the Compared to other algorithms using same heuristic ct contourbefore finding tne goal Af expandg quot0 quotOdeg W m fn gt 0 No other optimal algorithm is guaranteed to expand tnese unexpanued nodes can be pruned ewer nodes an except perhaps eliminating tie breaks atfn ct Page 2 Pros and Cons of A A is optimal and optimally ef cient A is still slow and bulky space kills frst 7 Number or nodes grows exponentlallyvvltn the length to goal Thls ls actually a runetlon or heurls tlE but hey all have errors 7 A must search all nodes Wlthln thls goal contour e Flnolng suooptlmal goals ls sometlmes only reaslole Oll l r Sometlrnes betterheurlstlcs are l lol lradrnlsslble Memorybounded Heuristic Search Try to reduce memory needs Take advantage of heuristic to improve performance 7 lteratlyeoeepenlng A lDA e Recurslve bestrflrst search RBFS Ar Iterative Deepening A lterative Deepening r r as arl ul llforrned searcn thls Was a depthr rlrst search where the max depth was lteratlyely ll lcreased e As an lnrormeo search we agaln perrorm depthrfl search but only l lodes Wlth frcost less than or equal to smallest frcost of nodes expanded at last lteratlol l l 7 Dent need to store ordered queue of best nodes Recursive bestfirst search Depth rst combined with best alternative 7 llteep track or optlons along rrlng deptnrflrst exploratlorl becomes more expenslve oroest optlon back up to fnnge but update node eosts along the vvay e What happens when roost ls realrvalue 7 Recursive bestfirst search 7 box eontalns frvalue or best alternatlye path yallaole rrom any aneestor Flrs t Explore path to F39ltEStl 7 Ba ack to Fagaras and update Fagaras e Backtracktu F39ltEStl and update F39ltEStl Quality of Iterative Deepening Aquot and Recursive bestfirst search RBFS e 0bd space complewty lrhn ard to descr be ls aomlss ble 7 Tlme complewty ls h and RBFS use too llttle memory yen lr you wanted to use more than 0bd memory these Wu could not proylde any adyantage Page 3 Simple Memorybounded A Thrashing Use all available memory Typically discussed in OS wrt memory 7 Follow A algoritnrn aiiu nil iii in i 7 ii iiig aiio regenerating deS parts of the Search tree dornll late the Cost Ofactual r it new node ooes n Seam mo med nudmmmstrvaiue rtlme complexlty Will scale Significantly irtnrasning propagate frvalue errreee nude to parent 7 SMA Wlll regenerate a Subtree onlywherl lt l5 l leeded tne patn tnreugn subtree is unknown but cost is knuvvn Metafoo Heuristic Functions What does meta mean in Al 8puzzle problem 7 Frequently it rneans step back a level trorn too Avg Depth22 e Metareasoning reasoning about reasoning l l quot Branching rThese inrorrneo searcn algoritnrns have pros and 1mm 3 cons regarding howthey onoose to explore new 39 levels 32 states a metalevel learnan algoritnrn may combine learn huvvtu x l 39 eurnoine techniques and pararneterize searen 0000 repeated re 47 iiiiitiil iii i is l wisp lull Heuristics Compare these two heuristics The number ofmisplaced tiles rAdmlSSlble because at least n moves requlred to solve n rnisplaoeotiles Effective Branching Factor b e A explores N nodes to ring tne goal at oeptn o pt oranening tamer such tnat a unirerrntree at depth d The distance from each tile to its goal position o W a NO dlagonalsi 50 use Manhattan Dlstance 7 be doset01 S dea As lfvvalklng around rE lllrlEar city blocks i also admissible Page 4 CS 416 Arti cial Intelligence Lecture 4 Uninformed Searches cont Chess Kasparov won the first chess game Cost of Breadthfirst Search BFS b max branching factor in nite d dep h to shallowest oal node m max length of any path in nite Analysis ofspace and time performance 22 mple on blackboard big on Ofn is the asymptotic upperbuund meansthatthere are positive constants c and nu such that 7 u ltfn lt cfnfurall n gt n 7 Read algorithmstexmuuk mm is newtu you BFS Space Requirements What s important is the path not just the existence ofthe goal in the tree We must be able to reconstruct the path to the goal We ve got to store the tree for reconstruction Cost of Uniform Search See example on blackboard Cost of Depth rst Search time complexity O b length of longest path anchors upper bound space complexity O bm What s an example that highlights difference in performance between BFS and DFS Page 1 Iterative Deepening Essentially DFS with a depth limit Why Remember the space complexity Obm and time complexity Ob of DFS So limit m to be small But what ifm is smaller than d we39ll never nd solu ion So increment depth limit starting from 0 Cost of Iterative Deepening See example on blackboard Preferred uninformed search method when search space is large and depth of solution is not known Bidirectional Search Search from goal to start Search from startto goal See example on blackboard Bidirectional Search Do you always know the predecessors of a goal state Do you always know the goal state Bpuzzle Path planning Chess Avoid Repeated States How might you create repeated states in 8 puzzle How can you detect repeated states What about preserving lowest cost path among repeated states uniformcost search and BFS w constant step costs Interesting problems Exercise 39 3 cannibals and 3 missionaries and a boat that can hold one or two people are on one side of the river Get everyone across the river 8 puzzle and 15puzzle invented by Sam Loyd in good ol USA in 1870s Think about search space Rubik s cube Traveling Salesman Problem TSP Chapter 4 Informed Search NFORMED e Uses probiernespecific knowiedge beyondthe definition of the probiern itseif seiecting oest Bestfirst Search Use an evaluation function to select node to expand ertn evaiuation mnctron expected orstance to 0 L0 ai rseiect the node that minimizes f n the D St node to expiore it Wouidn t rLet S use heuristics for our evaiuation functions Heuristics A function hn that estimates cost of cheapest path from node n to the goal en onn goai node Greedy Bestfirst Search Trust your heuristic e eaiuate node tnatrnrnrrnrzes hn e fn hn Example getting from A to B iore nodes With shortest straight distance to B e snortcornrngs ofheunstic siuw route traffic iung route dead and A Astar Search Combine two costs 40 9U hn cost to get to n hn usttu gettu guai trorn n Minimize fn A is Optimal A can be optimal if hn satis es conditions entn never overestimates costto reach the goai admssmle heunsmc hn rs optnnrstr fn never uveresnmates custh a suiu rontnrougn n e Proof of ootrrnanm Page 3 CS 416 Arti cial Intelligence I Cannot Add Students to Course Unfortunately this class is oversubscribed I cannot add new students to the course Potential exception for 4thyear CS Majors Feel free to stay through end of course today Lecture 1 Introduction Textbook Syllabus This is a great book nstructor 2nd edition released one month ag 15133 magi 5 DaVid Brogan Olsson 217 Most Wider used In US univerSItI 9822211 It s so good I m going to make you read it Homework Read chapters 1 and 2 Sluarl Russell Peter Norvig dbrogancsvirginiaedu Office hours Wednesday 130 300 TA Ben Hocking Office hours TBA Syllabus Class web page Soon to be at httpwwwcsvirginiaeducs416 Grading 3 perhaps 4 programming assignments 40 A couple homework assignments 10 Midterm and Final 25 for each What is Al Discussion exercise for class Think of example AI systems applications that are intelligent Think of example AI Techniques Page 1 AI Systems AI Techniques Thermostat Rulebased Tic TacToe Fuzzy Logic Your car Fig L Neural Networks Chess 39 GeneticAlgorithms Google A Babble sh ll I i i I Thlsthlng Asimo i d t i s u Na 5 4i How to Categorize These Systems Systems that think like humans Systems that act like humans Systems that think rationally Systems that act rationally Distinctions Howone thinksvs How one acts How can I know how you think For the most part you are a black boxquot Cognitive Science How can I know how you act Observation Turing Test Alan Turing Building a Brain World War II motivated computer advances Code breaking Colossus Computing missile trajectories Mark I Electronic Numerical Integrator and Computer ENIAC Turing greatly involved with British efforts to build computers and crack codes Bletchley Park Arrested for being a homosexual in 1952 and denied security clearance Committed suicide in 1954 Rational vs Human Thinkingacting rationally vs Thinkingacting lke a human Rely on logic ra her han human to measure correctness Thinking rationally logicall ri All humans are what Socrates lS mortal a i LDglE formulas for Symheszlrlg DutEEIrrES 7 Actng ratlorlally loglcally Even lf method ls llnglEal the observed behavlormus t be ratlo rlal Page 2 Perspective ofthis Course We will investigate the general principles of rational agents Not restricted to human actions and human environments Not restricted to human thought Not con ned to only using laws of logic Anything goes so long as it produces rational avior What is Al The use of computers to solve problems that previoust could only be solved by applying human intelligence thus something can t this definition today but once we see how the program works and understand the problem we will not think of it as Al anymore David Parnas Foundations Philosophy Aristotle 384 BCE Author of logical syllogisms da Vinci 1452 designed but didn t build rst mechanical calculator Descartes 1596 can human free will be captured by a machine ls animal behavior more mechanistic Necessary connection between logic and action is discovered Foundations Mathematics More formal logical methods Embleanlbgiembble 1847 Analysis of limits to what can be computed lntraetability 19B5rtlrne requlred tb sblye brbblem seales Expunentlally Witn tne size at brbblem instanee NF39rcurnplet 1 e Furrnal elassirieatibn br brbblems as lntramable Uncertainty Carda 1501 The basisrbr must mbuern abbrbaenestb Al Uncertainty can still be used in luglcal analyses Foundations Economics Humans are peculiar so de ne generic happiness term utility Game Theory study of rational behavior in small Operations Research study of rational behavior in complex 5 Herbert Simon 1916 2001 Al researcher who receiv d Nobel Prize in Economic fo h wi 9 people accomplish satis cing solutions those that are good enough Foundations Neuroscience How do brains work 7 Early studles 1824 relled on iniured and abnormal peopleto understand What parts of brall l do numan tnougnt By rnunlturlng lndlvldual neumns munkeys can now cuntml a ebmbuterrnbuse uslngtnuugntalune e Moore s law states computers Will naye as many gates as numans 2020 naye neuro 7 How close are We to naying a mecnanical brall l Parallel cumputatlun rermpplng lntemunne luns binaiyys gradient Foundations Psychology Helmholtz and Wundt 1821 started to make psychology a science by carefully controlling experiments The brain processes information 1842 stimulus converted into mental representa ion cognitive processes manipulate representation to build new representations new representations are used to generate actions Cognitive science started at a MIT workshop in 1956 with the publication three very influential papers Foundations Control Theory Machines can modify their behavior in response to the environment sense action loop Water ow regulator 250 BCE steam engine governor hermostat The theory of stable feedback systems 1894 Build systems that transi ion from initial state to goal state with minimum energy In 1950 control theory could only describe linear systems and Al largely rose as a response to this shortcoming Foundations Linguistics Speech demonstrates so much of human intelligence Analysis of human language reveals thought taking place in ways not understood in other settings Children can create sentences they have never heard before Language and hought are believed to be tigh ly intertwined History of Al Read the complete story in text Alan Turing 1950 did much to define the problems and techniques John McCarthy helped coordinate the players 1956 Alan Newell and Herbert Simon 1956 did much to demonstrate first solutions Marvin Minsky student of von Neumann built a neural network 1951 from 3000 vacuum tubes and the autopilot from a B24 bomber Why is Al in Computer Science Uses computer as a tool more than psychologists mathematicians operations research or mechanical engineers control theory History OfAI 1952 1969 Great successes Logic programs were replicating human logic in many cases Solving hard math problems game playing LISP was invented by McCarthy 1958 second oldest language in existence could accept new axioms at runtime McCar hy went to MIT and Marvin Minsky started lab at Stanford Both powerhouses in Al to this day Page 4 CLUSTERING Clustering Find the bins into which the data can best be distributed grouping similar samples together Uses of Clustering Classification and Recognition Dimensionality reduction 0 Vector Quantization Visualization A fundamental application Doing my laundry Problem Find the bins into which the data can best be distributed grouping similar samples together What Characteristic should I compare lquot Obvious choice Separate whites from colors 139139 I I Then what It39s still more than will fit in one load We need to subdivide further How Find the characteristic with greatest variation Need a metric Assign actual numbers to various characteristics 7 White vs color delicate or not water temperature We can now formally measure similarity quot 41 6 Hue 39 Choosing 1 Metric With the same data and clustering algorithm metric choice affects Cluster sizes Cluster shapes Cluster arrangements Cluster contents 0 It really decides What and how you are comparing your data points Distance and similarity Reciprocal concepts Large distance low similarity Small distance high similarity Convert with monotonically decreasing function eg Gaussian g in I distance Metrics Correlation Similarity Measure CE Eini 0 Used in signal theory 0 Input should be normalized Mean 0 Standard deviation 1 Dot product Metrics Minkowski Metric Distance Measure dAltx ygt A Z xk ykgtA k 0 Used in experimental psychology 0 1 city block distance 0 2 Euclidean distance Metrics Direction Cosines Similarity Measure my llxllllyll 0039 0 Similar to correlation Measures angle between the vectors Relative magnitudes of vector components Metrics T animoto Similarity Similarity Measure x Jay S y x2y2 ltxy Based on set theory nA B nA B 5 4 3 nAUB nAnB nA B 0 Used for similarity between documents 0 Components can be individually weighed Metrics On Symbol Strings Hamming Distance Edit Distance Hashing Color comparisons Multiple metrics available RGB additive color synthesis quot a b b CIE Lab perceptually linear We39ll want something that makes sense for textile dyes Clustering methods Non hierarchical k Means Hierarchical Minimum spanning tree 0 Self Organizing maps 0 More Clustering methods Non hierarchical k Means TiI Iihif in rmMJ igmazwgrjfiwMini 39rw 39 w kMeans kMeans Select three samples at random kMeans Build their Voronoi diagram par itioning the space 39 Note which cell each sample is in kMeans Construct the samples39 centroid 39n each cell kMeans They form the basis for a new pa tition kMeans Some samples may have Change cells kMeans This requires recomputing the c kMeans And the partition kMeans Repeat kMeans kMeans Until no more changes occur kMeans Each cell corresponds to a cluster Smooth boundaries May have samples right at the boundary Clustering methods til L Antibiin 3971 Hierarchical Minimum spanning tree 0 it ItquotLiuwudJ2 J39ifjflfijuil 5 I Minimum Spanning Tree Cluster data points with a MST Minimum Spanning Tree First build the minimum spanning tree Minimum Spanning Tree Find the shortest edge Its vertices form a cluster Minimum Spanning Tree Collapse the points onto their centroid quotI Minimum Spanning Tree Rebuild the MST Minimum Spanning Tree Find the new shortest edge Minimum Spanning Tree Collapse it Minimum Spanning Tree Rebuild the MST Minimum Spanning Tree Again Minimum Spanning Tree ltT ltJ And again Minimum Spanning Tree Merging a point and a cluster Minimum Spanning Tree Take the centroid of all the points involved 4 Minimum Spanning Tree Minimum Spanning Tree Minimum Spanning Tree Minimum Spanning Tree Minimum Spanning Tree Until we have the desired number of clusters left egg 6 Minimum Spanning Tree Each original data point belongs to a cluster Minimum Spanning Tree This method works from the bottom up Once assigned a point 39 never changes Clusters Driven by local conditions A Chain of points might join two otherwise 39 unrelated Clusters Clustering methods TL A 131 4 3 4 313 1 vi L ME L CL H 1 1IiiiLINinIfllUl39HITJ L LEI1ij TEE Self Organizing maps W I Self Organizing Maps 0M Work by Teuho Kohonen 0 Artificial Neural Network Algorithm 0 Each neuron corresponds to a point in data space Has a location in map space 0 Thus they can be used a kNN clustering anchors in uences its neighbors39 learning process W 0M Usage Consider a fully trained SOM Each neuron represent a data point 7 Not functions unlike backprop networks 0M Usage Neighboring neurons hold similar values 0M Usage Data points are associated with the neuron they are most similar to 0M Usage The data points thus are projected onto the SOM39S grid 0M Usage Now consider a randomly seeded map 0M Usage We don39t get local similarity SOM Usage The SOM algorithm will organize the input data onto its array of neurons SOM Algorithm Initialize each neuron with a data point 7 Randomly 7 Principal Component Analysis SOM Algorithm Take a data point Find the best matching neuron SOM Algorithm Modify the neuron39s data and to a lesser extent that of neighboring neurons within a given map radius SOM Algorithm Repeat SOM Algorithm Over time the learning rate A and the radius both decrease SOM Algorithm SOM Algorithm 0M Algorithm SOM Algorithm 0M Algorithm SOM Algorithm Eventually training is completed Each neuron in the map grid corresponds to a cluster SOM Algorithm A finer map grid could have been used 7 Only select somenodes as cluster centers 7 Other nodes are passively trained SOM Algorithm Use the map to classify new data 7 Positions can be interpolated between actual map cells 0M Conclusion 0 The neural network learns a non linear projection from the data space onto the map space 0 The algorithm ensures that similar elements project onto the same regions of the map Uses of Clustering Classification and Recognition Dimensionality reduction 0 Vector Quantization Visualization Robocup Multi agent simulation of soccer game 7 Ball and players are agents Interested in classifying simulation states 7 Similar states 3 similar evolution 7 Let39s forget about chaos theory Available data 7 Ball position velocity 7 Player position velocity Robocup data Agent Positions 0 Compare agent positions Ball at time t Ball at time t39 Player 1 at time t Player 1 at time t39 Metric choice is significant Euclidean distance Account for path constraints Robocap data Images Agents are homogeneous 7 Player identities do not matter 7 Flow of the game does matter Robocap data Images Compare images of the game 7 Blur to remove discontinuities CS 41 6 Artificial Intelligence Lecture 19 Making Complex Decisions Chapter 17 Robot Example magine a robot with only local sensing 7 Traveling from Ato B now to navigate in this room Sequential Decision Problem Similarto 15puzzle problem l low is this sirnilarand different from l5epuzzle7 e Let rubut position be 7 the blank tile 7 Keep issuing movement eornrnanus e Eventually a sequence or cummands Will eause rubuttu reaeh gual Our madem tile worm is marble How about other search techniques Genetic Algorithms Markov decision processes MDP ll39lltlal State 5 n a Transition Model 7 Ts a s quuesMalkuapplvhelev UncenalMVlspusslble Reward Function 7 W5 Fuleacnstale Building a policy HOW might We acquire and store a solutioh7 e lsthisaseareh problem 7 hngv u e Avuld needless repetition lltey observation if the number of states is small consider evaluating states rather than evaluating action sequences Page 1 Building a policy Specify a solution for any initial state 7 Construct a policy tnat outputs tne oest action forarly state ppliey 7 ppliey in state s rrs 7 Complete policy coyers all potential input states 7 Optimal policyy my yields tne nignest expected utility Wny expected 7 Transitions are s1uchas1lc Using a policy An agent in state s e s is tne percept ayailaole to agent I1rs outputs an action tnat maximizes expected utility The policy is a description ofa simple re ex Example solutions Typos in quot ugl t E in imprint iii all iiioimii Striking a balance Different policies demonstrate balance between risk and reward 7 Only interesting in stocnastic enyironments riot deterministic e cnaracteristic of many realeworld problems Building the optimal policy is the hard part Attributes of optimality We wish to nd policy that maximizes the utility of agent during lifetime 7 Maximize usny syyszy ys But is length of lifetime known 7 Finite nonzon e numberofstate transitions is known trnes tepNn hrlg ES iSn U5ni51i 52i iSn Snoli 5mm for e lnrinite nonzon 7 always opportunity for more state transitions Time horizon Consider spot 3 1 7 Le onzon e quot quot e Let nonzon 8 e Let nonzon 20 1 f e Let nonzon inr f lt e Doesn change 2 a 4 Nonstationary optimal policy Page 2 Evaluating state sequences a lrl sayl prerer state a to state p tomorrow l must a so say l prerer state a to state p today a State prererenees are stationary Addltlve Rewards a ua p e 1 Ra Dl500ul lted Rewards a ua p e 1 Rta mp y2Rc u y is ne diseountraetor between El and l hat duesthlsmeam Assurnptlorl Will i Rtp R c Evaluating infinite horizons How can we compute the sum of in nite horizon i RatRbtR0t e lrdiscount factor 1 is less tnanl I39iiilmniAV 2 quotPhil X It quotwill 39 note Rm isnnite py dennition or MDF Evaluating infinite horizons How can we compute the sum of in nite horizon e lrtne agent is guaranteed to end up in a terminal state eventuall We ll never actually have to compare innnite strings or states We can alluvvytu pei Evaluating a policy Each policy 1 generates multiple state sequences 7 Uncertainty in transitions according to Ts a s Policy value is an expected sum of discounted rewards observed over all possible state sequences l 21le i i Building an optimal policy Value Iteration 7 Calculate tne utility or eacn state 7 Use tne state utilities to select an optimal action in eacn state a your policy is simple a go to tne state Witn tne oest utility a your state utilities must be accurate anuugn an iterative process you assign eurreetyaluestu the state utility values Utility of states The utility ofa state s is rthe expected utilityortne state sequences tnat mignt follow i The subsequent state sequence is a runetion or 7rs The utility ofa state given policy 7 is WM 7 r qmul l sum Page 3 Example Lety 1 and Rs 004 N t39 0 Ice 7 Utilities higher near 9 3 m quotm W reflecting ewereo 04 steps in sum 2 am i inns mass 511 mu Restating the policy I had said you go to state with highest utility Actually 7 Go to state With maximum expected utility Reachable state With hlghes t utility may haye luvv prubablllty at being Dbtalned Fuhetibh er ayailable aetibhs tiahsitibh ruhetibh resulting states itgiittixZ I l h s lrrlu l Putting pieces together We said the utility ofa state was i Ii iill39 The policy is maximum expected utility s39ii iiistiiuAZIisii iz is39i Therefore utility ofa state is the immediate reward for that state and expected utility of next State risi ems i Ki x1v ll v l7yl What a deal Much cheaper to evaluate ems laugh xii Instead of Richard Bellman invented the top equation 7 Bellman equation 1957 Example of Bellman Equation Revisit 4x3 example Utility at cell 1 1 ii tiiii timiusiiip iiiiuti iiiiii i ll iii l i i Consider all outcome of all possible actions select best action and assign its expected utility to value of nextstate in Bellman equation Using Bellman Equationsto solve MDPs Consider a particular MDP e n poss ble states 7 n Bellman equatiOhs Ol le for each state 7 n equatiOhs haye n ui lki lOWi lS Us foreach state h equatibhs and h UHKHDWHS l eah sblye this rlght7 Nb because at hbhliheaiity caused by argrhaxm We ll use an iteratiye teehhique Page 4 Iterative solution of Bellman Bellman Update 7 start With aroitrary initial values for state utilities 7 lteratiye updates luuk llke this 7 7 Update the utility or each state as a ruhctioh orits lii e RN mfo 1 Mi s ir iui heighoors 39 7 After lrlflrllte Bellman updates We are guaranteed to reach ah i 7 3s v 39 Illl l ii 39il Y eduilipriumthat seilyes Bellman eduatieiris hs are unique l ii i mil sulutlu e The currespundlng policy is optimal Sanlly check U lll lESYDY a ES nealuualwlll se lE uulckly andlhelr reiehpers in turn Will seiiie imermaiier is propagated through 51312 spaceyia local updates 7 Repeat this process until ah equilibrium is reached Convergence of value iteration Convergence of value iteration l lovv close to optimal policy am i at a eri Bellmah updates Bunk Shulva huvvtu calculate error at tlrne i as a functlurl Elf the Ermr me l fl and discuurlt fa eiry Mathematicallyiieeieus K Vk w mm mmmmmn ii ii iiiiii ii iiii i urictieris 39 lli uiiii iiiiii Policy lteration Policy iteration lmagine someone gave you a policy 7 How goo is lt Assume We knuvvy and R Checking a policy 7 Justfur kicks let s compute a utility at this particular iteration of the pullcy i for each state accurdlng tci Bellman s eduaticm Eyepall lt7 Try a fevvpatns and see how it Wurks7 Letsbemurepreclse TIN quotNH 2 Wm WM Page 5 CS 416 Artificial Intelligence Lecture 12 Logical Agents Chapter 7 Midterm Exam Midterm will be on Thursday March 13 h Itwill cover material up until Feb 27th Propositional Logic We re still emphasizing Propositional Logic Very important question with this method Does knowledge base of propositional logic satisfy a particular proposition an we generate s a proposition is po ome sequence of resolutions that prove ssible Backtracking An other way representation for searching Problem to 39 i ls aNiri rtian given 77M1true7 7 MarVin green77cei 7 Marvin is little 7 iittie and green irnpiies Martian 7 U c gt 2 sure you UG V M understand this L v c v M i I Dr by ebntragietibn are tnere truefalse valuesfu cunsistentvvith lltriu edge base and Marvin at being a Martiari7 A L A L V oglc rcLangMymare n VMquotM 77 U7 Searching for variable values Want to find values such that lL V G VM AM0 Randomly consider all truefalse assignments to variables until we exhaust them all or find match G L M assignments to G L M via depth frst search 0 0 0 to 0 0 1 to 1 0 39 Each clause OfCNF must e L 7 Terminate cunsideratiun VWEH clause evaluates tb raise M Use neuristics to reduce repeated computation of propositions 7 Earlyterminatiun Pure syrnbbi neuristie 0i i 0 7 Unit clause neuristie 1 1 0 Alternatively Searching for variable values DavisPutnam Algorithm DPLL Search through possibl Page 1 Searching for variable values Otherways to find o L M assigninents for G L LVGVM MO WalkSAT termination How do you know when simulated annealing is done Simulated Annealing WalkSA T e No way to know Witn certaintythat an answeris not possible stsit Witn initisi guess 0 1 Eus ustion metric is tne number orcisuses inst eusius r Could have been bad Could be there really is n nsWer M n d I H f m I Establish a max nurn er Elf iterations and gm With best ou in irec ion o guesses s cause more anmm that m t cisuses to De true Many iocsi mins use iots ufrandm39nness So how well do these worl What about more clauses Think about it this way lf symbols variables stays the same but DV vaMBV W VOM WV EVE number ofclauses Increa A E V 1 V m A U v L v gm 7 ways for an assigninent to taii on any one of 32 possible assigninents are rnodels are Sammie form s Senten e nMeoeiZesdeaicning through possible assigninents is ndorn guesses should find a solution rWalkSAT and DPLL should work quickly 7 Let s create a ratio rnn to measure clauses Ht symbols 7We expect large rnn causes slower soiution What about more clauses Combining it all Higher mln means fewer 4x4 Wurnpus World assignments will work 7 The pnysies ufthe game B a iP iii S i an ll 7 At least one Wurnpus on board 39 39iiv 39Hv vii If fewer assignments 39i W quoti i e A must one Wurnpus on board tur any two squares one isnee nnril2 rules like w y w 7 Total or iii sentences containing 64 dis tin syrnbuls u it is harder for DPLL and WalkSAT Page 2

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.