23 views

Uploaded by yigit

Test

- NONLINEAR Bisection Method Example: f(x) = x^3+x^2-3x-3=0
- cnt Unit-01.pptx
- Numerical Analysis
- MAXIMA AND MINIMA
- Chapter 5
- 10-genericsA
- It depends on the context! A decidable logic of actions and plans based on a ternary dependence relation
- On The Optimality Of All-To-All Broadcast In k-ary n-dimensional Tori
- DOTNET Programming Concepts Difference FAQs-3
- 10.1.1.20.7778
- Motion Planning, Carnegie Mellon
- 5171180
- tut-2opt
- phics
- a4b andrew emrazian
- Slides - Constraint Programming
- Mody Institute of Technology and Science - FET_ Logic Programming With Prolog (Contd..
- Chapter 1 - Lesson 1
- The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
- Sapiens: A Brief History of Humankind

You are on page 1of 11

Instructor: Prof. Julia Hockenmaier

March 3, 2011

Your score

Question

Points Score

Search

11

Propositional logic

10

10

Constraint satisfaction

10

Total:

50

Solutions

[1 point]

(a) Assume you have been give the state space graph of a search problem, and you need to

define the corresponding search tree. How many nodes in the search tree correspond to

one node in the state space graph?

Solution: As many as there are paths from the initial state to the node. An infinite

number if there are loops.

[2 points]

(b) Fill in the following table to list the steps in which DFS traverses the search tree given in

figure 1 (bottom of page).

Step

0.

1.

2.

3.

4.

5.

Node Queue

A

B

D

G

H

E

{B,C}

{D,E,C}

{G,H,E,C}

{H,E,C}

{E,C}

{C}

Solution:

[2 points]

(c) Why is graph-search DFS complete (for problems with a finite set of states), but treesearch DFS is not?

Solution: Graph-search DFS does not get stuck in infinite loops because it keeps

track of visited nodes. So it will always terminate with failure or find a solution

whenever one exists.

A

B

D

G

Page 2/11

C

E

CS440/ECE448 Midterm

March 3, 2011

Solutions

[1 point]

(d) How do heuristic search techniques such as Uniform-Cost Search and A* search differ

from systematic search techniques such as DFS/BFS?

Solution: Heuristic search algorithms use a priority queue where items are sorted by

cost. Systematic search algorithms use a deterministic queuing function.

[1 point]

(e) How do the two heuristic search algorithms Uniform-Cost Search and A* search differ

from each other?

Solution: Uniform-cost considers only the cost to get from start to current state; A*

also considers the estimated cost of getting to the goal state.

[2 points]

(f) In the traveling salesman problem a list of cities (including one home city) and their

pairwise distances is given. The task is to find the shortest route that starts and ends in

the home city and visits all cities on the list exactly once.

Our salesman travels by plane, and can fly directly between any two cities on this list.

Flying distances obey the triangle inequality: flying from A to B is always shorter than or

equally long as flying from A to C and then from C to B.

If we define the home city as unvisited until we get back to it, is the distance to the nearest

unvisited city an admissible heuristic? Why?

Solution: Yes, because due to the triangle inequality it will never overestimate the

true distance.

[1 point]

(g) When does regular hill-climbing search fail to find the optimal solution?

Solution: If it gets stuck in a local maximum

[1 point]

(h) How does k-best hill climbing differ from random restart hill climbing?

Solution:

k-best: maintain k searches in parallel (always pick k best next options across

all k searches).

random restart: k independent searches from random positions.

March 3, 2011

CS440/ECE448 Midterm

Page 3/11

Solutions

[1 point]

(a) Is p p valid?

Solution: Yes.

[1 point]

Solution: In the models in which p = true and in the model where p = false and q =

true

[2 points]

[p (q r)]

...

...

...

...

(p q) (p r)

[p (q r)] p (q r)

(p q) (p r)

(p q) (p r)

(p q) (p r)

(p q) (p r)

[1 point]

Solution: A propositional variable (atomic formula), or the negation of a propositional variable (atomic formula).

[1 point]

Solution: A disjunction of literals

Page 4/11

CS440/ECE448 Midterm

March 3, 2011

Solutions

[1 point]

Solution: When it is a conjunction of clauses.

[1 point]

Solution: p q p

q

[1 point]

(h) Show how resolution can be used to derive a contradiction between p and p.

Solution: p p

0/

[1 point]

Solution: Show that is not satisfiable/derives a contradiction.

March 3, 2011

CS440/ECE448 Midterm

Page 5/11

Solutions

[2 points]

A. All birds that are not penguins fly.

Solution: x [bird(x) p(x)) f ly(x)]

