Exam #1 - Answer Key

The following solutions to exam 1 were generated by students and may differ slightly from my own answers, but are all reasonable solutions...

 

Question 1:

1a
The Turing Test is a way to answer the question "Can machines think?"  It is used as
a test of a machine's capability to demonstrate intelligence.  He puts it in terms
of a game involving a man, woman, and an interrogator.  The man and woman are in a
room and the interrogator asks each of them questions in attempt to figure out who
is the man and who is the woman (the interrogator does not know who is who).  The
man's job is to make the interrogator guess incorrectly, while the woman is to make
the interrogator guess correctly.  When a computer can take the place of the man and
fool the interrogator as often as a human, it is said to have passed the Turing
Test.

1b
A popular criticism is the Chinese Room Argument, where a computer or human in a
closed room receives questions and performs lookups in a table to return an
acceptable answer.  The room as a whole can answer the questions, but the human
inside cannot.  Basically, there is no real understanding present - it is all syntax
and no semantics.

Another popular criticism is that the Turing Test promotes the development of
artificial con artists, not artificial intelligences.  The Loebner competition
occurs every year and machines are created with the purpose of fooling judges,
rather than creating artificial intelligences.

1c
One of the stronger defenses of the Turing Test is the Argument from Consciousness. 
It basically says that we have no definition of consciousness, and therefore it is
not necessarily valid to critique the test from this.  Moreover, what basis do we
have to require consciousness to be part of intelligence?

The test also promotes the discussion of AI, regardless of whether the test criteria
is too abstract.

 

Alternate Solution:

A: Describe the Turing Test
    There is a computer and a human in a room.  There is also an interrogator outside the room.  The interrogator can submit questions through an interface into the room to the human and computer.  The human must respond honestly, and the computer will respond as programmed.  The interrogator attempts to figure out which one is human and which is the computer.
B: Describe a criticism
    One criticism of the Turing Test is that the agent can pass a Turing Test, but because the agent can not think for itself, it is not artificial intelligence.  The agent can only do what it is programmed to do, and no more.  It can't take you by surprise.
C: Describe a defense.
    The argument of various disabilities states that there is always something that the can't do.  It is defended by saying that the only limitations are space and time to program.  Given time, space, and resources, solutions to any problem can be programmed into an agent.

 

Question 2:

2. We have studied several uninformed search strategies but have focused our attention on Breadth-First, Depth-First, and Iterative Deepening Depth First. The follow question(s) consider your understanding of these search strategies.

    a. (6 points) Assume that you are searching the tree provided in Figure 1 for the goal state at node N. For each of the three searches, list the nodes in the order that they are visited. (You may ignore the values provided with each leaf node.)

Breadth-First: A,B,C,D,E,F,G,H,I,J,K,L,M,N
Depth-First: A,B,D,H,I,J,E,K,L,M,C,F,N
Iterative Deepening Depth-First: A,A,B,C,A,B,D,E,C,F,G,A,B,D,H,I,J,E,K,L,M,C,F,N

    b. (8 points) Breadth-first and Depth-first searches tend to be easier to program than Iterative deepening. However, depending on the search scenarios one may be better than the other, both may be equally good, or both may be equally bad. For each of these searches, and for each of the search scenarios provided, indicate whether the search performs well or performs poorly.

 

Scenario
 
Breadth-First
 
Depth-First
 
Some paths are extremely long, or even infinite
 
Performs well
 
Performs poorly
 
All paths are of similar length and all paths lead to a goal state
 
Wasteful of time and memory (performs poorly)
 
Performs well. In fact, it is much better, especially with a high branching factor.
 
All paths are of similar length, but not all paths lead to a goal state
 
Performs relatively well
 
Performs well, used over Breadth-first for memory efficiency
 
High branching factor
 
Performs poorly
 
Performance depends on other factors, but performs well in general
 


    c. (6 points) Explain why Iterative Deepening Depth-First is reasonably efficient. Why might it be preferable to use this rather than depth first search?

    Three main points:
       1. Efficient memory use (same as DFS)
       2. Able to handle long or infinite paths
       3. As close as can be to optimal, as long as there is an equal cost per step.

 

Alternate Solution:

