You are on page 1of 4

Introduction to Artificial Intelligence, Autumn Semester 2011

Nick Hawes, School of Computer Science, University of Birmingham

Non-Assessed Work: Probabilistic AI


Lab: UG04, 3pm-6pm November 1st 2011

Question 1

Fill in the missing values in the following joint probability tables.

b ¬b b ¬b

a 0.67 a 0.23 0.32 a 0 0.01

¬a 0.33 ¬a 0.01 0.44 ¬a 0.9 0.09

Question 2

With the help of the additional values, fill in the following joint probability tables.

P(a) = 0.2
P(b) = 0.3 P(a ⋀ ¬b) = 0.11

b ¬b b ¬b

a 0.25 0.6 a 0.09 0.11 0.2

¬a 0.05 0.1 ¬a 0.04 0.76

0.3

Question 3

With the help of the additional values, fill in the following joint probability tables, then
provide the requested values. Do not assume that the variables are independent.

P(a) = 0.5
P(b) = 0.67

c ¬c P(c) = 0.7

b ¬b b ¬b P(a ⋀ ¬b) = 0.15

a 0.2 0.1 0.15 0.05 0.5 P(a ⋀ ¬b ⋀ ¬c) = 0.05

¬a 0.3 0.1 0.02 0.08 0.5

calculate P(a ⋀ b ⋀ c) from difference between P(b) and rest of b values


P(a) = 0.4 P(a ⋀ b) = 0.3
P(b) = 0.7

c ¬c P(c) = 0.59

b ¬b b ¬b P(¬b ⋀ ¬c) = 0.01

a 0.1 0.09 0.2 0.01 0.4 P(a ⋁ b) = 0.8

¬a 0.2 0.2 0.2 0

calculate P(a ⋀ b ⋀ ¬c) from difference between P(a ⋀ b ⋀ c) and P(a ⋀ b)

Question 4

Given P(¬a | b) = 0.61, P(a | ¬b) = 0.44 and P(b) = 0.02, calculate P(a).

via conditioning

P(a) = P(a | b) * P(b) + P(a | ¬b) * P(¬b)


P(a) = (1 - P(¬a | b)) * P(b) + P(a | ¬b) * P(¬b) [because P(a | b) + P(¬a | b) = 1]
P(a) = (1 - 0.61) * 0.02 + 0.44 * (1 - 0.02) [because P(b) + P(¬b) = 1]
P(a) = 0.439

Question 5

This was the first question on the probabilistic AI continuous assessment last year

The likelihood of an accident on any particular day on the M6 motorway through


Birmingham depends on the weather. If it is dry, the probability of an accident is 0.3. If it
is raining, that probability goes up to 0.6, and if it is snowing, it becomes 0.95. In a typical
year in Birmingham it rains 40% of the time and snows 1% of the time. If there is an
accident, the motorway will be closed 20% of the time, but sometimes the motorway is
closed even though there isn't an accident. This happens 2% of the time.

a) What is the probability that there is an accident on the motorway if I know nothing
about the weather or the state of the motorway? Show your working.

Variables

Weather = {raining, snowing, dry}


Accident = {true, false}
MotorwayClosed = {true, false}

Given

P(accident | dry) = 0.3


P(accident | raining) = 0.6
P(accident | snowing) = 0.95
P(raining) = 0.4
P(snowing) = 0.01
P(motorwayclosed | accident) = 0.2
P(motorwayclosed | ¬accident) = 0.02

Inference

P(dry) because all values of Weather should sum to 1


P(dry) = 1 - P(raining) - P(snowing) = 1 - 0.4 - 0.01= 0.59

P(accident) via conditioning

P(accident) =
P(accident | dry) P(dry)
+ P(accident | raining) P(raining)
+ P(accident | snowing) P(snowing)
= 0.3 * 0.59 + 0.6 * 0.4 + 0.95 * 0.01
= 0.4265

b) Given that the motorway is closed completely, what's the probability that there is an
accident? Show your working.

P(accident | motorwayclosed) via Bayes rule

P(accident | motorwayclosed) = P(motorwayclosed | accident) P(accident)


P(motorwayclosed)

To do this we first need to find P(motorwayclosed), which we can get via conditioning

P(motorwayclosed) = P(motorwayclosed | accident) * P(accident)


+ P(motorwayclosed | ¬accident) * P(¬accident)
= 0.2 * 0.4265 + 0.02 * (1 - 0.4265)
= 0.09677
So...

P(accident | motorwayclosed) = (0.2 * 0.4265) / 0.09677 = 0.8815


Question 6

The information in this question was part of a test given to physicians to see whether they
could understand conditional probabilities (spoiler: they couldn’t).

When screening for colorectal cancer, a fecal occult blood test (FOBT) is used. The FOBT
has the following properties: it has a sensitivity of 50% (i.e. given you have the condition,
it detects it 50% of the time) and it has a false-positive rate of 3% (i.e. given it says you
have the condition, 3% of the time you don’t). Colorectal cancer has a prevalence of
0.3%, i.e. this is the percentage of the population you generally expect to have the
condition. Calculate the probability of someone have colorectal cancer given a positive
test result.

The paper this work comes from: http://www.psychologicalscience.org/journals/pspi/


pspi_8_2_article.pdf
Video lecture: http://videolectures.net/icots2010_gigerenezer_hdap/

Variables

ConditionPresent = {true, false}


TestPositive = {true, false}

Given

Sensitivity: P(test | condition) = 0.5


False positive rate: P(test | ¬condition) = 0.03
Prevalence: P(condition) = 0.003

Inference

We need to determine the probability that someone has the condition given a positive test
restult. This is P(condition | test)

This is a Bayes rule problem of the form

P(condition | test) = P(test | condition) P(condition) / P(test)

We don’t know P(test), so we find it via conditioning

P(test) = P(test | condition) * P(condition) + P(test | ¬condition) * P(¬condition)


P(test) = 0.5 * 0.003 + 0.03 * (1 - 0.003)
P(test) = 0.03141

Therefore

P(condition | test) = 0.5 * 0.003 / 0.03141


P(condition | test) = 0.0478

You might also like