Docsity

Linear Algebra - Artificial Intelligence - Solved Exam, Exams of Artificial Intelligence

Toggle sidebar
bg1
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.
pf3
pf4

Partial preview of the text

Download Linear Algebra - Artificial Intelligence - Solved Exam and more Exams Artificial Intelligence in PDF only on Docsity!

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))

  1. (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 c 1 =1. Then, select cj from the unused points in the dataset, so that it is farthest from any already-selected centers c 1 … cj-1. Show c 2 …c 5. c1=1, c2=25, c3=13, c4 and c5=7 and 19 (arbitrary order)
  2. (kNN) Consider a 2D dataset where training points are on the integer grid ( x 1 ,x 2 ), and both dimensions x 1 and x 2 range from 1 to 100 (inclusive). The binary label for point ( x 1 ,x 2 ) 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.

  1. (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.

  1. (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/

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.

  1. (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 R^2.
  1. (Linear algebra) Given a weight vector w , consider the line defined by w’x =3.14. Along this line, there is a point that is closest to the origin. How far is that point to the origin in Euclidean distance?

3.14/||w||

  1. (Support Vector Machines) Let w=(1, 2) and b=3. For the point x=(4,5), y=-1, what is the smallest slack value  for it to satisfy the margin constraint?

The margin constraint is y(w’x+b)>=1-. Plugging in the numbers, -(4+10+3)>=1-, >=18.

  1. (Kernel) If K(x, x’) is a valid kernel with induced feature representation (x), then G(x,x’)=K(x,x’)+3.14 is also a valid kernel. Write down the induced feature representation of kernel G using .

This is a vector with one more dimension: [(x) sqrt(3.14)]

  1. (Perceptron) With a linear threshold unit perceptron, implement the NAND function. That is, you should write down the weights w 0 , wA, wB.

A B NAND

0 0 1

0 1 1

1 0 1

1 1 0

x 1 >

x 2 >3 (^) x 2 >

y=1 (^) y=1 x 1 >

y=1 y=

y=

  1. (Language Modeling) An n-gram language model computes the probability P( wn | w 1 , w 2 , …, wn-1 ). How many parameters need to be estimated for a 5-gram language model? Let V be the vocabulary size. Then for each (n-1)-gram history (the conditioning part), there are (V-
    1. parameters because the probability normalizes. There are V^(n-1) histories. So the number of parameters is (V-1)V^4. We also accept V^5.
  2. (ESP) In one sentence, describe the foundation of the ESP game. Inter-annotator agreement in lieu of true annotation accuracy control.
  3. (Naïve Bayes) Consider a Naïve Bayes classifier with 100 feature dimensions. The label is binary with P(y=0)=P(y=1)=0.5. All features are binary, and have the same conditional probabilities: P( xi=1 | y=0 ) = a P( xi=1 | y=1 ) = b for i=1, …, 100. The numbers a, b are in [0, 1]. Given an item with alternating feature values X= ( x 1 =1, x 2 =0, x 3 =1, …, x 100 =0), compute P(y=1|X). P(X|y=0)=prod P(xi|y=0)=a^50 (1-a)^ P(X|y=1)=b^50 (1-b)^ P(y=1|X)=P(X|y=1)P(y=1) / (P(X|y=1)P(y=1) + P(X|y=0)P(y=0)) = b^50 (1-b)^50 / (b^50 (1-b)^
    • a^50 (1-a)^50)