
Midterm Examination CS540-1: Introduction to Artificial Intelligence
Oct 26, 2011. (20 questions, 5 points each)
BE SURE TO WRITE YOUR LAST NAME, FIRST NAME, AND EMAIL ON THE ANSWER BOOK.
1. (HAC) Run hierarchical clustering with single linkage on the following 1D dataset, and show the
tree: 0, 3, 4, 6, 10, 12.
((0 ((34) 6)) (10 12))
2. (k-means) Consider the 1D dataset: xi=i for i=1 to 25. To select good initial cluster centers for k-
means where k=5, let’s set c1=1. Then, select cj from the unused points in the dataset, so that it is
farthest from any already-selected centers c1 … cj-1. Show c2…c5.
c1=1, c2=25, c3=13, c4 and c5=7 and 19 (arbitrary order)
3. (kNN) Consider a 2D dataset where training points are on the integer grid (x1,x2), and both
dimensions x1 and x2 range from 1 to 100 (inclusive). The binary label for point (x1,x2) is (-1) (x1+x2).
What is the label for test point (51.3, 62.1) with a 3-NN classifier?
The 3NNs are (51,62), (51,63), (52,62). The labels of those are -1,1,1. So 3NN majority vote has
label 1.
4. (Entropy) There is no fundamental reason that we measure entropy in bits. Let’s assume that Na’vi
(the alien from Avatar) makes memory units using water: each unit can be in one of three states of
water (gas, liquid, solid). The information that each unit can hold is called a trit. What is the entropy
in trits of a 5-sided die with probability (1/3, 1/9, 1/9, 1/9, 1/3)?
sum_{i=1}^5 - pi log_3(pi) = -(2/3*(-1) + 3/9*(-2)) = 2/3+6/9=4/3 trits.
5. (Mutual information) The RDA Corporation has a prison with four cells. Without justification,
you’re about to be randomly thrown into a cell with equal probability. Cell 1 and cell 2 both have
Toruks that eat prisoners. Cells 3 and 4 are safe. With sufficient bribe, the warden will answer your
question “Will I be in cell 1?” What’s the mutual information between the warden’s answer and your
encounter with the Toruks?
P(W=y)=1/4, P(W=n)=3/4
H(D|W=y)=0, H(D|W=n)=H(1/3, 2/3)
H(D|W)=P(W=y)H(D|W=y) + P(W=n)H(D|W=n)=0+3/4H(1/3,2/3)
H(D)=1. I(D;W)=H(D)-H(D|W)=1-3/4H(1/3,2/3)=0.3113
6. (Decision Tree) Consider the following decision tree on 2D continuous features. All left branches
are “No” and right branches are “Yes”. Draw the corresponding decision boundary in R2.