Problem Solving Basics What is a problem, that is how do we give a general defnition? What do we do when solving a problem problem? ? They o oten ten occur in a characteristic sequence !"# $ind the problem% !&# 'epresent the problem% !(# Plan the solution% !)# *arry out the plan% !+# valuate the solution% !-# *onsolidate the gains%
&
Problem Solving Basics .nternal and /ternal /t ernal repr representation% esentation% .nternal representations include !a# goal state !b# initial state !c# operators !d# restrictions or constraints on operators T0 $1'2'3S $1'2'3S 4.5221 1 armer needed to cross a river with his o/, goose goose,, and some corn% corn% 0e had a boat that would carry him and one possession at a time% 0is tas6 was to get everything acr across oss the river, 6nowing that the o/ would eat the goose, and the goose the corn corn i he ever let them alone% 0ow can can he accomplish his tas6?
(
Problem Solving Basics $orming an internal representation% People Peopl e are pretty good a recogni7ing recogni7ing or selecting relevant inormation, particularly when they they can identiy the problem type% We use 6nowledge 6n owledge !language, world# to interpret problem inormation and may ma6e ma6e inerences% This is requently done automatically% $ather, ather , mother, son, and a baby are in a room% room% $ather says 8Pedro, 8Pedr o, 9uanita is crying, please change her he r%8 What do we iner, !"# $ather $ather tal6ing to son%! !&# Baby is emale% !(# Baby is crying and needs change% !)# 8*hange8 reers to changing the diaper diaper%% !+# The amily is probably Spanish or 2e/ican%
)
Problem Solving Basics We ma6e use o 1nalogies : Schemas% !"# 1nalogies, or e/ample, 'utherord3s analogy% !&# Problem schema is a pac6age o inormatio inormation n about the properties o o a particular problem problem type% S6ill may depend depend on the store o pr problem oblem schemas schemas%! %! ;r consider the 8optimist stories8 as e/amples o the misuse o problem schemas% There are many individual di<erences in internal pr problem oblem representations%
+
Problem Solving Basics /ternal Problem 'epresentations !1n illustration o the power o matri/ representation# 4ic6ens, instein, $reud, $reud, and =ant 4ic6ens, instein, $reud, $reud, and =ant are proessors o nglish, ng lish, Physics, Psychology, and Philosophy !but not necessarily respectively#% !"#% 4ic6ens and $ $reud reud wer were e in the audience when the psychologist delivered his frst lecture% !&#% Both instein and the philosopher wer were e riends o the phy physicist% sicist% !(#% The philosopher has attended lecture lectures s by =ant and 4ic6ens% !)#% 4ic6ens has never heard o $reud% !+# The tas6 is to match the proessors to their felds% !this matri/ that can be used as an e/ternal representation to solve the problem# nglish
Physics
Psychology
Philosophy
4ic6ens instein $reud =ant
The idea here is to put an 8>8 in each bo/ to indicate which combinations are ruled out%
-
Problem Solving Basics 0ow we represent represent a problem can be critical% critical% We sometimes add constraints that are not given by the problem itsel itsel%% %% Three mechanisms are generally suggested suggested that may aid in the constructing o a new internal representation% "% Wor6ing bac6ward% &% 0ypothetical reasoning% T Truthtellers ruthtellers and liars problem% problem% ou are iin n a oreig oreign n country, are lost, and need directions directions%There %There are two 6inds o people in this country, truthtellers, who always tell truth, and liars who always lie% ou see two men some distan distance ce away and as6 8are you truthsayers or liars%8 $irst person mumbles something, but you cannot hear% hear% Second says, 8he says he is a truthteller, and so am .%8 *an you trust the directions given by the two? 0ypothesis 0ypothe sis Suppose the frst is liar liar%% 0ypothesis . the frst is a truthteller he will also say is truthteller%
D
Problem Solving Basics (% @ap flling flling d decisions ecisions in ill defned problems% problems% When told or e/ample, get mother a present, but not more than &A dollars% ;r when we are told to write a ournal article% S1'*0 Problem sp Problem space ace 1ll the m move ove sequences available to the problem solver constitute the problem problem space% . you thin6 o a ma7e, this includes blind alleys as well as paths that lead to solution% Si7e *onsider a tr tree ee ma7e !one with no lloops#% oops#% The si7 si7e e o a tree ma7e is the total number o paths path s rom top to bottom% Si7e is equal to the Branching degree to the power o length% S C B5% *onsider a standard standard chess game% )A moves with &A alternatives each% Si7e is & &A A to the )Ath or "A to the "&Ath%
I
Problem Solving Basics Earieties o search "% Trial and error &% Pro/imity Pro/imity method methods s (% $ractiona ractionation tion metho methods ds )% =nowledge based methods .% Trial and error, blind or systema systematic% tic% Blind means you may repeat paths% Systematic, means only e/plor e/plore e une/plo une/plored red paths% gg problem, +A eggs, one brown, )F white% 2ust fnd the br brown% own% Blind search, with replacement% Systematic search, with nonreplacement% nonreplace ment% Trial and error is only eGcient or small problem spaces% &% Pro/imity Pro/imity method methods% s% Basically you loo6 one step ahead ahead%% Hsually useul i there is only one operator% 0ill climbing% ou step up, ta6e a step, otherw otherwise ise ta6e a quarter turn, and try again%
F
Problem Solving Basics 2eansJends analysis% "% $irst, fnd a di<erence between current state and goal state% &% Second, fnd fnd an operator to redu reduce ce di<erence between current and goal state% . no operator c can an be ound, g go o to ne/t di<erence% (% . you cannot apply an operator, see i you c can an fnd a way to reduce the di<erence so the operator can be applied% 1dvantage over hil hilll cl climbing% imbing% !"# * ou ou can consider consider many dimensions o di<er di<erence ence between start : goal% !&# ou can set sequence o subgoals% ...% $ractioni7ation methods% Hse these pr procedures ocedures to set subgoals% *onsider the importance o setting subg subgoals oals . there are & alternatives, and "A choice points at each e ach C & "A C "A&)% . subgoal at +th choice point then & to the +th C (& alternatives plus & to the +th more C (& or total -) vs "A&)%
"A
Problem Solving Basics $our methods or identiying subgoals "% Wor6ing into the pr problem% oblem% See what alternatives are availa ble easily available easily%% Then you need to decide what route route loo6s more promising% &% 1naly7ing 1naly7in g the goal% *onsider Tower o 0anoi% But what is the hardest subgoal to achieve? See what the problem problem confguration must loo6 li6e li6e in order to achieve th the e various subgoals% (% 1bstracting% .nvolves three steps !"# 4rop one or more o the constraints in the frst problem problem%% 1bstract ro rom m the original probl problem em to yield a mor more eg general eneral problem% problem% !&# Solve the more more general, less constrained problem problem%% !(# 1dapt the solution so that it fts the th e constraints o the original probl problem% em% )% Hsing 6nowledge o problem schemas to identiy subgoals% *onsider writing a ournal article%
""
Problem Solving Basics HS.K@ =K;W54@ .K P';B52 S;5E.K@ 5earning 5earni ng solution paths% . you 6now you must travel the same path many times, you learn a little each time you travel the ma7e% 5earning solution strategie strategies% s% $inding au/iliary problems may provide a way to search or and learn appropriate solution strategies% 'educing 'educing the nu number mber o elements in the problem wor6s sometimes% sometimes% This di<ers di<ers r rom om abstraction, because we ocus on learning methods and strategies to solve a whole class o problems% Pattern matching prime e e/ample /ample is chess masters% .t was commonly believed that when chess masters chose a move, they either e/amined mor more e alternatives than wea6er players or e/amined the alternatives in greater depthLLloo6ed urther ahead% But de @r @root oot ound that both masters and wea6er players e/amine (A L +A moves, and both search to a depth o & or ( moves on average%
"&
Problem Solving Basics de @root noticed that i chess masters loo6 loo6ed ed at a chess position or only a ew seconds, they remembered ar better than wea6er players% Their superior ability was due to their superior 6nowledge o chess% "% *hess masters can remember brieMy e e/posed /posed chess positions because they have a large number o chess patterns patte rns stored in memory memory%% The master remembers a chess position as a combination o a small number o large patterns, the wea6er player tries to remember a chess position as a large number o smaller patterns% &% 2asters have between "A,AAA and "AA,A "AA,AAA AA chess patterns stored in memory% memory% They use these to select better moves than wea6er wea6er players% They rec recogni7e ogni7e patterns rom earlier games they played played or read about% They rrecogni7e ecogni7e that, or e/ample, 8;h, this is lie @ame ( or $is $ischer cher versus Spass6y%8 Spass6y %8 This tells them, or suggests to them, what move will be successul%
"(
Problem Solving Basics $or some classes o problems there are procedures which, i correctly corre ctly applied, are guaranteed to yield the right solution% These are called algorithms algorithms%% Search algorithms algorithms 1re g guaranteed uaranteed to yield s solution olution i i applied properly% properly% 1 ma7e algorithm, when you ente enterr the ma7e you will always be able to fnd the e/it, long division, split hal%
")
Problem Solving Basics PLANNING
Planning involves a search process carried out in some representation o the world% Planning, search, search, and e e/ecution /ecution are separate processes% $or e/ample, use a rroadmap oadmap to plan a trip% The tas6 enviro environment nment involves the rreal eal physical world% The plan may be isomorphic isomorphic to the move sequence used to solve the problem, or it may be s6etchier%
"+
Problem Solving Basics Planning consists o three steps "% 'epresent the real tas6 in a planning environment% &% /plore /plore the planning environment environment to fnd a way to so solve lve the problem problem%% (% Select a solution path%
"-
Problem Solving Basics W0 P51K "% 'eversibility eversib ility ou can reverse your move in the plannin planning g environment, but not the real world% &% conomy ou can e/plore and elimina eliminate te blind alleys% ou can also compare di<erent routes or paths ine/pensively% (% $le/ibility $le/ibility ou may represent the planni planning ng environment environmen t in a variety o di<erent ways, or e/ampl e/ample, e, try wor6ing bac6ward rom the goal on a roadmap% /ecuting the solution solution plan% This is by no means triv trivial, ial, because requently we must modiy modiy the plan% The plan may be modifed or abando abandoned ned entirely entirely%% /ecuting the solution plan may lead to new planning%
"D
Problem Solving Basics valuate the solution% ;nce the solution is obtained it is important to reLe/amine all the goals and conditions set by the problem to be sure the solution satisfes the problem% problem% Solve the ollowing "% There are are ( separate, equalLsi7e bo bo/ed, /ed, and inside each bo/ there are & separate small bo/es, bo/es, and inside each o the small bo/es there are ) even smaller bo/es% 0ow many bo/es all together? 1% &) b% "( c% &" d% (( e% some other number &% Ten ull crates o walnuts weigh )"A lb% while an empty crate weighs "A lb% 0ow m much uch do the walnuts alone weig weigh? h? a% )AA b% (FA c% ("A d% )&A (% Three empty cereal bo/es bo/es weigh F o7s% and each bo bo/ / holds "" o7s o cereal% 0ow much do & ull bo/ bo/es es o cereal weigh together? "% &A b% )A c% ") d% &I e% "+ )% *ross out the letter a ater ter the letter ion the word seldom seldom which is in the same position in the word as it is in the alphabet%
"I
Problem Solving Basics *;KS;5.41T.;K Sometimes when a diGcult problem is solved we are tempted to say 8whew, .3m glad . fnished that8 and go on to more rela/ed rela/ ed things% But this is when consolidation should ta6 ta6e e place% "% Why was the problem problem diGcult? &% 0ow did did . f fnd nd the appr appropriate opriate rep representation? resentation? (% Was it diGcult to 6 6eep eep my place in the problem? )% Was it hard to fnd a solution method method? ? +% Was there a detour? -% 4id . ma6e alse as assumptions? sumptions? D% What mista6es did . ma6e? I% 4id . ma6e ma6e discoveries about repr representations, esentations, methods, detours? F% . so, how did . ma6 ma6e e them? "A% 1re there other similar problems, problems, could they be solved the same way? 2a6e it a habit ha bit to consolidate immediately ater problem solution, and you can ta6e advantage o a wealth o inormation that would otherwise be lost to you%