15 Pages

ch03-search

Course: CSE 327, Spring 2012
School: Lehigh
Rating:
 
 
 
 
 

Word Count: 531

Document Preview

3 Ch. Search Supplemental slides for CSE 327 Prof. Jeff Heflin 8-Puzzle Transition Model 7 2 5 8 4 state s 6 3 1 actions a blank-right 7 2 5 6 8 3 blank-left 4 8 2 4 6 5 3 1 8 blank-down 7 5 1 7 blank-up RESULT(s,a) 4 7 2 4 2 6 5 3 6 3 1 8 1 8-puzzle Search Tree 7 4 8 6 3 7 2 5 initial state 1 7 8 6 5 3 1 7 7 2 4 6 5 8 6 5 4 4 8 2 2 3 1 2...

Register Now

Unformatted Document Excerpt

Coursehero >> Pennsylvania >> Lehigh >> CSE 327

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
3 Ch. Search Supplemental slides for CSE 327 Prof. Jeff Heflin 8-Puzzle Transition Model 7 2 5 8 4 state s 6 3 1 actions a blank-right 7 2 5 6 8 3 blank-left 4 8 2 4 6 5 3 1 8 blank-down 7 5 1 7 blank-up RESULT(s,a) 4 7 2 4 2 6 5 3 6 3 1 8 1 8-puzzle Search Tree 7 4 8 6 3 7 2 5 initial state 1 7 8 6 5 3 1 7 7 2 4 6 5 8 6 5 4 4 8 2 2 3 1 2 4 7 2 4 7 6 5 8 6 5 3 1 8 5 3 1 3 3 2 1 7 2 4 7 2 4 6 8 4 5 8 6 5 8 6 3 1 3 1 1 Tree Search Algorithm function Tree-Search(problem) returns a solution, or failure initialize the frontier using the initial state of problem loop do if the frontier is empty then return failure choose a leaf node and remove it from the frontier if the node contains a goal state then return the corresponding solution expand the chosen node, adding the resulting nodes to the frontier From Figure 3.7, p. 77 Problem Solving Agent Algorithm function Simple-Problem-Solving-Agent(percept) returns an action persistent: seq, an action sequence, initially empty state, some description of the current world state goal, a goal, initially null problem, a problem formulation state Update-State(state,percept) if seq is empty then goal Formulate-Goal(state) problem Formulate-Problem(state,goal) seq Search(problem) if seq = failure then return a null action action First(seq) seq Rest(seq) return action From Figure 3.1, p. 67 a c t i o n s / s u c c e s s o r f Water Jug Problem state: <J12, J8, J3> initial state: <0, 0, 0> goal test: <1, x, y> x and y can be any value path cost: 1 per solution step? 1 per gallon of water moved? Depth-first Search 1 A not generated on frontier 2 7 B in memory deleted 3 E 5 H 8 6 D 4 C I 9 F G Breadth-first Search 1 A not generated on frontier 2 3 B in memory deleted 4 5 D 8 6 E 9 H C I 7 F G Uniform Cost Search State space Search tree 10 I 4 1 G B C g(n)=0 5 3 I 2 B g(n)=4 G not frontier in generated on memory deleted 4 3 C g(n)=7 G g(n)=9 g(n)=10 Repeated States State space A Search tree B A C G B initial state goal state A B C C C A B A G B G Uninformed Search Summary depth-first breadth-first uniform cost queuing add to front (LIFO) add to back (FIFO) by path cost complete? no yes yes, if all step costs are greater than 0 optimal? no yes, if identical step yes, if all step costs costs are greater than 0 time expensive expensive expensive space modest expensive expensive A* Example Use A* to solve the 8-puzzle: initial state: 1 4 7 2 6 5 3 8 goal state: 1 4 7 2 5 8 3 6 path cost is the total number of moves made Consider these heuristics H1: The number of tiles out of place H2: Sum of distances of tiles from goal positions Ignore moves that return you to the previous state A* on 8-puzzle 1 Heuristic = H1 2 123 4 8 765 123 468 7 5 f=2+3=5 Whether or not this node is expanded depends on how you break ties. It could be expanded at any time or not at all. 123 468 75 f=0+3=3 3 f=1+3=4 123 46 f=1+3=4 758 123 468 75 1 f=2+4=6 3 f=3+3=6 426 758 4 123 4 6 758 123 46 f=2+2=4 12 f=2+4=6 463 758 f=3+3=6 5 1 2 3 f=3+1=4 456 7 8 758 123 456 78 f=4+2=6 6 1 2 3 f=4+0=4 456 78 A* on 8-puzzle Heuristic = H2 123 468 7 5 1 123 468 75 f=0+4=4 2 f=1+5=6 123 46 f=1+3=4 758 3 1 3 426 758 f=3+3=6 123 4 6 758 123 46 f=3+3=6 12 f=2+2=4 f=2+4=6 463 758 4 1 2 3 f=3+1=4 456 7 8 758 123 456 78 f=4+2=6 5 1 2 3 f=4+0=4 456 78 Summary of Search Algorithms type ordering optimal? complete? efficient? depth-first uninformed LIFO no no if lucky breadth-first uninformed FIFO yesa yes no uniform cost uninformed g(n) yesb yesb no greedy informed h(n) no no usually A* informed g(n)+h(n) yesc yesb yes a if step costs are identical b if step costs > 0 c if heuristic is admissible and consistent
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Lehigh - CSE - 327
Ch. 5 Adversarial SearchSupplemental slides forCSE 327Prof. Jeff HeflinTic-Tac-Toe Transition ModelXOO to top-leftO totop-centerOXOXOXO tobottom-centerO totop-rightOXOXXOXOOXXOXOXXOXOOXMinimax Algorithmfunction Mi
Lehigh - CSE - 327
Ch. 7 Logical AgentsSupplemental slides forCSE 327Prof. Jeff HeflinGoal-Based AgentsensorsStateHow the world evolvesWhat the worldis like nowWhat it will be likeif I do action AGoalsEnvironmentWhat my actions doWhat action Ishould do nowA
Lehigh - CSE - 327
Ch. 8 First Order LogicSupplemental slides forCSE 327Prof. Jeff HeflinSyntax of First-Order LogicSentence AtomicSentence | ComplexSentenceAtomicSentence Predicate(Term,)| Term = TermComplexSentence (Sentence) | Sentence| Sentence Sentence| Sente
Lehigh - CSE - 327
CSE 327, Spring 2012Homework #1: Chapters 1, 2, 3The following exercises are due at the beginning of class on February 3. Each exercise will begraded for correctness, so please start early and be sure you are confident in your answers. Also,remember t
Lehigh - CSE - 327
Homework #1: Chapters 1, 2, 31. [15 pts., 5pts. each part] These answers are just examples, and there is actually quite a lot oflatitude in terms of what could be correct. The important criteria are that performancemeasures can be quantified, that the
Lehigh - CSE - 327
CSE 327, Spring 2012Homework #2: Chapters 3 and 5The following exercises are due at the beginning of class on Wednesday, February 15. Thisassignment includes an extra-credit assignment worth up to an additional 20 points.1. [15 points] Use greedy best
Lehigh - CSE - 327
Homework #2: Chapters 3 and 51. [15 pts.]1h(n) = 345Vaslui4Urziceni2h(n) = 302h(n) = 298Iasi5Bucharesth(n) = 253Hirsova3h(n) = 237Neamth(n) = 385Giurgiuh(n) = 272Pitesti6Fagarash(n) = 96h(n) = 16271h(n) = 0Sibiu2. [15 pts.]1
Lehigh - CSE - 327
CSE 327, Spring 2012Homework #3: Chapters 7 and 8The following exercises are due at the beginning of class on Monday, February 27.1. [20 pts.] Consider a knowledge base KB that contains the following propositional logicsentences:PRQP RQRa) Constru
Lehigh - CSE - 327
CSE 327, Spring 2012Midterm Study GuideMidterm Time and Place: Wednesday, February 29, 1:10pm 2pm Packard 466 (our usual room)Format:The test will be held in class. You can expect the following types of questions: true/false, short answer,and small
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 6This assignment develops an animation in which a ball drops due to gravity, and (with somefurther work) bounces back again.First we need to set up a canvas and a bounding box, which can be achieved using the following
Catholic University of America - CSC - 113
CSC 113Midterm Project: Class AverageAssigned: October 15, 2010Due: October 29, 2010Objective:To test your knowledge of loops, strings, matrix references, and processing data inmatrices as well as introducing the concepts of cell arrays and reading
Catholic University of America - CSC - 113
C SC 113H om ew ork 5Assigned: November 12, 2010Due: November 19, 2010Directions: Write ONE script file that solves all of the following problems. Only the answersshould be output to the command window.1) Plot the following data (using markers, i.e.
Catholic University of America - CSC - 113
CSC 113Homework Assignment 1Assigned September 13, 2010;Due September 20, 2010.1. You are constructing a hemispherical dome with an outer radius of 50 feet. The walls willbe solid concrete 8 inches thick. How many cubic yards of concrete will be need
Catholic University of America - CSC - 113
CSC 113Homework Assignment 2PLOTS!Assigned September 20, 2010;Due September 27, 2010.1. Basic function plots:(a) Plot the function f (x) = ex over the interval 0 x 10. (Hint: in MATLAB, ex isexpressed as exp(-x).)(b) Plot the function f (x) = ex c
Catholic University of America - CSC - 113
CSC 113Homework Assignment 3Assigned September 27, 2010;Due October 4, 2010.1. Write a MATLAB function le that computes a plots 5 cycles of a sine wave as a functionof time:y(t ) = A sin(2 f t + ).The inputs to this function should be: (i) the ampl
Catholic University of America - CSC - 113
C SC 113H om ew ork 4Assigned: October 4, 2010Due: October 12, 20101) The purpose of this assignment is to make use of newly learned conditional statementsand for loops in analyzing a matrix of integers. Two text files will be available on theclass
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 21. From the MATLAB command line, dene the following vector and matrix variables:(a)1 2.3 4.0 v1 = 5.6 9.0 12(b)v2 = [ 12(c)12 1iv3 = sin(120 )99.1 + 6i 771.2912 e14i 3.24.58.19.04ln(12)3
Catholic University of America - CSC - 113
CSC 113Lab Assignment 31. Write a MATLAB script le that computes and plots 5 cycles of a sine wave as a functionof time.Assume the sine wave has a frequency of f = 100 Hz, an amplitude of A = 0.9, and aphase angle of = 45 degrees. The equation of the
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 41. Write a M ATLAB function le that computes the factorial of a positive integer. The factorialof an integer N isN ! = N (N 1) (N 2) 2 1For example, 5! = 5 4 3 2 1 = 120 and, by convention, 0! = 1.Your program shoul
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 51. Write a M ATLAB function le that that sorts a vector of numbers from the smallest to thelargest, without using the M ATLAB sort command.The input to the program should be a vector containing the values to sort, and
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 7All example functions or scripts below should be created in your editor and saved to your workspace,so that you may run them.1. Consider the following M ATLAB function which accepts a two-element vector, and plots it
Catholic University of America - CSC - 113
CSC 113, Fall 2010Lab Assignment 8The various commands below are to be typed into the command window; observe their outputs.1. Projectile trajectory! From basic physics, the x and y displacements of a projectile red atan initial velocity v0 with an an
Catholic University of America - CSC - 113
CS113Introduction to Computer Programmingfor EngineersIntroduction1Course IntroductionLearningObjectivesHow we willadminister thisclass2Outline Purpose of this class What do we want you to learn? Lessons for this class? SummaryWhat is the
Catholic University of America - CSC - 113
CS113 Introduction to Computingfor EngineersIntroduction to Matlab1How and why do engineers need computers tosolve problems? We all know that engineers (as well as everyone else)use computer to communicate (email), write reports(word processing),
Catholic University of America - CSC - 113
Rules About Variables15Rules About Variables16Predefined Variables17Some Useful Commands18The ; and % operators19Big deal, a calculators $20 Matlab is a fully-functional programming language This means we get variables name = value Name can
Catholic University of America - CSC - 113
Array Examples16Scalar array addition and subtraction17Scalar array multiplication and division18Array array addition and subtraction19Arithmetic Operations with Arrays20Arithmetic Operations with Arrays21Arithmetic Operations with Arrays22M
Catholic University of America - CSC - 113
CS113 Introduction to Computingfor EngineersPlots and Graphs I1Background While numerical methods are the heart (and origin) ofMatlab, graphics has become the major component sincethe release of Version 4. Version 6 adds to this legacy with refine
Catholic University of America - CSC - 113
CS113 Introduction to Computingfor EngineersMATLAB: Script and Function Files1MATLAB Script Files A MATLAB script file (Called an M-file) is a text (plainASCII) file that contains one or more MATLABcommands and, optionally, comments. The file is s
Catholic University of America - CSC - 113
CS113 Introduction to Computingfor EngineersLogical Operators and ConditionalStatements1Programming in Matlab2Programming in Matlab3Programming in Matlab4Programming in Matlab5Programming in Matlab6Programming in Matlab7Programming in Mat
Catholic University of America - CSC - 113
CS113 Introduction to Computingfor EngineersIteration1REVIEW FROM LAST LECTURE2REVIEW FROM LAST LECTURE3REVIEW FROM LAST LECTURE4REVIEW FROM LAST LECTURE5REVIEW FROM LAST LECTURE6CONDITIONAL STATEMENTS APPLIED TOMATRICES&gt; A = [ 0.5, 6.0, -
Catholic University of America - CSC - 113
CSC 113Lecture 9StringsStrings A s tr i n g i s a n a r r a y o f c h a r a c te r s s = 'abc'is equivalent to s = [ 'a' 'b' 'c' ] A l l o p e r a ti o n s th a t a p p l y to v e c to r s a n da r r a y s c a n b e u s e d to g e th e r w i th s
Catholic University of America - CSC - 113
CS113IntroductiontoComputingforEngineersFormattingData,CellArraysandCaseStructureFormattingData(#sand/orstrings) Thefprintf(format,data)function 0 integer %5dInteger,minimumwidth=5 0 floatingpointformat %4fFloatingpoint,minimumwidth=4 %6.3f Fl
Catholic University of America - CSC - 113
The switch StatementTHE switch STATEMENT: Provides a convenient way to executeconditional code when there are manycases to choose from. This construct can replace series of ifelse-end statementsLOGICAL PROGRAMMINGCONSTRUCTSSYNTAX:switch expressio
Catholic University of America - CSC - 113
CS113Introduction to Computingfor EngineersCurve Fitting and ApproximationAPPROXIMATIONOF DATALeast Squares Method of Curve FittingFitting Data to a Curve: Determining a physicalparameter (e.g. spring constant)x Data points (xi, Fi) can be appro
Catholic University of America - CSC - 113
EXAMPLE PROJECTHANGMANThe goal of this project was to write a graphically based game of hangman using Matlab. The computer program opens a figure window, sets the axes properly and thendraws the &quot;hangman&quot; gallows. The computer loads a dictionary of w
Catholic University of America - CSC - 113
CS 113Linear Systems of EquationsLinear Algebraic EquationsNonlinear Equations: ExampleRepresenting Linear Algebraic Equationsin Matrix FormAx = bRepresenting Linear Algebraic Equationsin Matrix FormAx = b a11a21A= Man1a12a22Man 2L a1n
Catholic University of America - CSC - 113
C SC 113M id t e r m P r o j e c t : M a t h P r a c t ic e P r o g r a mA s s ig n e d : O c to b e r 1 5 , 2 0 1 0D u e : O c to b e r 2 9 , 2 0 1 0O b je c tiv e :T o te s t y o u r k n o w le d g e o f lo o p s , s trin g s , c o n d itio n a l s
Catholic University of America - CSC - 113
MATLAB Graphics 101CSC 113Objects~There are several different types of object inMATLAB, but the ones were primarilyconcerned with will text objects and patchor fill objects.~An object is graphical image created withinthe axes of a figure window.F
Catholic University of America - CSC - 113
StarterYahtzee prototypeProject Outlines:Yahtzee and CheckersCSC 113Fall 2010Checkers prototypeStarterYahtzee prototypeCheckers prototypeGaphic user interfaces can be built a couple of ways in Matlab:Manual coding;Using GUIDE (Graphic User Int
Catholic University of America - CSC - 113
CSC 113: Saving Plots and Graphics in MatlabThis document covers the basics of saving a gure created in M ATLAB, so that it may be used insome other setting, such as a web page, written report, or overhead presentation.First, lets create a gure. The fo
Catholic University of America - CSC - 113
Symbolic ComputationsCSC 113Fall 2010Conventional ComputationsMatlab was designed to execute serial computations:value = expression;For example, suppose we haveD = D0 eQ/RTIf we know the values on the right-hand side, we can calculate D:&gt;&gt;&gt;&gt;&gt;
Catholic University of America - CSC - 113
C SC 113M id t e r m P r o j e c t : T r a j e c t o r yA s s ig n e d : O c to b e r 1 5 , 2 0 1 0D u e : O c to b e r 2 9 , 2 0 1 0O b je c tiv e :T o te s t y o u r k n o w le d g e o f lo o p s , f ig u re s , p lo ttin g , a n d g ra p h ic sA
City Colleges of Chicago - MATH - 207
Calculus Cheat SheetCalculus Cheat SheetDerivativesDefinition and Notation f ( x + h) - f ( x) If y = f ( x ) then the derivative is defined to be f ( x ) = lim . h 0 h If y = f ( x ) then all of the following are equivalent notations for the derivativ
City Colleges of Chicago - MATH - 207
1.1Review of FunctionsDefinition of a FunctionTheorem: Vertical Line TestA set of points in the xy - plane is the graph ofa function if and only if a vertical lineintersects the graph in at most one point.yxNot a function.yxFunction.SummaryI
City Colleges of Chicago - MATH - 207
LimitsChapt. 22.1The Idea of LimitsObject motion in gravity field:Average velocities over timeSlide 2 - 3Slide 2 - 4Object motion in gravity field:Instantaneous velocity at a given timeSlide 2 - 5Limit of Average velocityInstantaneous velocity
City Colleges of Chicago - MATH - 207
3.1The DerivativeSlide 3 - 2Slide 3 - 3Slide 3 - 4Slide 3 - 5Slide 3 - 6Slide 3 - 7Slide 3 - 8Slide 3 - 9Slide 3 - 10Slide 3 - 11Slide 3 - 12Slide 3 - 13Slide 3 - 14Slide 3 - 15Slide 3 - 16(or a cusp)Slide 3 - 17Slide 3 - 183.2Rules o
City Colleges of Chicago - MATH - 207
4.1Maxima and MinimaSlide 4 - 2Slide 4 - 3Practice!Define all local and absolute extrema of the graph belowSlide 4 - 4Slide 4 - 5Examples:Slide 4 - 6Slide 4 - 74.2What Derivatives Tell UsFirst derivative and shape of functionSlide 4 - 9Slid
City Colleges of Chicago - MATH - 207
Chapter 5Integration5.2Definite IntegralsSlide 5 - 3Slide 5 - 4Slide 5 - 5Slide 5 - 6Slide 5 - 7Slide 5 - 8Slide 5 - 9Slide 5 - 10Slide 5 - 11Slide 5 - 12Slide 5 - 13Slide 5 - 14Slide 5 - 15AreaSlide 5 - 16Slide 5 - 17Slide 5 - 18Slid
City Colleges of Chicago - MATH - 207
Chapter 6Applications ofIntegration6.1Velocity and Net Change6.2Regions Between Curves
City Colleges of Chicago - MATH - 207
M207Prof. OugouagHandout:GUIDELINES FOR SOLVING OPTIMIZATION PROBLEMS1. Read each problem slowly and carefully. Read the problem at least three times before trying to solveit. Sometimes words can be ambiguous. It is imperative to know exactly what th
City Colleges of Chicago - MATH - 207
MATH 207Graphs and Functions(Review)Distance FormulaExample: Find distance between (-1,4) and (-4,-2).Answer:6.71Midpoint FormulaExample: Find the midpoint from P1(-5,5) to P2(-3,1).Answer: (-4,3)Equations in two variables Example: Circle Equat
City Colleges of Chicago - MATH - 207
Math 141, Math 207Handout TrigDr. OugouagThe Unit circleAnglesinradiansanddegrees.Betweenparenthesesarethevalues(cos(),sin()ofeachangle.
City Colleges of Chicago - MATH - 207
Formulas and IdentitiesTrig Cheat SheetDefinition of the Trig FunctionsRight triangle definitionFor this definition we assume thatp0 &lt; q &lt; or 0 &lt; q &lt; 90 .2Unit circle definitionFor this definition q is any angle.y( x, y )hypotenuseyopposite
City Colleges of Chicago - MATH - 141
Conic Section FormulasParabola:y = a(x-h)2 + kIf a &gt; 0, opens upIf a &lt; 0, opens downVertex: (h, k)Focus: (h, k+p)Directrix: y = k-pAxis of Symmetry: x = hx = a(y-k)2 + hIf a &gt; 0, opens rightIf a &lt; 0, opens leftVertex: (h, k)Focus: (h+p, k)Di
City Colleges of Chicago - MATH - 141
MATH 141Chapter 1:Graphs and Functions(Review)1.1Distance FormulaExample: Find distance between (-1,4) and (-4,-2).Answer:6.71Midpoint FormulaExample: Find the midpoint from P1(-5,5) to P2(-3,1).Answer: (-4,3)1.2Equations in two variables Ex
City Colleges of Chicago - MATH - 141
Section 2.1Angles and Their Measure(a) Convert 4510'15&quot; to decimal in degrees.Round the answer to four decimal places.(b) Convert 21.256 to the DM'S&quot; form.Round the answer to the nearest second.Radians(a) 80(b) 140(c) -30(d) 1002(a)radians3
City Colleges of Chicago - MATH - 141
Section 2.2Trigonometric Functions(Unit Circle Approach)Recall:Arc length t = r. t (angle t in radians)Here r = 1 so t = ty1P(x,y)ytt-11xxBy definition, the coordinates of pointP are:X = cos tY-1= sin t 1 2 6Let t be a real number a
City Colleges of Chicago - MATH - 141
Section 2.3Properties of theTrigonometric FunctionsThe Range of the Six Trigonometric Functions(a) sin 39019(b) tan4(c) cos ( 7 )If sin &gt; 0 and cos &lt; 0, name the quadrant in which theangle lies.103 10Given sin =and cos =,1010find the val
City Colleges of Chicago - MATH - 141
Section 2.4 &amp; 2.5Graphs of Trig FunctionsAmplitude and PeriodDetermine the amplitude and period of y = 4 cos (3x)Graphy = 4 sin (2x)using key points.You practice!Graph y = 5cos 2x using key points.y54321x65432111234562345
City Colleges of Chicago - MATH - 141
Section 2.6Phase ShiftFind the amplitude, period and phase shift ofy = 5 sin ( 2 x + 5 ) and graph the function.Find the amplitude, period and phase shift ofy = 3 cos ( 4 x + ) and graph the function.
City Colleges of Chicago - MATH - 141
Section 3.1The Inverse Sine, Cosine,and Tangent FunctionsReview of Properties of Functions and Their InversesFind the exact value of: sin1322Find the exact value of: sin 21Find an approximate value of:3(a) sin51 2(b) sin 31(a) sin s