IT代写 6CCS3AIN, Tutorial 02 Answers (Version 1.0) 1. (a)

6CCS3AIN, Tutorial 02 Answers (Version 1.0) 1. (a)
(b)
P(cavity)= 􏰄 P(ω) ω|=cavity
= P (cavity ∧ catch ∧ toothache) + P (cavity ∧ ¬catch ∧ toothache)
+ P (cavity ∧ catch ∧ ¬toothache) + P (cavity ∧ ¬catch ∧ ¬toothache)
= 0.108 + 0.012 + 0.072 + 0.008 = 0.2
P(T oothache) = ⟨P (toothache), P (¬toothache)⟩
P (toothache) = P (cavity ∧ catch ∧ toothache) + P (cavity ∧ ¬catch ∧ toothache)
+ P (¬cavity ∧ catch ∧ toothache) + P (¬cavity ∧ ¬catch ∧ toothache) = 0.108 + 0.012 + 0.016 + 0.064
= 0.2
􏰂0.2􏰃 P(T oothache) = 0.8
(c)
The second probability is computed either in the same way as the first, or by knowing that the two sum to 1.
P (toothache|cavity) = P (toothache ∧ cavity P (cavity)
P (toothache ∧ cavity) = P (cavity ∧ catch ∧ toothache) + P (cavity ∧ ¬catch ∧ toothache) = 0.108 + 0.012
= 0.12
and so:
P (toothache|cavity) = 0.6
P (¬toothache|cavity) = 0.4
􏰂0.6􏰃 P(T oothache|cavity) = 0.4
P (catch ∨ cavity) = P (cavity ∧ catch ∧ toothache) + P (cavity ∧ catch ∧ ¬toothache)
+ P (¬cavity ∧ catch ∧ toothache) + P (¬cavity ∧ catch ∧ ¬toothache) + P (cavity ∧ ¬catch ∧ toothache) + P (cavity ∧ ¬catch ∧ ¬toothache)
= 0.108 + 0.072 + 0.016 + 0.144 + 0.012 + 0.008 = 0.36
P(Cavity|toothache ∨ catch) = P(Cavity ∧ (toothache ∨ catch)) P (toothache ∨ catch)
In a similar way to the previous question, we can compute:
P (toothache ∨ catch) = 0.416 1
Similarly (or by subtraction):
and:
(d)
(e)

(in this case we sum up all the values on slide 32 except those in the last column where we have ¬cavity and ¬toothache). Then:
2. The problem tells us that:
And:
Now,
P (d) = 0.0001
P (t|¬d) = 1 − P (¬t|¬d) = 0.05
P(d|t) = P(d ∧ t) P (t)
= P (t|d)P (d)
P (t|d)P (d) + P (t|¬d)P (¬d)
= 0.95 · 0.0001
0.95 · 0.0001 + 0.05 · 0.9999
= 0.00189
P (cavity ∧ (toothache ∨ catch)) = 0.108 + 0.012 + 0.072 = 0.192
P (cavity|toothache ∨ catch) = 0.462
P(Cavity|toothache ∨ catch) =
P (t|d) = 0.95 P (¬t|¬d) = 0.95
􏰂0.462􏰃 0.538
So the probability of having the disease once you have the positive test is 0.00189, which is not large, despite the accuracy of the test. The reason is that the disease is very unlikely, meaning that the prior probability is low.
Repeating the calculation with P (d) = 0.01 gives a probability of having the disease of 0.16, which is obviously much larger (though still much less than 0.95, which many people will say, without doing the calculation, is the chance of having the disease if the test comes back positive.)
3. We have:
Now, for Joe we want:
P (a|v) = 0.95 P (a|¬v) = 0.1
P (v|a) =
=
P (b|v) = 0.9 P (b|¬v) = 0.05
P (a|v)P (v)
P (a|v)P (v) + P (a|¬v)P (¬v)
0.95 · 0.01 0.95·0.01+0.99·0.1
= 0.0876
and, as before, because the virus is unlikely even after an accurate test, there is not that great a chance of
having the virus.
Carrying out a similar calculation for Bob, we find that:
P (v|b) = 0.154
so even though the second test is less accurate, the lower false positive rate means that Bob is about twice as likely to have the virus as Joe.
2

4. We have, from the slides for Lecture/Week 2:
P (m) = 0.0001 P (s|m) = 0.8
We also know that P (s|¬m) = 0.1. Then, using ⊙ to denote the Hadamard product (not important that you know what it is, it’s just important that you multiply row-wise; you can also see it as a set of 2 equations)
P(M|s) = αP(s|M) ⊙ P(M)
P(M|s) = α
= α
= α
􏰂 P(s|m) 􏰃 􏰂 P(m) 􏰃 P(s|¬m) ⊙ P(¬m)
􏰂0.8􏰃 􏰂0.0001􏰃 0.1 ⊙ 0.9999
􏰂0.8 · 0.0001􏰃 0.1 · 0.9999
􏰂0.00008􏰃 0.09999
= α 􏰂0.0008􏰃
≈ 0.9992
5. If you did this bit of the tutorial, you should be able to check that your code works by checking the answers against the calculations above.
3