0% found this document useful (0 votes)
18 views

AI Assignment 3

This document contains an assignment submission on exercise set 3 of an artificial intelligence course. The submission addresses 6 questions, providing explanations and calculations for each. It correctly answers whether logic statements are true or false, represents logical expressions, analyzes probability statements, calculates probabilities from a probability table, and uses Bayes' theorem to calculate the probability a person has a disease given a positive test result.

Uploaded by

Tigabu Yaya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

AI Assignment 3

This document contains an assignment submission on exercise set 3 of an artificial intelligence course. The submission addresses 6 questions, providing explanations and calculations for each. It correctly answers whether logic statements are true or false, represents logical expressions, analyzes probability statements, calculates probabilities from a probability table, and uses Bayes' theorem to calculate the probability a person has a disease given a positive test result.

Uploaded by

Tigabu Yaya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NISS, Computer Engineering

IT00CH91-3003 Artificial Intelligence

Assignment 3
on
Exercise Set 3

By: Tigabu Yaya Gishene


[email protected]

Submitted to: Prof. Johan Lilius


Submission Date: Dec. 3rd, 2023
1. Correct statements
c, e, f, h, and i
2.
a. If α ⊨ γ or β ⊨ γ (or both), then (α ∧ β) ⊨ γ:
• This assertion is incorrect. Here's a counterexample:
o Let α be "It is raining," β be "It is sunny," and γ be "The ground is wet."
o α ⊨ γ (It is raining implies the ground is wet).
o β ⊨ γ (It is sunny implies the ground is not wet).
o However, (α ∧ β) is false (It cannot be both raining and sunny at the same
time), so (α ∧ β) does not entail γ.
b. If α ⊨ (β ∧ γ), then α ⊨ β and α ⊨ γ:
• This assertion is correct. If α implies that both β and γ are true, then α implies β
and α implies γ individually.
c. If α ⊨ (β ∨ γ), then α ⊨ β or α ⊨ γ (or both):
• This assertion is correct. If α implies that either β or γ (or both) is true, then α
implies β or α implies γ (or both).

3. Let’s evaluate each representation.


a. (R ∧ E) ⟺ C:
• This representation is incorrect. It says that a person is both radical and electable
if and only if they are conservative. However, the original assertion allows for a
radical person to be electable only if they are also conservative, not necessarily if
they are both radical and electable.
b. R ⇒ (E ⟺ C):
• This representation is correct. It expresses that if a person is radical (R), then
they are electable (E) if and only if they are conservative (C). This aligns with
the original assertion.
c. R ⇒ ((C ⇒ E) ∨ ¬E):
• This representation is incorrect. It suggests that if a person is radical (R), then
either (C implies E) or not E. This allows for the possibility that a radical person
is not electable (¬E) even if they are conservative (C), which contradicts the
original assertion.
Therefore, the correct representation is b. R ⇒ (E ⟺ C).

4. Let’s Analyze each statement:


a. P(a | b ∧ a) = 1:
• This statement is true. Given that "a" has occurred, the probability of "a" given
"b ∧ a" is 1 because if "a" has occurred, then "a" has occurred, regardless of the
state of "b ∧ a."
b. If P(a | b, c) = P(b | a, c), then P(a | c) = P(b | c):
• This statement is not necessarily true. Here's a counterexample:
o Let a, b, and c be events such that P(a | b, c) = P(b | a, c) = 1 (perfect
correlation).
o However, it doesn't necessarily imply that P(a | c) = P(b | c). The
information about event "c" might impact the relationship between "a" and
"b".

c. If P(a | b, c) = P(a), then P(b | c) = P(b):


• This statement is not necessarily true. Here's a counterexample:
o Let a, b, and c be independent events. If P(a | b, c) = P(a), it doesn't imply
anything about the relationship between P(b | c) and P(b).

d. If P(a | b) = P(a), then P(a | b, c) = P(a | c):


• This statement is true. If "a" is independent of "b", then adding "c" to the
conditioning does not change the probability of "a". Formally, P(a | b) = P(a)
implies that P(a | b, c) = P(a | c).

5. Let's use the given information in Table 1 to calculate the probabilities:


a. P(Cavity)
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦) = 𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 ∧ 𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ 𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 ∧ 𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ ¬𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 ∧ ¬𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ 𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 ∧ ¬𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ ¬𝐶ℎ𝑎𝑛𝑔𝑒)
= 0.108 + 0.012 + 0.072 + 0.008 = 0.2
b. P(Toothache | Cavity):
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ 𝐶𝑎𝑣𝑖𝑡𝑦)
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 | 𝐶𝑎𝑣𝑖𝑡𝑦) =
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦)
(0.0108+0.012) 0.12
= = = 0.6
0.2 0.2

