Introduction to AI – Class test 2012 – some solutions and comments. QUESTION 1 Was generally answered well - after all it was asking about common sense. Of course the difficult thing is how to put this in java for example e.g. an age must be positive, but what exactly is the upper limit? QUESTION 2 Was not answered very well. Here is the solution. Given the cities labelled A through to G, you are at city A and your goal is to get to city F. At each arc in the graph is the cost is dollars to use that toll road. For example to travel from city A to city C will cost you 5 dollars. Use uniform cost to find the cheapest route from A to F. Show how the list of cites develops over the search and build the corresponding search tree. State the route you would take and its cost. You are now given extra information in an old guide book which shows you the cost in dollar to use the toll road. For example, the guide book says it costs a total of 3 dollar to travel from city B to city F. However the guide book is old and therefore prices are likely to have risen. Assuming this is the case, use this information to find the cheapest way from city A to city F. Uniform cost. Each node is labelled with its cost (i.e. total distance so far). A 0 (the cost is zero i.e. we are already at city A) AB 2, AC 5, AD 3 (the three successors of A) AB 2, AD 3, AC 5 (sort in order of cost so far) ABE (2+2=4), ABF (2+5=7), AD 3, AC 5 (successors of AB) AD 3, ABE (2+2=4), AC 5, ABF (2+5=7) (sort in order of cost so far) ADF (3+6=9), ADG (3+4=7), ABE (2+2=4), AC 5, ABF (2+5=7) (successors of AD) ABE (2+2=4), AC 5, ADG (3+4=7), ABF (2+5=7), ADF (3+6=9), (sort, 1 complete solution) ABEF (2+2+2=4), AC 5, ADG (3+4=7), ABF (2+5=7), ADF (3+6=9), (successors of ABE) AC 5, ABEF (2+2+2=6), ADG (3+4=7), ABF (2+5=7), ADF (3+6=9), (sort, 2 complete solutions) ACF (5+4=9), ABEF (2+2+2=6), ADG (3+4=7), ABF (2+5=7), ADF (3+6=9), (successors of AC) ABEF (2+2+2=6), ADG (3+4=7), ABF (2+5=7), ACF (5+4=9), ADF (3+6=9), (sort, 3 complete solutions) We now have a complete solution at the start of the list so we can terminate here. The cheapest route is a complete solution (i.e. a list from A to F) with a cost of 6 dollars. A* (using distance travelled so far + estimated distance) A (no estimate to F – but does not matter) (successors of A) AB (2+3=5), AC (4+5=9), AD (3+4=7), (sort) AB (2+3=5), AD (3+4=7), AC (4+5=9), (expand AB i.e. cheapest estimate) ABE (4+2=6), ABF (7+0=7), AD (3+4=7), AC (4+5=9), (sort, 1 solution) ABE (4+2=6), ABF (7+0=7), AD (3+4=7), AC (4+5=9), (expand ABE) ABEF (6+0=6), ABF (7+0=7), AD (3+4=7), AC (4+5=9), (sort, 2 complete solutions) We now have a complete solution, and it is at the start of the sorted list i.e. it is the cheapest. QUESTION 3. 1. There are many ways to formulate the problem. Probably the best way is to think how you could write it in java or another programming language. We could represent each room as T/F meaning clean/dirty and the robot is in one room {0,1,2}. 2. (0, F, T, T) means the robot is in room 0, room 0 is clean (F) and rooms 1 and 2 are dirty (T). 3. The robot can suck, move clockwise or anticlockwise. 4. A goal state is one of the following {(0, F, F, F), (1, F, F, F), (2, F, F, F)}. 5. Each room can be clean or dirty and there are 3 rooms so there are 8 states, the robot can be in 3 states {0,1,2}, so the complete system can be in 24 states (you can draw them all if you want to – this would be a state transition diagram – see figure 3.3 in the book for a house with 2 rooms). 6. Clockwise; suck; clockwise; suck = 4 states. 7. From (0, F, T, T) move clockwise (1, F, T, T) From (0, F, T, T) move anticlockwise (2, F, T, T) From (0, F, T, T) suck (1, F, T, T) note that this has not effect as the room is already clean. 8. Suck; Clockwise; suck; clockwise; suck = 5 states (this is seen purely by inspection). QUESTION 4 Turing test – this was answered quite poorly. There are many objections. See text book. If you have ever passed a swimming test for example it is often clearly stated “candidate must swim 100m unaided” or in a driving test there are a number of tasks you must complete e.g. park the car, turn left/right and pass through traffic lights safely. The Turing test is not descriptive? It is limited by the intelligence of the interrogator. Intelligence is so broad is it very hard to define – let alone test. Indeed a test (if one exists) could be used as the definition of intelligence. Many standard IQ (intelligence quotient) test only test maths skills or word puzzles. Intelligence has more dimensions to it that just maths or language skills (though these are important). QUESTION 5. Part 1 was answered well. The path is right, right, right giving a value of 6. The property is that at each node the value is 6. Part 2 was not answered very well. While min-max is simple to understand, I wanted to try a different game not found in any text books – so maybe this confused some students. The path is left, right, left giving a value of 13+1+8+7=29. I do not know of any special property which holds in this case.