Professional Documents
Culture Documents
Hwk 1 Solution
Problem 1: Expectation
1) Suppose that the two variables x and z are statistically independent. Show that the
mean and variance of their sum satisfies
Solution:
Since x and z are independent, their joint distribution factorizes p(x,z) = p(x)p(z), and so
Where the final term will integrate toz ero with respect to the factorized distribution p(x)p(z).
Hence
For discrete variables the integrals are replaced by summations, and the same results are again
obtained.
2) If an integer between 100 and 200 is to be chosen at random, what is the expected
value?
3) Suppose that X is a random variable. E(X) = μ, Var(X) = σ2, then what is the
value of E[X(X − 1)] =?
10 0
0 10
8
1.25 0
0 1.25
2) Pick all that apply: X(1) and X(2) are:
(a) Independent (b) Dependent (c) Correlated (d) Uncorrelated
P(X(1) = 1) =
P(X(2) = 5) =
Since non diagonal entries are 0, correlation coefficient between X(1) and X(2) has to be 0.
For any data, this is always equal to 1. The correlation between a variable and itself is always 1.
In this strategy one of empty boxes is chosen at random (independently of whether you
initially pick a box with a prize or not).
3) In a certain day care class, 30 percent of the children have grey eyes, 50 percent of
the children have blue eyes, and the other 20 percent’s eyes are in other colors. One
day they play a game together. In the first run, 65 percent of the grey eye kids were
selected into the game, 82 percent of the blue eye kids selected in, and 50 percent of
the kids with other colors were chosen. So if a child is selected at random from the
class, and we know that he was not in the first run game, what is the probability that
he has blue eyes?
Solution:
Assume B: blue eyes; O: other color eyes; G: grey eyes; NF: not in the first run game
| . .
P(B|NF) = | |
0.3051
| . . . . . .
Problem 4: Gaussian and Bayesian Distribution
a. Find p(x), p(y), p(x|y), and p(y|x). In addition, give a brief description of each of
these distributions.
Solution:
Problem 5: Risk: Consider a classification problem in which the loss incurred when
an input vector from class Ck is classified as belonging to class Cj is given by the loss matrix Lkj,
and for which the loss incurred in selecting the reject option is λ. Find the decision criterion that
will give the minimum expected loss. What is the relationship between λ and the rejection
threshold θ?
Solution:
A vector x belongs to class Ck with probability p(Ck | x). If we decide to assign x to class Cj
we will incur an expected loss of ∑ | , whereas if we select the reject option we
will incur a loss of λ. Thus, if
|
Then we minimize the expected loss if we take the following action
, ∑ | ;
Choose
, .
In particular, H(X) = 1 bit when p= 1/2. The graph of the function H(p) is shown in
Figure 2.1. The figure illustrates some of the basic properties of entropy--- it is a concave
function of the distribution and equals 0 when p =0 or 1. This makes sense, because when p = 0
or 1, the variable is not random and there is no uncertainty. Similarly, the uncertainty is
maximum when p = 1/2, which also corresponds to the maximum value of the entropy.
given by: .
Note that:
Solution:
H(X|Y) ∑ |
= 1/4 H(1/2, 1/4, 1/8, 1/8) + 1/4 H(1/4, 1/2, 1/8, 1/8)
= + 2 0
= 11/ 8 bits.
Remark: Note that H(Y|X) is not equal to H(X|Y). However, H(X) – H(X|Y) = H(Y) – H(Y|X), a
property that we shall exploit later.
4) Let A = (0, 1) and consider two distributions p and q on A. Let p(0) = 1 - r, p( 1) = r, and
let q(0) = 1 - s, q( 1) = s. Find the mutual information D(p||q) and D(q||p)
Note that :
Solution: