Intelligent Systems II · TEE · mocks
Q3(a) Bayesian network: wet grass given no rain [10]
Final examination · 24 Nov 2025
100-mark timed practice using the actual Final 2025 paper. Q1 compulsory; any four of Q2–Q7. Worked solutions are below the questions.
Question. Cloudy → Sprinkler, Cloudy → Rain, Sprinkler and Rain → Wet Grass. P(Cloudy) = 0.5; P(Sprinkler | C) = 0.10, P(Sprinkler | ¬C) = 0.50; P(Rain | C) = 0.80, P(Rain | ¬C) = 0.20; P(Wet | S, R) = 0.99, P(Wet | S, ¬R) = 0.90, P(Wet | ¬S, R) = 0.90, P(Wet | ¬S, ¬R) = 0.01. Calculate the probability of the grass being wet given it doesn't rain. [10 marks]
Answer
The following table enumerates the values of Cloudy and Sprinkler that were not fixed by the question. Two Boolean choices give four rows: true/true, true/false, false/true, false/false. Each row is one mutually exclusive complete case. Read the CPT entry using that row’s parent values, multiply its factors, and add the resulting row weights. The denominator must include all cases matching the evidence, including both possible values of the queried outcome.
Given
C→S, C→R, (S,R)→W. Root and conditional probabilities are listed in the question. Evidence R=false.
To find
P(W=true | R=false). Hidden variables C and S must be summed out.
Formula and why it applies
Use the network joint and divide by the evidence probability.
P(W\mid\neg R)=\frac{\sum_{c,s}P(c)P(s\mid c)P(\neg R\mid c)P(W\mid s,\neg R)}{\sum_cP(c)P(\neg R\mid c)}Solution
Step 1. Joint by the chain rule
P(C,S,R,W)=P(C)\,P(S\mid C)\,P(R\mid C)\,P(W\mid S,R)Step 2. Sum over C and S with R = false, W = true
| C | S | P(C) | P(S|C) | P(¬R|C) | P(W|S,¬R) | Product |
|---|---|---|---|---|---|---|
| T | T | 0.5 | 0.1 | 0.2 | 0.90 | 0.0090 |
| T | F | 0.5 | 0.9 | 0.2 | 0.01 | 0.0009 |
| F | T | 0.5 | 0.5 | 0.8 | 0.90 | 0.1800 |
| F | F | 0.5 | 0.5 | 0.8 | 0.01 | 0.0020 |
| P(W, ¬R) | 0.1919 | |||||
Step 3. Evidence
P(\lnot R)=P(C)P(\lnot R\mid C)+P(\lnot C)P(\lnot R\mid\lnot C)=0.5(0.2)+0.5(0.8)=0.5Step 4. Divide
P(W\mid\lnot R)=\frac{0.1919}{0.5}=0.3838Optional comparison: calculate P(Wet) from the same network
The four no-rain cases already total 0.1919. Now add the four rain cases, keeping the same Cloudy/Sprinkler order.
P(W,R)=0.5(0.1)(0.8)(0.99)+0.5(0.9)(0.8)(0.90)+0.5(0.5)(0.2)(0.99)+0.5(0.5)(0.2)(0.90)P(W,R)=0.0396+0.324+0.0495+0.045=0.4581P(W)=P(W,R)+P(W,\neg R)=0.4581+0.1919=0.6500P(R\mid W)=\frac{0.4581}{0.6500}\approx0.704769231Meaning: the unconditional chance of Wet is 0.65, the chance of Rain among wet cases is about 0.704769, and the requested chance of Wet among no-rain cases is 0.3838. These are three different questions.