1. Describe the depth-first search algorithm. What is the order of visiting the nodes for the following

Size: px
Start display at page:

Download "1. Describe the depth-first search algorithm. What is the order of visiting the nodes for the following"

Transcription

1 Artificial Intelligence Fundamentals Theory 1. Describe the depth-first search algorithm. What is the order of visiting the nodes for the following tree (the alternatives are tried in left-to-right order)? 2. Describe the breadth-first search algorithm. What is the order of visiting the nodes for the following tree (the alternatives are tried in left-to-right order)? 3. What is a game tree? What will be the minimax value of node A? Which branch is chosen by the algorithm?

2 4. Using Nearest Neighbors, draw the decision boundaries produced by 1-nearest-neighbors, in order to classify 'O' from 'X' based on their positions on the following map. 5. Giving the following neural network compute the output for the nodes A, B and C, for x = {-1, 0, 1}.

3 All nodes use the sigmoid function (see below) to activate the neuron. 6. Use AdaBoost to classify this data:

4 You must use these stubs as possible classifiers. For a correct classification, the stub must return a true value for '+' and a false value for '-'. The weights start evenly distributed: w i=1/8. The weights are changed after following formula: w t+1 i = w i t { if 1 E t it s correct 2 1 if E t it s wrong, where Et t = wrong cases w i 1 h1: y > 2.5 h2: y > 1.5 h3: x < 1.5 What will be the first classifier that AdaBoost picks? What are the new weights? 7. You have the following puzzle, in which each letter represents a distinct number. The puzzle can be solved by treating it as a constraint satisfaction problem with each of the letters as a variable. There are some notes scribbled on the paper with the puzzle, from which you conclude that R = 7 and you learn that the carry digits, C1, C2, C4 and C5 are 1 and C3 = 0. Write the existing constraints and draw lines in the graph below between nodes whose values are dependent on each other according to the constraints of the problem. Do not draw in the no-two-have-same-value constraint, of course, because then every pair would be connected.

5 8. Describe the genetic operators: crossover and mutation. Give one example for each operator. 9. Having the following goal tree answer to the questions: How you clear the top of B7? Why you grasp B7? How you put B7 on B1? 10. Considering the following graph, explain why the admissibility heuristic itself is not good enough to work with A *. The values from the arcs represent the distance between nodes and the values above the nodes represent the estimated distance to the target (in our case the node G).

6 Artificial Intelligence Fundamentals Problems 1. Tired of giving the graduation exam in every year, UPT decides to create an identification tree able to decide if a student must graduates or not based on following descriptors: intelligence, ambitious, hard working and skilled. Thus, it collected couple examples over the past years and made the following table: # Intelligence Ambitious Hard working Skilled Graduates? 1 Average Yes No Low Yes 2 High No Yes Medium Yes 3 Very high No No High Yes 4 Average No Yes Low No 5 High No No Medium No 6 Very high No No Low No 7 High Yes No Medium Yes 8 Average Yes Yes Medium Yes 9 Average No Yes High Yes 10 High Yes No High Yes 11 Average No No High No 12 Average No Yes Medium No Knowing that the quality (lower is better) of a test is given by the following formula, compute the quality for each of the four tests and specify which test is chosen as be the root of the tree. # of samples in Set Q(Test) = D(Set) # of samples in Test Sets produced and D represents the disorder and has the following formula: D(Set) = p(x) log 2 p(x), where p(x) = Classes in Set # of samples in Class # of samples in Set Also, you can approximate the D(Set) using the bellow figure:

7 2. Because tomorrow is the Choosing Ceremony, Beatrice Prior must attend to the aptitude test that will show her to which of the five factions it belongs: Abnegation, Candor, Erudite, Amity, or Dauntless. The aptitude test is a Rule-Based System with the following rules: P1 P2 P3 P4 P5 P6 IF '(?x) threw on the dog' THEN '(?x) belongs to the Abnegation' IF AND('(?x) not running from the dog', '(?x) takes the knife') THEN '(?x) belongs to the Dauntless' IF AND('(?x) belongs to the Abnegation', '(?x) belongs to the Dauntless') THEN '(?x) is a Divergent' IF OR(AND('(?x) is courageous', '(?x) doesn't afraid of the (?y)'), '(?x) likes (?y)') THEN '(?x) threw on the (?y)' IF OR('(?x) likes (?y)', '(?x) jumps from the train') THEN '(?x) not running from the (?y)', '(?x) doesn't afraid of the (?y)' IF '(?x) jumps from the train' THEN '(?x) takes the knife' Knowing the following assertions: A1: Abnegation values selflessness. A2: Beatrice is courageous. A3: Beatrice likes dog. A4: Beatrice doesn't afraid of the Dauntless. Simulate backward chaining with the hypothesis: Beatrice is a Divergent. Write all the hypotheses the backward chainer looks for in the database in the order that the hypotheses are looked for 3. Because tomorrow is the Choosing Ceremony, Beatrice Prior must attend to the aptitude test that will show her to which of the five factions it belongs: Abnegation, Candor, Erudite, Amity, or Dauntless. The aptitude test is a Rule-Based System with the following rules: P1 P2 P3 IF '(?x) threw on the dog' THEN '(?x) belongs to the Abnegation' IF AND('(?x) not running from the dog', '(?x) takes the knife') THEN '(?x) belongs to the Dauntless' IF AND('(?x) belongs to the Abnegation', '(?x) belongs to the Dauntless') THEN '(?x) is a Divergent'

8 P4 P5 P6 IF OR(AND('(?x) is courageous', '(?x) doesn't afraid of the (?y)'), '(?x) likes (?y)') THEN '(?x) threw on the (?y)' IF OR('(?x) likes (?y)', '(?x) jumps from the train') THEN '(?x) not running from the (?y)', '(?x) doesn't afraid of the (?y)' IF '(?x) jumps from the train' THEN '(?x) takes the knife' Knowing the following assertions: A1: Abnegation values selflessness. A2: Beatrice is courageous. A3: Beatrice likes dog. A4: Beatrice doesn't afraid of the Dauntless. Run forward chaining on the rules and assertions provided above. Fill out the rows into a table like below, noting the rules whose antecedents match the data, the rule that fires, and the new assertions that are added by the rule. Matched Fired New assertions added to List of assertions