Docsity

Homework 1 Problems with Solutions for Machine Learning | CSE 847, Assignments of Computer Science

Toggle sidebar
bg1
Homework I
Due: 01/29/2007 (before class)
January 26, 2009
Problem 1 (10pt)
There is a rare disease that only happens to 1 out of 100,000 people. A test shows positive
•99% of times when applied to an ill patient and,
•1% of times when applied to a healthy patient.
1. What is the probability for you to have the disease given that your test result is positive?
2. What is the probability for you to have the disease when you did two tests and both of them show
positive? Assume that two tests are conducted independent.
3. Assume that the patient keeps on trying the test, what is the minimum number of tests that the
patient has to try to be 99% percent sure that he is actually ill? Assume that all tests are conducted
independently.
Problem 2 (10pt)
Given three events:
1. R: It rains,
2. W: Glass is wet,
3. U: People bring umbrella
We assume that event Uand Ware conditionally independent given event R, namely Pr(U, W |R) =
Pr(U|R) Pr(W|R) and Pr(U, W |¬R) = Pr(U|¬R) Pr(W|¬R). The graphical representation of the rela-
tionship among the three events is illustrated in Figure 1. The prior probability for event Ris Pr(R) = 0.8.
The conditional probabilities P r(U|R) and P r(W|R) are given in the Table 1. Based on these information,
compute the conditional probability P r(U|W). You are required to show the detailed calculation in the
hand in.
thb
Pr(W|R)R¬RPr(U|R)R¬R
W0.7 0.4U0.9 0.2
¬W0.3 0.6¬U0.1 0.8
Table 1: Conditional probabilities Pr(W|R) and Pr(U|R)
1
pf3

Partial preview of the text

Download Homework 1 Problems with Solutions for Machine Learning | CSE 847 and more Assignments Computer Science in PDF only on Docsity!

Homework I

Due: 01/29/2007 (before class)

January 26, 2009

Problem 1 (10pt)

There is a rare disease that only happens to 1 out of 100, 000 people. A test shows positive

  • 99% of times when applied to an ill patient and,
  • 1% of times when applied to a healthy patient.
  1. What is the probability for you to have the disease given that your test result is positive?
  2. What is the probability for you to have the disease when you did two tests and both of them show positive? Assume that two tests are conducted independent.
  3. Assume that the patient keeps on trying the test, what is the minimum number of tests that the patient has to try to be 99% percent sure that he is actually ill? Assume that all tests are conducted independently.

Problem 2 (10pt)

Given three events:

  1. R: It rains,
  2. W : Glass is wet,
  3. U : People bring umbrella

We assume that event U and W are conditionally independent given event R, namely Pr(U, W |R) = Pr(U |R) Pr(W |R) and Pr(U, W |¬R) = Pr(U |¬R) Pr(W |¬R). The graphical representation of the rela- tionship among the three events is illustrated in Figure 1. The prior probability for event R is Pr(R) = 0.8. The conditional probabilities P r(U |R) and P r(W |R) are given in the Table 1. Based on these information, compute the conditional probability P r(U |W ). You are required to show the detailed calculation in the hand in.

thb

Pr(W |R) R ¬R Pr(U |R) R ¬R W 0. 7 0. 4 U 0. 9 0. 2 ¬W 0. 3 0. 6 ¬U 0. 1 0. 8

Table 1: Conditional probabilities Pr(W |R) and Pr(U |R)

Figure 1: Graphical representation of events R, W , and U

Problem 3 (10pt)

Consider the experiment of rolling a six-sided die three times. Let X be the random variable that is the product of the dots of the three rolls.

  • Compute the probability Pr(X is an odd number)
  • Show that E(X) = E(x 1 )E(x 2 )E(x 3 ) where x 1 , x 2 , and x 3 are the random variables for each individual roll.
  • Compute and compare the values for E(log X) and log(E(X)).
  • Show E(log X) ≤ log(E(x)) holds for any distribution of Pr(x).

Problem 4 (10pt)

  • Show H(X, Y ) ≤ H(X) + H(Y )
  • Show I(X; Y ) = H(X) + H(Y ) − H(X, Y )
  • Show H(p) =

∑m i=1 pi^ log(1/pi) is a convex function for variables^ p^1 ,... , pm^ within the domain {p = (p 1 ,... , pm)|

∑m i=1 pi^ = 1, pi^ ≥^0 , i^ = 1,... m}.

Problem 5: (10pt)

  • Compute the Bregman distance Bϕ(p||q) between distribution q = (q 1 , q 2 ,... , qm) and p = (p 1 , p 2 ,... , pm) for function (1) ϕ(q) = ‖q‖^22 , and (2) ϕ(q) = −H(q) where H(q) is the entropy function.
  • Show Bϕ(x||y) = Bϕ(x||z) + Bϕ(z||y) − (x − z)>(∇ϕ(y) − ∇ϕ(z)) where Bϕ(·||·) is a Bregmen distance and ϕ(·) is a convex function.

Problem 6 (20pt)

Consider that somebody has both a die and a coin. Each time, he can choose to roll the die or to flip the coin. The decision is based on a Bernoulli distribution. The observed number for flipping the coin is either 0 or 1, and the observed number for rolling the die is either 0, 1, 2, 3, 4, or 5. By repeating this experiment for m times, you will observed a sequence of numbers (n 1 , n 2 ,... , nm). The observation data can be found in http://www.cse.msu.edu/~cse847/assignments/mixture_data.txt.

  • Assume that each experiment is independent from the previous one, and meanwhile both the coin and the die are fair with equal probability for each number. Compute the probability p in the Bernoulli distribution using maximum likelihood estimation that fits the observations.