Download solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS331: Introduction to Artificial Intelligence
Written Assignment #2
Date handed out: May 11, 2012
Date due: May 18, 2012 at the start of class
Total: 35 points
This assignment is to be done individually. Please hand in a hardcopy.
1. Using the full joint probability distribution below, write out what the following
probability distributions look like. Notice that the P is in boldface to emphasize that these
are distributions (ie. probability tables). This means you have to write out the probability
distributions for all uninstantiated random variables eg. for (a), write out
P(Toothache=true) and P(Toothache=false).
Toothache
Cavity
Catch
P(Toothache, Cavity, Catch)
false
false
false
0.576
false
false
true
0.144
false
true
false
0.008
false
true
true
0.072
true
false
false
0.064
true
false
true
0.016
true
true
false
0.012
true
true
true
0.108
a) P(Toothache) [2 points]
P(Toothache = false) = 0.576 + 0.144 + 0.008 + 0.072 = 0.8
P(Toothache = true) = 0.064 + 0.016 + 0.012 + 0.108 = 0.2
b) P(Cavity) [2 points]
P(Cavity = false) = 0.576 + 0.144 + 0.064 + 0.016 = 0.8
P(Cavity = true) = 0.008 + 0.072 + 0.012 + 0.108 = 0.2
1/4
c) P(Toothache | Cavity) [4 points]
P(Toothache = false | Cavity = false)
= P(Toothache = false, Cavity = false) / P(Cavity = false)
= (0.576+0.144)/(0.8)
= 0.9
P(Toothache = true | Cavity = false)
= P(Toothache = true, Cavity = false) / P(Cavity = false)
= (0.064+0.016)/(0.8)
= 0.1
P(Toothache = false | Cavity = true)
= P(Toothache = false, Cavity = true) / P(Cavity = true)
= (0.008+0.072)/(0.2)
= 0.4
P(Toothache = true | Cavity = true)
= P(Toothache = true, Cavity = true) / P(Cavity = true)
= (0.012 + 0.108) / (0.2)
= 0.6
2. For each of the following statements, either prove it is true or show that it isn’t true
through a counterexample:
a) If P( a | b, c ) = P( b | a, c ), then P( a | c ) = P( b | c ) [ 3 points]
True.
P (a | b, c)  P(b | a, c)
P(a, b, c) P(a, b, c)


P(b, c)
P (a, c )
 P(a, c)  P(b, c)
 P(a | c) P(c)  P(b | c) P (c)
 P(a | c)  P(b | c)
b) If P( a | b, c ) = P( a ), then P( b | c ) = P( b ) [3 points]
False. If P(a | b, c) = P(a), this says that a is independent of both b and c. It does not,
however, say anything about the relationship of b and c, hence you can’t say that b and c
are independent. Counterexample: a and b are the results of two independent coin flips
and c is equal to b.
c) If P( a | b ) = P( a ), then P( a | b, c ) = P( a | c ) [3 points]
False. If P(a|b) = P(a), then b is (marginally) independent of a. This says nothing about
conditional independence of a and b given c. Counterexample: a and b are independent
coin flips and c is the Exclusive OR of a and b.
3. Consider two medical tests, A and B, for a virus. Test A is 95% effective at
recognizing the virus when it is present, but has a 10% false positive rate (indicating that
2/4
the virus is present, when it is not). Test B is 90% effective at recognizing the virus, but
has a 5% false positive rate. The two tests use independent methods of identifying the
virus. The virus is carried by 1% of all people. Say that a person is tested for the virus
using only one of the tests, and that test comes back positive for carrying the virus.
Which test returning positive is more indicative of someone really carrying the virus?
Justify your answer mathematically. [10 points]
P (TestA   | Virus  Pr esent )  0.95
P (TestA   | Virus  Absent )  0.1
P (TestB   | Virus  Pr esent )  0.9
P (TestB   | Virus  Absent )  0.05
P (Virus  Pr esent )  0.01
P (Virus  Pr esent | TestA  )
P (TestA   | Virus  Pr esent ) P(Virus  Pr esent )
P(TestA   | Virus  Pr esent ) P (Virus  Pr esent )  P(TestA   | Virus  Absent ) P (Virus  Absent )
(0.95)(0.01)
0.0095
0.0095



 0.088
(0.95)(0.01)  (0.1)(0.99) 0.0095  0.099 0.1085
P (Virus  Pr esent | TestB  )
P(TestB   | Virus  Pr esent ) P(Virus  Pr esent )

P(TestB   | Virus  Pr esent ) P(Virus  Pr esent )  P(TestB   | Virus  Absent ) P (Virus  Absent )
(0.9)(0.01)
0.009
0.009



 0.15
(0.9)(0.01)  (0.05)(0.99) 0.009  0.0495 0.0585

4. Suppose you are given a bag containing n unbiased coins. You are told that n-1 of
these coins are normal, with heads on one side and tails on the other, whereas one coin is
a fake, with heads on both sides.
a. Suppose you reach into the bag, pick out a coin uniformly at random, flip it, and get a
head. What is the (conditional) probability that the coin you chose is the fake coin? [4
points]
P (Coin  Fake | Flip  Heads)

P ( Flip  Heads | Coin  Fake) P(Coin  Fake)
P( Flip  Heads | Coin  Fake) P(Coin  Fake)  P ( Flip  Heads | Coin  True) P (Coin  True)
1
1
1
1
(1) 
1 2n
2
n
 
n
n



 n  *

2 n 1 n 1 n n 1 n 1
 1   1  n  1  1  n  1

(1)    

2n
2n
2n
2n
 n   2  n  n
b. Suppose you continue flipping the coin for a total of k times after picking it and see k
heads. You may assume conditional independence between coin flips given the fakeness
of the coin eg. P( Coin Flip 1 = Heads, Coin Flip 2 = Heads | Coin = Fake ) = P( Coin
Flip1 = Heads | Coin = Fake) * P(Coin Flip 2 = Heads | Coin = Fake). Now what is the
conditional probability that you picked the fake coin? [4 points]
3/4
P (Coin  Fake | Flip  k Heads)
P( Flip  k Heads | Coin  Fake) P(Coin  Fake)

P( Flip  k Heads | Coin  Fake) P(Coin  Fake)  P ( Flip  k Heads | Coin  True) P (Coin  True)
1
(1) 
n
1
1
1
n2 k
n
n




*
1  n  1  1  2 k  n  1 n 2 k  n  1
 1   n  1 k

(1)   
 P( Flip  Heads | Coin  True)
 
n  n  2 k 
n2 k
n  n  1
2k
 k
2  n 1
4/4
Related documents