CMSI 485 Final Exam Spring 2006 Partial Answers ======================================================== PROBLEM 1 --------- The variables are Xi for i in 0..n-1. The domain of each Xi is 0..n-1 The constraints are everything we can make by instantiating the template forall i j. (i != j) ==> (Xi != Xj /\ (abs(i-Xi) != abs(j-Xj))) for all is and js. More formally the set of constraints is {Xi != Xj /\ (abs(i-Xi) != abs(j-Xj)) | 0<=i Price(BunchOf(b)) = Dollars(Times(n, c)) PROBLEM 5 --------- Here are the answers, but you have to show your work to get credit. P(a) = .69 P'(C) = <.72,.28> P'(A|c) = <.806, .194> P'(C | a\/b) = <.785, .215> PROBLEM 6 --------- Answers are online. PROBLEM 7 --------- You can generate: I is well. They plays badly. Five chair runs quickly slowly. You cannot generate: Awesome! They swim. At the gym we played basketball. PROBLEM 8 --------- public static double G(double s, double x, double y) { return Math.exp(-(x*x + y*y) / 2.0*s*s) / (s*s * Math.sqrt(Math.PI + Math.PI)); } sub convolute { my ($f, $g) = @_; integral( sub { my $u = shift; integral( sub { my $v, $x, $y = @_; $f->($u, $v) * $g($x - $u, $y - $v); } ) } ); } PROBLEM 9 --------- a) 49 b) 4 c) 3 d) 40, under the restriction that column 4 is a one-way street moving up. e) One order that they can be generated is 10,00,20,21,30,31,01,02,03,04,05,06,15,25,35,32,42,43,52,34,45 but you have to show the tree PROBLEM 10 ---------- a) A* is fine, you won't run out of memory here. b) Do a backtracking search, terminating paths on bumps. Always order the action choices according to which direction points closest to the goal. Break ties randomly. c) 12 actions (1,0)-(2,1)-(3,2)-(4,3)-(4,4)-(4,5)-(5,6)-(6,7) -(6,8)-(5,9)-(4,9)-(3,9)-(2,9)