or x [bird(x) [p(x)) f ly(x)]]

Solution: xyz[c(x) (p(y, x) p(z, x) z 6= y wp(w, x) (w = y

w = z))]

xyz[c(x) (p(y, x) p(z, x) z 6= y =

6 wp(w, x) (w = y w = z))]

[1 point]

Solution: A function D D from entities in the domain to other entities in the domain.

[1 point]

Solution: If all entities in the domain are in the set that is the interpretation of student.

[1 point]

Solution: If the entity that is the interpretation of John is in the interpretation of

student.

Page 6/11

CS440/ECE448 Midterm

March 3, 2011

Solutions

[1 point]

A. xP(x) yQ(x, y).

B. xP(x) Q(x, y)

Solution: No, neither is in prenex NF.

[2 points]

A. xyzP(x, y, z)

Solution: xzP(x, S(x), z)

B. yxzP(x, y, z)

Solution: xzP(x, S, z)

[2 points]

(g) Do the following sets of formulas unify? If they do, what is the most general unifier, and

what is the resulting unification instance? If they dont, give the reason. (Variables are

written as lowercase letters, constants as uppercase letters).

A. P(x, y, y) and P( f (C),C, v)

Solution: MGU = x/ f (C), y/C, v/y (0.5), result: P( f (C),C,C) (0.5)

B. P(x, f (x)), P(x, y), P(g(u), u)

Solution: no, there is a loop.

March 3, 2011

CS440/ECE448 Midterm

Page 7/11

Solutions

[1 point]

Solution: nodes = variables; edges: binary constraints

[1 point]

Solution: One hyperedge for each global constraint.

[1 point]

Solution: For each value in the domain of X there has to be a value in the domain of

Y such that the constraint between X and Y is obeyed.

[1 point]

Solution: A complete legal assignment (of values to variables).

[1 point]

Solution: When one variable has an empty domain.

Figure 2: In KenKen, the numbers in each set of cells (indiciated by a thicker border) have to be

combined using an arithmetic operation (e.g. ) to yield a result (e.g. 6). The Latin Square on the

right is a solution to the KenKen puzzle on the left.

+3

3

1 2 3

x6 x6

2 3 1

3 1

Page 8/11

3x3 KenKen

CS440/ECE448 Midterm

March 3, 2011

Solutions

[1 point]

(f) A Latin square (see Figure 2) is an n n table whose cells are filled with numbers from

1 to n in such a way that each row and column of the table contains each number exactly once. How do you formalize the task of generating a Latin square as a constraint

satisfaction problem?

Solution: Variables = cells. Domains = numbers from 1 to n. Constraints: one allDiff constraint for each row and column.

[1 point]

(g) What is the constraint graph for the Latin square task?

Solution: nodes/variables = boxes; edges: no two boxes in the same cell or row can

be equal (alternative: binarized allDiff)

[1 point]

(h) KenKen (see Figure 2) is a logic puzzle similar to Sudoku. The task is to find a Latin

square for an empty n n table. The twist is that the cells of this table are partitioned

into sets (indicated by a thicker border) whose numbers have to be combined by addition

or multiplication to yield a prespecified result. What are the additional global constraints

that KenKen introduces beyond the Latin square problem?

Solution: one global constraint for each box.

[1 point]

(i) How can the arithmetic constraints in KenKen be expressed in a constraint hypergraph?

(You do not have to draw a hypergraph).

Solution: One hyperedge for each arithmetic constraint

[1 point]

(j) How can the arithmetic constraints in KenKen be expressed in a constraint graph?

Solution: This requires the introduction of one auxiliary variable for each global

arithmetic constraint.

March 3, 2011

CS440/ECE448 Midterm

Page 9/11

Solutions

[2 points]

A. ... partially observable:

Solution: The sensors dont provide complete information about the environment

B. ... non-deterministic:

Solution: The actions have a non-deterministic effect on the environment.

C. ... dynamic

Solution: The environment can change on its own accord, even when

the agent does not perform an action.

D. ... episodic:

Solution: The agent has to react to a single percept (rather than a percept

sequence).

[1 point]

Solution: A predicate that can be true or false, depending on the situation/state

[2 points]

