Intelligent Systems II · TEE · read
Inference using the full joint distribution (5-mark PYQs)
Unit 1 · Uncertainty, joint distributions and Bayes rule
Unit 1 · Quantifying uncertainty, inference using the full joint distribution, Bayes rule
A joint-probability table is a list of complete combinations. Three Yes/No variables have 2×2×2=8 combinations. “Marginalise” means ignore a variable by adding its possible cases. “Condition” means first restrict attention to the evidence cases, then divide by their total. For unnormalised weights .12 and .08, the total is .20; α=1/.20=5, so α×.12=.6 and α×.08=.4. α is only a rescaling constant.
In one line: a full joint table lists the probability of every combination; to answer any question, add the cells where it is true, and for “given” questions divide by the cells of the evidence.
Method
- Marginal
LaTeX:
P(a): add every cell in which a is true. - Conditional
LaTeX:
P(a\mid e)=\dfrac{P(a\land e)}{P(e)}: add cells where both hold, divide by the sum of cells where e holds. - Normalisation:
LaTeX:
\mathbf P(A\mid e)=\alpha\,\mathbf P(A,e)withLaTeX:
\alpha=1/P(e): compute the unnormalised values for every value of A, then scale them to sum to 1.
Question. For the dentist table below find P(cavity ∨ toothache), P(cavity | toothache) and P(¬cavity | toothache). [class example · 3 marks]
Given
The complete joint table or cell values printed in this question. The rows and columns identify the event combinations.
To find
All requested marginal and conditional probabilities.
Formula and why it applies
Marginal: add cells satisfying the event. Conditional: retain the evidence cells and divide the joint-event sum by the evidence sum.
P(A\mid E)=\frac{P(A\cap E)}{P(E)},\quad P(E)>0Solution
| toothache, catch | toothache, ¬catch | ¬toothache, catch | ¬toothache, ¬catch | |
|---|---|---|---|---|
| cavity | 0.108 | 0.012 | 0.072 | 0.008 |
| ¬cavity | 0.016 | 0.064 | 0.144 | 0.576 |
Step 1. Disjunction
P(cavity\lor toothache)=0.108+0.012+0.072+0.008+0.016+0.064=0.28Step 2. Conditionals
P(toothache)=0.108+0.012+0.016+0.064=0.2,\qquad P(cavity\mid toothache)=\frac{0.12}{0.2}=0.6,\qquad P(\lnot cavity\mid toothache)=\frac{0.08}{0.2}=0.4With α: LaTeX:
\mathbf P(Cavity\mid toothache)=\alpha\langle0.12,\,0.08\rangle=\langle0.6,\,0.4\rangle, LaTeX:
\alpha=1/0.2=5.
Question. A supermarket recorded the joint distribution of Product type (Y: premium = 1, regular = 0), Payment mode (X: credit = 1, debit = 0) and Gender (Z: female = 1, male = 0). (a) If a customer bought a premium item, find the probability that (1) they are female, (2) they paid by credit card. (b) Find (1) P(premium) and (2) P(credit card). (c) Given a male customer paid by debit card, find the probability he bought a regular item. [5 marks · Final Nov 2025 Q1a]
Given
The printed eight entries are reproduced below. Their total is 1.002, not 1. Therefore the table is inconsistent as a probability distribution.
| Credit, female | Credit, male | Debit, female | Debit, male | |
|---|---|---|---|---|
| Premium (Y=1) | 0.08 | 0.10 | 0.072 | 0.05 |
| Regular (Y=0) | 0.10 | 0.15 | 0.25 | 0.20 |
To find
The five requested probabilities, stating how the inconsistent data are interpreted.
Formula and why it applies
For this worked solution, treat all printed entries as nonnegative weights and normalise by their total 1.002. This preserves the printed ratios. It is a declared interpretation, not a claim about the examiner’s intended correction.
P(E)=\frac{\text{sum of weights for }E}{\text{sum of all weights}}P(A\mid E)=\frac{\text{sum of weights for }A\cap E}{\text{sum of weights for }E}Solution
Step 1. Validate the full table
0.08+0.10+0.072+0.05+0.10+0.15+0.25+0.20=1.002Use total weight 1.002 consistently for unconditional probabilities.
Step 2. Premium row total
w(premium)=0.08+0.10+0.072+0.05=0.302Step 3. Female given premium
P(female\mid premium)=\frac{0.08+0.072}{0.302}=\frac{0.152}{0.302}\approx0.503311Step 4. Credit given premium
P(credit\mid premium)=\frac{0.08+0.10}{0.302}=\frac{0.18}{0.302}\approx0.596026Step 5. Normalised premium marginal
P(premium)=\frac{0.302}{1.002}\approx0.301397Step 6. Normalised credit marginal
P(credit)=\frac{0.08+0.10+0.10+0.15}{1.002}=\frac{0.43}{1.002}\approx0.429142Step 7. Regular given male and debit
P(regular\mid male,debit)=\frac{0.20}{0.05+0.20}=0.8Alternative correction: if 0.072 is corrected to 0.070, the total becomes 1 and the corresponding answers are (a) 0.50 and 0.60; (b) 0.30 and 0.43; (c) 0.8. This agrees with the interpretation used in the supplied key. State the correction; do not call raw totals 0.302 and 0.43 valid marginals of the original inconsistent table.
Question. For a disease Y with fever X as a symptom, a test Z is conducted. Joint probabilities: Disease (Y=1): fever & test+ 0.576, fever & test− 0.144, no fever & test+ 0.072, no fever & test− 0.016; No disease (Y=0): 0.008, 0.064, 0.012, 0.108. (1) If fever occurs and the test is positive, what is the probability of disease? (2) What is the probability that a random person tests positive? (3) Given no fever, what is the probability of still having the disease? [5 marks · Re-exam Jan 2026 Q1a]
Given
The complete joint table or cell values printed in this question. The rows and columns identify the event combinations.
To find
All requested marginal and conditional probabilities.
Formula and why it applies
Marginal: add cells satisfying the event. Conditional: retain the evidence cells and divide the joint-event sum by the evidence sum.
P(A\mid E)=\frac{P(A\cap E)}{P(E)},\quad P(E)>0Solution
Step 1. (1)
P(Y{=}1\mid X{=}1,Z{=}1)=\frac{0.576}{0.576+0.008}=\frac{0.576}{0.584}=0.986Step 2. (2) Add every test-positive cell
P(Z{=}1)=0.576+0.072+0.008+0.012=0.668Step 3. (3)
P(X{=}0)=0.072+0.016+0.012+0.108=0.208,\qquad P(Y{=}1\mid X{=}0)=\frac{0.072+0.016}{0.208}=\frac{0.088}{0.208}=0.423