SE250:lab-X:apra102

From Marks Wiki
Revision as of 05:20, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (11 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Task 1

ok as there are 9 blocks in the given puzzle there are 9! different states exists. 9*8*7*6*5*4*3*2*1 = 362880. Therefore there are 362880 possible different states. In the next part: should calculate number of edges in the complete state space graph. By looking at the puzzle i figured out that if the blank is at the 4 edges of the puzzle then it has 2 possible moves,if it is in the middle of the line then it has 3 possible moves, if it is in the middle of the whole puzzle then it has 4 possible moves. Hence the total moves it can move is (4*2)+(4*3)+(1*4) = 24. If there are 362880 possible ways for 9edges,then how many possible ways there will be for 24 edges? => (362880*24)/9 = 967680. yay finally sorted out the task 1.

Task 2

I looked at the code twice but still lost will have a look at it later. Skipping to task 3.

Task 3

<html> <img src="http://studwww.cs.auckland.ac.nz/~apra102/lab10/graph.html.jpg" width="450" height="500" alt="task3" /> </html>