Chapter 18: Multiagent Decision Making — Exercises
Chapter 18: Multiagent Decision Making¶
Russell & Norvig, Artificial Intelligence: A Modern Approach (4th ed.), end-of-chapter Exercise prompts — full text is included on this site (same material as the exercises/ch18/ sources in the aima monorepo).
Exercise 18.1¶
Consider the problem faced by an infant learning to speak and understand a language. Explain how this process fits into the general learning model. Describe the percepts and actions of the infant, and the types of learning the infant must do. Describe the subfunctions the infant is trying to learn in terms of inputs and outputs, and available example data.
Exercise 18.2¶
Repeat Exercise infant
Exercise 18.3¶
Draw a decision tree for the problem of deciding whether to move forward at a road intersection, given that the light has just turned green.
Exercise 18.4¶
We never test the same attribute twice along one path in a decision tree. Why not?
Exercise 18.5¶
Suppose we generate a training set from a decision tree and then apply decision-tree learning to that training set. Is it the case that the learning algorithm will eventually return the correct tree as the training-set size goes to infinity? Why or why not?
Exercise 18.6¶
In the recursive construction of
decision trees, it sometimes happens that a mixed set of positive and
negative examples remains at a leaf node, even after all the attributes
have been used. Suppose that we have positive examples and
negative examples.
Show that the solution used by DECISION-TREE-LEARNING, which picks the majority classification, minimizes the absolute error over the set of examples at the leaf.
Show that the class probability minimizes the sum of squared errors.
Exercise 18.7¶
Suppose that an attribute splits the set of examples into subsets and that each subset has positive examples and negative examples. Show that the attribute has strictly positive information gain unless the ratio is the same for all .
Exercise 18.8¶
Consider the following data set comprised of three binary input
attributes (, and ) and one binary output:
Use the algorithm in Figure DTL-algorithm (page DTL-algorithm) to learn a decision tree for these data. Show the computations made to determine the attribute to split at each node.
Exercise 18.9¶
Construct a data set (set of examples with attributes and classifications) that would cause the decision-tree learning algorithm to find a non-minimal-sized tree. Show the tree constructed by the algorithm and the minimal-sized tree that you can generate by hand.
Exercise 18.10¶
A decision graph is a generalization of a decision tree
that allows nodes (i.e., attributes used for splits) to have multiple
parents, rather than just a single parent. The resulting graph must
still be acyclic. Now, consider the XOR function of three
binary input attributes, which produces the value 1 if and only if an
odd number of the three input attributes has value 1.
Draw a minimal-sized decision tree for the three-input XOR function.
Draw a minimal-sized decision graph for the three-input XOR function.
Exercise 18.11¶
This exercise considers pruning of decision trees (Section
.
Create a data set with two input attributes, such that the information gain at the root of the tree for both attributes is zero, but there is a decision tree of depth 2 that is consistent with all the data. What would pruning do on this data set if applied bottom up? If applied top down?
Modify DECISION-TREE-LEARNING to include -pruning. You might wish to consult Quinlan [Quinlan:1986] or [Kearns+Mansour:1998] for details.
Exercise 18.12¶
The standard DECISION-TREE-LEARNING algorithm described in the
chapter does not handle cases in which some examples have missing
attribute values.
First, we need to find a way to classify such examples, given a decision tree that includes tests on the attributes for which values can be missing. Suppose that an example has a missing value for attribute and that the decision tree tests for at a node that reaches. One way to handle this case is to pretend that the example has all possible values for the attribute, but to weight each value according to its frequency among all of the examples that reach that node in the decision tree. The classification algorithm should follow all branches at any node for which a value is missing and should multiply the weights along each path. Write a modified classification algorithm for decision trees that has this behavior.
Now modify the information-gain calculation so that in any given collection of examples at a given node in the tree during the construction process, the examples with missing values for any of the remaining attributes are given “as-if” values according to the frequencies of those values in the set .
Exercise 18.13¶
In
Section broadening
Exercise 18.14¶
Suppose you are running a learning experiment on a new algorithm for Boolean classification. You have a data set consisting of 100 positive and 100 negative examples. You plan to use leave-one-out cross-validation and compare your algorithm to a baseline function, a simple majority classifier. (A majority classifier is given a set of training data and then always outputs the class that is in the majority in the training set, regardless of the input.) You expect the majority classifier to score about 50% on leave-one-out cross-validation, but to your surprise, it scores zero every time. Can you explain why?
Exercise 18.15¶
Suppose that a learning algorithm is trying to find a consistent hypothesis when the classifications of examples are actually random. There are Boolean attributes, and examples are drawn uniformly from the set of possible examples. Calculate the number of examples required before the probability of finding a contradiction in the data reaches 0.5.
Exercise 18.16¶
Construct a decision list to classify the data below.
Select tests to be as small as possible (in terms of attributes),
breaking ties among tests with the same number of attributes by
selecting the one that classifies the greatest number of examples
correctly. If multiple tests have the same number of attributes and
classify the same number of examples, then break the tie using
attributes with lower index numbers (e.g., select over ).
Exercise 18.17¶
Prove that a decision list can represent the same function as a decision tree while using at most as many rules as there are leaves in the decision tree for that function. Give an example of a function represented by a decision list using strictly fewer rules than the number of leaves in a minimal-sized decision tree for that same function.
Exercise 18.18¶
This exercise concerns the expressiveness of
decision lists (Section learning
Show that decision lists can represent any Boolean function, if the size of the tests is not limited.
Show that if the tests can contain at most literals each, then decision lists can represent any function that can be represented by a decision tree of depth .
Exercise 18.19¶
Suppose a 7-nearest-neighbors regression search returns as the 7 nearest values for a given value. What is the value of that minimizes the loss function on this data? There is a common name in statistics for this value as a function of the values; what is it? Answer the same two questions for the loss function.
Exercise 18.20¶
Suppose a 7-nearest-neighbors regression search returns as the 7 nearest values for a given value. What is the value of that minimizes the loss function on this data? There is a common name in statistics for this value as a function of the values; what is it? Answer the same two questions for the loss function.
Exercise 18.21¶
Figure kernel
Expand out the equation for the circle and show what the weights would be for the decision boundary in the four-dimensional feature space . Explain why this means that any circle is linearly separable in this space.
Do the same for ellipses in the five-dimensional feature space .
Exercise 18.22¶
Construct a support vector machine that computes the xor function. Use values of +1 and –1 (instead of 1 and 0) for both inputs and outputs, so that an example looks like or . Map the input into a space consisting of and . Draw the four input points in this space, and the maximal margin separator. What is the margin? Now draw the separating line back in the original Euclidean input space.
Exercise 18.23¶
Consider an ensemble learning algorithm that uses simple majority voting among learned hypotheses. Suppose that each hypothesis has error and that the errors made by each hypothesis are independent of the others’. Calculate a formula for the error of the ensemble algorithm in terms of and , and evaluate it for the cases where , 10, and 20 and , 0.2, and 0.4. If the independence assumption is removed, is it possible for the ensemble error to be worse than ?
Exercise 18.24¶
Construct by hand a neural network that computes the xor function of two inputs. Make sure to specify what sort of units you are using.
Exercise 18.25¶
A simple perceptron cannot represent xor (or, generally, the parity function of its inputs). Describe what happens to the weights of a four-input, hard-threshold perceptron, beginning with all weights set to 0.1, as examples of the parity function arrive.
Exercise 18.26¶
Recall from
Chapter concept
Exercise 18.27¶
Consider the following set of examples, each with six inputs and one
target output:
Run the perceptron learning rule on these data and show the final weights.
Run the decision tree learning rule, and show the resulting decision tree.
Comment on your results.
Exercise 18.28¶
Section logistic
Exercise 18.29¶
Suppose you had a neural network with linear
activation functions. That is, for each unit the output is some constant
times the weighted sum of the inputs.
Assume that the network has one hidden layer. For a given assignment to the weights , write down equations for the value of the units in the output layer as a function of and the input layer , without any explicit mention of the output of the hidden layer. Show that there is a network with no hidden units that computes the same function.
Repeat the calculation in part (a), but this time do it for a network with any number of hidden layers.
Suppose a network with one hidden layer and linear activation functions has input and output nodes and hidden nodes. What effect does the transformation in part (a) to a network with no hidden layers have on the total number of weights? Discuss in particular the case .
Exercise 18.30¶
Implement a data structure for layered, feed-forward neural networks, remembering to provide the information needed for both forward evaluation and backward propagation. Using this data structure, write a function NEURAL-NETWORK-OUTPUT that takes an example and a network and computes the appropriate output values.
Exercise 18.31¶
Suppose that a training set contains only a single example, repeated 100 times. In 80 of the 100 cases, the single output value is 1; in the other 20, it is 0. What will a back-propagation network predict for this example, assuming that it has been trained and reaches a global optimum? (Hint: to find the global optimum, differentiate the error function and set it to zero.)
Exercise 18.32¶
The neural network whose learning performance is measured in
Figure restaurant
Exercise 18.33¶
Consider the problem of separating
data points into positive and negative examples using a linear
separator. Clearly, this can always be done for points
on a line of dimension , regardless of how the points are
labeled or where they are located (unless the points are in the same
place).
Show that it can always be done for points on a plane of dimension , unless they are collinear.
Show that it cannot always be done for points on a plane of dimension .
Show that it can always be done for points in a space of dimension , unless they are coplanar.
Show that it cannot always be done for points in a space of dimension .
The ambitious student may wish to prove that points in general position (but not ) are linearly separable in a space of dimension .