a.
     Breadth-First: A B C D E F G H I J K L M N
     Depth-First: A B D H I J E K L M C F N
     Iterative Deepening Depth-First: A A B C A B D E C F G A B D H I J E K L M C F N
    b.   Scenario                 BFS              DFS
         long paths               good              bad
         similar paths            bad               good
         not all end in goal     good             good
         high branching         bad               depends
    c. With depth-first search, a path could become infinite. With Iterative-Deepening Depth-First search, a goal will be reached for a path is considered infinite.

 

Question 3:

a.       (8  points) How does each work? Discuss their similarities and differences.

                   Similarities:

                        -they both use heuristics to find the goal.

                        -they both keep all expanded nodes in memory.

                        -both searches are only as good as the heuristic being used.

 

                   Differences:

                        -A* is complete if the heuristic is admissible, greedy search is not complete.

-A* will find the best solution if there is one and the heuristic is admissible, Greedy is not guaranteed to find the best solution, but it will usually find a better solution than an uninformed search.

 

Both searches use a heuristic as an estimate of some sort. Greedy simply uses the heuristic as a way to choose the “most likely” path to the solution by choosing the path with the heuristic that is the closest to the goal, from the partially expanded tree at a certain stage. A* algorithms use an admissible heuristic which is always an underestimate. It also adds the cost so far and the cost to get to the goal from the current location to estimate the total path cost.

 

b.   (4 points) Why do we call these methods “informed” techniques?

Because they try to reduce the amount of search that needs to be done by making an intelligent decision for which nodes are selected for expansion. This is done by evaluating nodes to determine if the goal is on the current path.

 

c.       (4 points) They each require a heuristic that is “admissible.”  What does this term mean, and why is it important?

Admissible means that the estimated cost of reaching the goal is always less than the actual cost to the goal node.  This is important because if it is overestimated it may find a path to the goal but it may not be an optimal solution.

 

d.      (4 points) Which one is often “better” and why?

A* is usually better because it has the potential of minimizing the number of expanded nodes in memory and it also eliminates the possibility of getting hung up in an infinite loop on a path which is not the best path to the goal. A* will also always find the optimal path to the goal if the heuristic is a good one.

Alternate Solution

3a
Greedy search uses a heuristic of a straight line distance to the goal, and picks
the most likely path (at each stage/node in a search tree) based on this value. 
This can lead to a fairly quick solution, but can also get stuck infinite loops and
never find a solution.  A* is similar to the greedy search in that is uses the
straight line distance to goal heuristic, but goes a step further as it also keeps
track of the total distance already traveled.  This eliminates infinite looping and
also guarantees a complete and optimal solution.

They are both similar in that they use a heuristic (informed searches) of straight
line distance to the goal.  They are different in that greedy search is not
complete, optimal, and does not keep track of total distance traveled.  A* is
guaranteed to be both complete and optimal, since it uses the additional information
of total distance traveled.

3b
An informed search has additional knowledge about a given domain.  It uses a
heuristic, which is a rule or other piece of information that is used to make
methods such as search more efficient or effective.  An example of this would be the
given straight-line distances from city X to the goal state.

3c
Admissible means that the heuristic never overestimates the true cost to the goal
state (i.e., straight line distance) and that it is also never less than 0.  The
closer the heuristic is to the true cost, the better it will probably be.

3d
A* is often better because it guarantees a complete and optimal solution will be
found, as opposed to the greedy search that can get stuck in infinite loops (which
is neither complete or optimal).

 

Question 4:

A:  what value will the minimax algorithm assign to the non-leaf nodes
    A=3, B=3, C=2, D=3, E=7, F=2, G=6
 
B: Briefly describe how the minimax algorithm works to arrive at the solution to the previous question
    There are 2 players in the minimax algorithm, Max and Min.  Max wants to maximize his score, Min wants to minimize his.  If it is Max's turn, Max will look at all his child nodes and choose the node with the highest score.  Max's node's score becomes the max score of his children.  If it is Min's turn, Min goes through the same process, but will choose the lowest score rather than the highest.
 
C: With alpha beta pruning, which nodes are skipped
    L and M will never be evaluated because once Max finds a 5 in K, E will have at least a value of 5 and therefore Min at B will never choose that side because he already has a better choice, the 3 from D.
    G,Q,R, and S will never be evaluated.  When the right side of the tree gets evaluated, A will have a possible 3.  Max will choose 2 for F and that will be returned to C.  Since C is Min's turn, C will be at most 2, and Max at A will never choose C.  Therefore G, Q, R, and S need not be evaluated.

