Bayesian Networks Laboratory
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
FIT5047 Semester 1, 2022 Bayesian Networks Laboratory
FIT5047 – Bayesian Networks Laboratory (10%)
Question 1: Bayesian Networks, Netica (12 + [1× 4 + 2× 2 + 3] + [1× 10] + 7 = 40)
Expand the Bayes Net you developed in the BN tutorial (available on moodle under the name
SmokeAlarm.dne) to include three more events: Smoke (you can see smoke in your apartment),
Evacuation (your apartment building is evacuated), and Report (the local newspaper writes
a report about the evacuation of your apartment).
The probability of smoke when there is fire is 0.9, the probability of smoke when there is no
fire is 0.01. When your apartment building has a fire alarm, there is a 0.88 probability that
there will be an evacuation, but there is never an evacuation when there is no fire alarm. If
there is an evacuation, there is a 0.75 probability that the newspaper will write a report on it,
and if there is no evacuation there is a 0.99 probability that the newspaper won’t report it.
(a) Add the necessary nodes and edges to your BN, and input the corresponding conditional
probability tables. Justify your expanded network and CPTs. A BN without justifica-
tion will receive no marks.
(b) Use Netica on the expanded BN to answer the following questions:
i. What is the marginal probability that your smoke detector has been tampered with?
ii. What is the marginal probability that there will be a news report tomorrow?
iii. Let’s assume that you have observed that there is smoke in your apartment. What is
the posterior probability that there will be a news report tomorrow?
iv. Let’s assume that you have observed that there was no fire, and that there was a
news report about your apartment. What is the posterior probability that your smoke
detector has been tampered with?
v. Let’s assume that you have observed that there is no smoke in your apartment. What
is the posterior probability that your smoke detector has been tampered with? What
conditional independence property could help you here?
vi. Let’s assume that you have observed that there has been a news report about your
apartment, and there is no smoke in your apartment. What is the posterior probability
that your smoke detector has been tampered with? Given that the news report was
observed, why does observing the absence of smoke affect your belief of whether or not
your smoke alarm was tampered with?
vii. Let’s assume that you have observed that there was no fire, that there was a news
report about your apartment, and that there is smoke in your apartment. What is
the posterior probability that your smoke detector has been tampered with? How does
observing whether or not there is smoke affect your belief of whether or not your smoke
detector has been tampered with? Why?
1
(c) Hypothesize the (conditional) independence properties of the statements below. Use Netica
to check them, and state whether they are true or false. Briefly justify your answers
by indicating whether the variables in question are connected or D-separated, and which
variable(s) block or unblock the path — use the terms of Common Cause, Common Effect
and Causal Chain where applicable. Answers without explanations will receive no
marks.
Note: The graph structure informs us about dependences between variables, but there
may be additional dependences based on the values of the conditional probability tables.
Tampering ⊥ Evacuation
Tampering ⊥ Evacuation | Alarm
Tampering ⊥ Evacuation | Smoke
Tampering ⊥ Fire
Tampering ⊥ Fire | Alarm
Alarm ⊥ Smoke
Smoke ⊥ Report
Smoke ⊥ Tampering
Smoke ⊥ Tampering | Alarm
Smoke ⊥ Tampering | Report
(d) Based on your BN, construct a Bayesian Decision Network (BDN) that decides whether
the building should be evacuated. That is, instead of having an Evacuation chance node,
you should have a decision node that determines whether you should evacuate the building.
Specify and justify the information links and the values in the utility node. BDNs without
justifications will receive no marks.
Question 2: Bayesian Networks, Netica (16 + [2× 2] + 13 + [1 + 3× 2] = 40)
It is coming to the end of winter and Ron is trying to model the factors that affect the state
of his lawn. The lawn is currently looking pretty sad, as his children spent all last summer
playing backyard cricket, and have worn several bare patches. However, the area has been in
drought for the previous 12 months. If there is no rain before summer, it will be very hard to
get the new lawn to grow, and Ron will waste a lot of time and money. Furthermore, if there
is no rain, the authorities could increase the level of water restrictions, meaning that Ron will
be unable to water his lawn at all. This would make the chances of his lawn surviving very
small indeed. To further complicate the matter, there is a small chance that the area could
experience another frost before the weather warms up, which also could damage the new lawn.
(a) Design a BN using the nodes: Rain, LawnGrow, WaterRestrictions and Frost. Justify your
design. A BN without justification will receive no marks.
(b) Inspect your BN and report on any value assignments that will cause d-separation between
any sets of nodes. Explain why this is the case in terms of Common Cause, Common Effect
and Causal Chain. Value assignments without explanations will receive no marks.
(c) Quantify the relationships in the network by adding numbers for the CPTs. Justify the
numbers in your CPTs. CPTs without justification will receive no marks.
(d) Using Netica, demonstrate the workings of your BN by determining the probability of the
lawn growing in the following cases.
1. There is no evidence.
2
2. There is no rain, and water restrictions have been applied. Explain your results
compared to item 1.
3. There is frost, but it has rained. Explain your results compared to item 1.
Question 3: D-separation (9 + 5 + 6 = 20 marks)
Consider the following Bayesian Network called rental2.dne (available on moodle).
(a) List the conditions under which you will be able to propagate evidence from Interest rate
to Rent charged. That is, which nodes need to be instantiated or uninstantiated so that
evidence can be propagated from Interest rate to Rent charged. Explain why this is the
case using the terms Common Cause, Common Effect and Causal Chain where applicable.
Answers without explanations will receive no marks.
(b) Repeat question (a) for propagating evidence from Desirable investment to Housing prices.
Explain why this is the case using the terms Common Cause, Common Effect and Causal
Chain where applicable. Answers without explanations will receive no marks.
(c) Repeat the above questions under the assumption that there is also an arc from Hous-
ing prices to Tenant (the corresponding BN, rental3.dne, is available on moodle). Pro-
vide explanations using the terms Common Cause, Common Effect and Causal Chain where
applicable. Answers without explanations will receive no marks.
3
Submission instructions:
1. At the end of the lab, upload your BNs and BDNs (in .dne or .neta format) to moodle in a
zip file named BNlab-StudentID.zip, where StudentID is your Student ID number.
2. Upload your report, BNs and BDNs to moodle by midnight of the second day after the
completion of your lab at the latest. Since all the labs are on Friday, the reports should
be uploaded by Sunday 11:59 pm at the latest.
3. Multiple submissions are allowed until the deadline, and drafts will be deemed submitted at
the deadline.
Important:
• Only typed textual explanations will be accepted. Scanned or handwritten expla-
nations will be automatically rejected, and will receive no marks.
• Your report should include screenshots of the Netica networks (BN and BDN) under the
different conditions, and representations of the CPTs and utility table.
• You should have completed at least one question when you attend the lab, and you must
be available for questions from your tutor during the lab.
• You may be interviewed about your work in order to determine your mark for this lab.
Late submission policy:
10% of the maximum mark will be deducted for every calendar day a submission is late.