C_work_280sol11 - Solutions to Homework 11 3.1 3 We define a “state” as a possible configuration of the puzzle e.g reading clockwise from top

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions to Homework 11 May 10, 2007 3.1, 3 We define a “state” as a possible configuration of the puzzle, e.g., reading clockwise from top left corner, { 1 , 2 , 3 ,ϕ i , where ϕ is the empty slot. Thus, for example, the initial configuration (shown on the left in the problem) is h 1 ,ϕ, 3 , 2 i ; the final configuaration is h 3 ,ϕ, 2 , 1 i . There are 4! = 24 states (one for each of the possible orderings of 1 , 2 , 3 ,ϕ ). For two states to be adjacent, one must be reachable from the other in exactly one move. Thus, for example, h 1 , 3 ,ϕ, 2 i is adjacent to h 1 ,ϕ, 3 , 2 i (and vice versa). I won’t bother drawing the state graph (it’s too painful to do it online—most of you got the right idea anyway.) From the graph, it is almost immediate that the shortest path to get from the starting point, to the end is of 4 moves. This path gives a way of solving the game. Comment: Note that only half of the possible configurations are reachable from the initial configuration. That’s true in general in puzzles like this. If you were to physically switch the 1 and the 2, you wouldn’t be able to solve the puzzle. 3.1, 27(b) In any tournament on 5 vertices, there have to be exactly C (5 , 2) = 10 edges, since there’s one edge between every pair of distinct vertices. Since the edges are directed, each edge contributes 1 to the sum of the outdegrees (and one to the sum of the indegrees). Thus, the sum of the outdegrees must be 10. That means there can’t be a tournament with outdegrees 3, 2, 2, 2, and 2, since the sum of these outdegrees is 11. 3.1, 29(a) Let v be the root and v any other vertex. Grow a graph backwards from v , always taking the one edge leading into the current vertex, 1 if there is one. The definition assures that there is such an edge unless we reach the root, since every vertex in a tree has indegree one. We can’t ever return to a previously visited vertex, for then there would be a directed cycle, and this is not allowed by the definition of a tree either. [Formally, the last two sentences both used arguments by contradiction.] But the graph is finite, so the algorithm must terminate. The only place it could terminate is the root. Now retracting our steps provides a directed path from v to v . Here’s another more formal proof: by definition, if we remove edge di- rections, there is a path from the root to v , since a tree is connected if we remove edge directions. Let this path be v ,v 1 ,...,v n , where v is the root and v n = v . We’re not done yet, since we need to show that this path is....
View Full Document

This note was uploaded on 09/04/2008 for the course CS 280 taught by Professor - during the Spring '07 term at Cornell University (Engineering School).

Page1 / 5

C_work_280sol11 - Solutions to Homework 11 3.1 3 We define a “state” as a possible configuration of the puzzle e.g reading clockwise from top

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online