c. P(Cavity | Toothache ∨ Change):

𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 ∧ (𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒 ))


𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 | 𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒) =
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒)

P(Cavity ∧ Toothache)+ P(Cavity ∧ Change)– P(Cavity ∧ Toothache ∧ Change)


= P(Toothache ∨ Change)

0.108 + 0.072 − 0.108


= P(Toothache ∨ Change) (Considering the intersection of events)
0.072
=
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒)
Now, calculate 𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒):
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒) = 𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ ¬𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(¬𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ 𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ 𝐶ℎ𝑎𝑛𝑔𝑒) +
𝑃(¬𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∧ ¬𝐶ℎ𝑎𝑛𝑔𝑒)
= 0.012 + 0.072 + 0.108 + 0.576 = 0.768

Now, calculate 𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 |𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒):


0.072
𝑃(𝐶𝑎𝑣𝑖𝑡𝑦 |𝑇𝑜𝑜𝑡ℎ𝑎𝑐ℎ𝑒 ∨ 𝐶ℎ𝑎𝑛𝑔𝑒) = ≈ 0.09375
0.768

Therefore:
a. 𝑷(𝑪𝒂𝒗𝒊𝒕𝒚) = 𝟎. 𝟐
b. 𝑷(𝑻𝒐𝒐𝒕𝒉𝒂𝒄𝒉𝒆 | 𝑪𝒂𝒗𝒊𝒕𝒚) = 𝟎. 𝟔
c. 𝑷(𝑪𝒂𝒗𝒊𝒕𝒚 | 𝑻𝒐𝒐𝒕𝒉𝒂𝒄𝒉𝒆 ∨ 𝑪𝒉𝒂𝒏𝒈𝒆) ≈ 𝟎. 𝟎𝟗𝟑𝟕𝟓

6. The fact that the disease is rare is good news because even though Mr. Willoughby tested
positive, the probability that he actually has the disease might still be relatively low due to
the rarity of the disease in the general population. This is a scenario where the prevalence
of the disease influences the interpretation of the test results.

Let's calculate the probability that Mr. Willoughby actually has the disease given that he
tested positive, using Bayes' Theorem:

Let:
• 𝐷 be the event that Mr. Willoughby has the disease.
• 𝐷′ be the event that Mr. Willoughby does not have the disease.
• P(𝑇 + | 𝐷) be the probability of testing positive given that he has the disease
(sensitivity of the test), which is 0.99.
• 𝑃(𝑇 − | 𝐷′ ) be the probability of testing negative given that he does not have the
disease (specificity of the test), which is also 0.99.
• P(D) be the prior probability that Mr. Willoughby has the disease, which is 1 in
10000 or 0.0001.

Bayes' Theorem is given by:


𝑃(𝑇 + | 𝐷)⋅𝑃(𝐷)
𝑃(𝐷 | 𝑇 + ) = 𝑃(𝑇 + )
We need to calculate 𝑃(𝑇 + ), the probability of testing positive, which can occur either
because he has the disease and tests positive (P(T + ⋂ 𝐷)) or because he does not have the
disease and tests positive (P(T + ⋂ D′ )):
𝑃(𝑇 + ) = 𝑃(𝑇 + ⋂ 𝐷) + 𝑃(𝑇 + ⋂ 𝐷′ )
𝑃(𝑇 + ) = 𝑃(𝑇 + | 𝐷) ⋅ 𝑃(𝐷) + 𝑃(𝑇 + | 𝐷′ ) ⋅ 𝑃(𝐷′ )
𝑃(𝑇 + ) = (0.99 ⋅ 0.0001) + (0.01 ⋅ 0.9999)

Now, we can use Bayes' Theorem to calculate P(D |T + ):

0.99 ⋅ 0.0001
𝑃(𝐷 |𝑇 + ) =
(0.99 ⋅ 0.0001) + (0.01 ⋅ 0.9999)

Let's calculate this value:

0.000099 0.000099
𝑃(𝐷 |𝑇 + ) ≈ ≈ ≈ 0.0098
0.000099 + 0.009999 0.010098

Therefore, the probability that Mr. Willoughby actually has the disease, given that he tested
positive, is approximately 0.98% (or 0.0098). Despite the high accuracy of the test, the low
prevalence of the disease in the population makes the probability of a true positive
relatively small.

You might also like