Alternate Solution

Consider the game tree shown in Figure 1, in which a static evaluation function has been applied to the leaf nodes (nodes H-S).
    a. (6 points) What value will the minimax algorithm assign to the non-leaf nodes (nodes A-G)?
       A = 3, B = 3, C = 2, D = 3, E = 7, F = 2, G = 6

    b. (6 points) Briefly describe how the minimax algorithm works to arrive at the solution to the previous question.
       The Minimax algorithm traverses the tree using a depth-first search until leaf nodes are found. Once a leaf node is found, a static evaluator is applied. Alternate depths choose between the maximum and minimum values of a given nodes children (starting with max).

       As per the example:
          1. D chooses the max of 3, 2, and 1. D = 3
          2. E chooses the max of 5, 4, and 7. E = 7
          3. B chooses the min of 3 and 7. B = 3
          4. F chooses the max of 1, 0, 2. F = 2
          5. G chooses the max of 6, 1, 5. G = 6
          6. C chooses the min of 2 and 6. C = 2
          7. A chooses the max of 3 and 2. A = 3

    c. (8 points) If the minimax algorithm was implementing alpha-beta pruning, it could avoid considering several nodes in the tree in Figure 1. List the nodes that can be skipped, and explain why we know their value will not play a role in the outcome of the mini-max algorithm.

    Nodes L and M can be skipped. We know that E->alpha = 5 after examining node K. -At worst- E will be 5. Min must choose between D (which is equal to 3), and E, which is at worst 5. Min will always pick 3, so nodes L and M can be skipped since they will not change the outcome.

    Nodes G, Q, R, and S can also be skipped. We arrive at this by knowing that B = 3 (since min chose D in the previous portion of this answer), and we must choose the max of B and C for the final answer. We evaluate node F, arriving at F = 2. This means that -at worst- C <= 2. Since Max has the final choice, if the choice is between 3 and  something <= 2 then he will always pick 3, which is B. Since this outcome is already obvious after evaluating F, we can skip G, Q, R and S since they will not change the outcome.
 

 

Question 5:

Key:
^ = AND     v = OR     Vx = for all X     Vy = for all Y    -> = implies
 
Group 5 Answers: 
 
5. a.
      1. eats(Bill, Chilies) ^ isAlive(Bill)
      2. Vx  eats(Bill, X) -> eats(Sue, X)
      3. isFood(Apples)
      4. Vx  isFood(X) -> likes(John, X)
      5. Vx Vy   eats(X, Y) ^ isAlive(X) -> isFood(Y)
      6. Vx Vy   eats(X, Y) ^ isSpicy(Y) -> hasFireyTemper(X)
      7. isSpicy(Chillies)
     b. Expressions substituted as numbers where possible: 
         1               5
        ----------------------
        isFood(Chilies)
 
         4     isFood(Chilies)
        -----------------------------
         likes(John, Chilies)
 
         Vx Vy isFood(X) ^ likes(Y,X) -> eats(Y,X)        likes(John,Chilies) ^ isFood(Chilies)
        ------------------------------------------------------------------------------------------------------------------------
                                               eats(John, Chilies)
 
            6                      7
        ---------------------------------
         hasFireyTemper(John)

 

Alternate Solution

1.       Bill eats chilies and is alive.

Eats(bill, chillies) /\ Alive(bill)

2.       Sue eats everything that Bill eats.

Eats(bill, x) → Eats(sue, x)

3.       Apples are food.

                        Food(apples)

4.       John likes all kinds of food.

Food(x) →Likes(john, x)

5.       Anything anyone eats and isn't killed by (is alive) is food.

Eats(x,y) /\ Alive(x) → Food(y)

6.       Anyone eating spicy foods has a fiery temper.

Eats(x,y) /\ Spicy(y) /\ Food(y) → Fiery temper(x)

7.       Chilies are spicy

Spicy(chilies)

New Rule:

8)  If someone likes a food, you eat it.

Likes(x,y) /\ Food(y) → Eats(x,y)

 9) Food (chillies)                             modus ponens  1,5

10) Eats (john, chillies)                     modus ponens 4, 8, 9

11) Fiery temper(john)                    modus ponens 6,7,9,10