NPTEL: AI Assignment 9 Solutions
Inference and Learning in Bayes Net
Solution Q1) 0.857
We need argmaxθ P(D|θ)P(θ).
P(D|θ)P(θ) = θ5 6θ (1- θ)
To find maxima, differentiate and set the derivative to 0.
𝑑 5 𝑑 6 7 5 6
𝑑θ
(θ 6θ (1 − θ)) = 𝑑θ
(θ − θ ) = 6θ − 7θ
6
Setting this to 0 gives θ = 7
= 0. 857
Solution Q2) 3
Correct statements are b, c, and f. Follow from videos.
Solution Q3) 0.83
P(?1 = 1) = P(B = 1 | A = 1, X = 1) ∝ P(A = 1, B = 1, X = 1)
∝ P(A = 1) P(B = 1 | A = 1) P(X = 1 | A = 1)
1 1 1 1
∝ 2
× 3
× 2
= 12
1
Similarly, P(?1 = 0) ∝ 12
Thus, P(?1 = 1) = 0.5
Similarly, P(?5 = 2) = 0.33
Solution Q4) 0.397
Using soft EM, we can -
a. Assign B = 1 with weight 0.5 and B = 0 with weight 0.5 in Row 1
b. Assign X = 0, X = 1, X = 2, with weight = ⅓ each in row 5
c. Assign X = 0, X = 1, X = 2, with weight = ⅓ each in row 10
𝑁𝑢𝑚 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑤𝑖𝑡ℎ 𝑋 = 1, 𝐵 = 1 0.5 + 3 + 0.33
P(X = 1 | B = 1) = 𝑁𝑢𝑚 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑤𝑖𝑡ℎ 𝐵 = 1
= 0.5 + 5
= 0. 697
(For the numerator, we have rows 2, 7, and 8 with weight = 1, row 1 with weight = 0.5, and
row 5 with weight = ⅓. For the denominator, we have rows 2, 3, 5, 7, and 8 with weight = 1,
and row 1 with weight = 0.5)
1.5
Similarly, P(B = 0 | A = 1) = 5
= 0. 3
Thus, answer = 0.697 - 0.3 = 0.397
Solution Q6) AD
- A is false, MAP works better than MLE with sparse data because of assuming a prior
over the parameter values
- B and C are factual and correct
- D is false, MLE assumes a uniform distribution prior over parameter values
Solution Q7) 5
BOLD ones are true, others are false.
a. The 15-Puzzle has a single agent setup
b. The game of poker has a partially observable environment
c. The game of poker is deterministic
d. The environment of an autonomous driving car is fully observable
e. Playing the game of chess under time constraints is semi-dynamic
f. The outcomes of the decisions taken by an autonomous driving
agent are stochastic in nature
g. The game of poker has a discrete environment
h. Interactive Medical Diagnosis chatbots do episodic decision making
Solution Q8) 0.5
Solution Q9) 240
Solution Q10) ABCD
- Factual, All statements are TRUE
Solution Q11) 0.71
A B C Count +
Smoothing
0 0 0 0+1
0 0 1 1+1
0 1 0 0+1
0 1 1 2+1
1 0 0 0+1
1 0 1 2+1
1 1 0 0+1
1 1 1 0+1
P(C=1|B=0) = Count(A=0, B=0, C=1) + Count(A=1, B=0, C=1) / Count(A=0, B=0, C=1) +
Count(A=1, B=0, C=1) + Count(A=0, B=0, C=0) + Count(A=1, B=0, C=0)
= (2 + 3) / (2+3+1+1)
= 5/7 = 0.71