PYTHON
Free Section Starter Challenge
30 min
10. Reasoning Under Uncertainty: Bayes Theorem in Python
Overview: Update prior belief probabilities in the presence of noisy sensory evidence using Bayes rule.
Concept & Syntax Guide
Agents operating in the physical world face uncertainty caused by incomplete perception and noisy sensors. Bayes Rule updates the probability of a hypothesis $H$ given observation evidence $E$: $P(H|E) = rac{P(E|H) P(H)}{P(E)}$.
Hands-On Practice Exercise
Compute Posterior Probability with Bayes Rule
Given P(Disease)=0.01, P(Pos|Disease)=0.95, and P(Pos|NoDisease)=0.10, compute P(Disease|Pos).
Target Output:
Posterior Probability: 0.087 (8.7%)
Need a hint? Click here to reveal
Hint: Check syntax carefully and make sure your code contains:
Posterior Probability: 0.087 (8.7%)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10