(c) What does the definition of an operator (e.g. move(x,y,z) (move x from y to z) consist of?

Solution: Preconditions (a set of fluents that have to be true for the operator to be

applicable) and effects (a set of fluents that will be true after the operator has been

applied).

[1 point]

Solution: The action is a ground instance of the operator (i.e.: all variables are replaced by constants.)

Page 10/11

CS440/ECE448 Midterm

March 3, 2011

Solutions

[1 point]

Solution: We need to know what remains true when we apply an action.

[1 point]

(f) How do Situation Calculus and STRIPS differ in how they solve the frame problem?

Which approach is better, and why?

Solution: Situation Calculus specifies which fluents remain the same, STRIPS specifies which fluents change. It is better/easier/more efficient to specify which fluents

change, because typically fewer things change than remain the same.

[1 point]

(g) The basic insight behind SATplan is that a plan of fixed length n can be translated into a

formula of propositional logic. Why is this always the case in classical planning?

Solution: Because in classical planning we always deal with a finite domain (database

semantics) as well as a finite number of operators and predicates, and thus have only

a finite number of possible actions and fluents.

March 3, 2011

CS440/ECE448 Midterm

Page 11/11

- NONLINEAR Bisection Method Example: f(x) = x^3+x^2-3x-3=0Uploaded bySherylDinglasanFenol
- cnt Unit-01.pptxUploaded byBhupesh Pandey
- Numerical AnalysisUploaded bygani_demiraj
- MAXIMA AND MINIMAUploaded byBilal Naseem
- Chapter 5Uploaded bysaroj
- 10-genericsAUploaded bylinktoanu
- It depends on the context! A decidable logic of actions and plans based on a ternary dependence relationUploaded byIvan José Varzinczak
- On The Optimality Of All-To-All Broadcast In k-ary n-dimensional ToriUploaded byijcsis
- DOTNET Programming Concepts Difference FAQs-3Uploaded byUmar Ali
- 10.1.1.20.7778Uploaded byРосен Пешев
- Motion Planning, Carnegie MellonUploaded bySarnesh7
- 5171180Uploaded byNiraj Bhansali
- tut-2optUploaded byPraveen Alevoor
- phicsUploaded byPapuna Chivadze
- a4b andrew emrazianUploaded byapi-240736473
- Slides - Constraint ProgrammingUploaded byDavid
- Mody Institute of Technology and Science - FET_ Logic Programming With Prolog (Contd..Uploaded byDevendra Kumar
- Chapter 1 - Lesson 1Uploaded byJustin Benitez

- 1.ShradhaReviewpaperUploaded byInternational Journal of Scholarly Research
- Paperless PayrollUploaded byMatthew Perry
- Pilot072016(Online)_Inst.pdfUploaded bySai Shanker
- 36-greedyUploaded byNicu Vlad Laurentiu
- 16-17748_-_1827_13th_Avenue_1829_13th_Avenue_1835_13th_Avenue_and_1837_13th_Avenue.pdfUploaded byRecordTrac - City of Oakland
- fa189ea833b35d2a79e4ac745dc0066f-applicationpdfUploaded bySezWicked
- Less06 Users MB3Uploaded byDaniel Tarabic
- Trump Presidency 12 - July 29, 2017 – August 11, 2017Uploaded byFW040
- Cory Doctorow - Little BrotherUploaded byWendy Baxter
- SP800-59Uploaded byPhuc V. Nguyen
- 2-El Paraiso PirataUploaded byMsrta Weber
- LinksUploaded byBogdan Bl15
- dbtranUploaded bysigids
- Unlock Dvr Hdd to Work on Pc Power-up in Standby PuisUploaded bydaljitjk
- Artillery Email AlertsUploaded byhani_sa
- Executive Summary of the Study on security of Supervisory Control and Data Acquisition (SCADA) systemsUploaded byINTECO
- f09maUploaded bywerwerwer
- Java MasterUploaded bySonia Girde
- SRS - City PoliceUploaded byAafi Qaisar
- FBI Files PDFUploaded bySharon
- Pakistan Tops List of Most Porn-searching Countries_ Google - The Express TribuneUploaded byuppaimappla
- Image RecognitionUploaded byShivam Agarwal
- atmUploaded byVivek Gupta
- ACC 444 Daily Schedule-Fall 2014-Garverick(1)Uploaded byBear Coopor
- ls_836Uploaded byMarko Quiroz
- My SeminarUploaded byBubli Kapoor
- problem solution essayUploaded byapi-286054033
- Computer Viruses Are Small Software Programs That Are Designed to Spread From One Computer to Another and to Interfere With Computer OperationUploaded byVinay Jain
- LabVIEW based Projects-1Uploaded byGangadhar Vukkesala
- Protecting Data at the Border ActUploaded bysam_rolley4112