# Q7(a) Bayes bag posterior [5]

Subject: Intelligent Systems II

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/is2/#tee/papers/paper-2024-final/q7a

Canonical: https://deep-learning-study-room.vercel.app/read/is2/tee/papers/paper-2024-final--q7a/

Actual historical paper ·100 marks attempted /140 offered · Q1 compulsory + any four of Q2–Q7. Source defects and solution assumptions are explicitly identified.

**Question. Q7(a)** [5 marks · 2024-04-17]

Bag B₁ contains 3 white and 7 black balls. Bag B₂ contains 5 white and 3 black balls. A ball drawn from one of the bags is white. Find the probability it came from B₁.

### Answer

#### Given

P(W|B₁)=3/10; P(W|B₂)=5/8.

#### To find

P(B₁|W).

#### Formula and why it applies

Bayes reverses the condition. Weight the likelihood for each bag by its prior chance of being chosen, then normalize over all ways to obtain a white ball.



$$
P(B_1\mid W)=\frac{P(W\mid B_1)P(B_1)}{P(W\mid B_1)P(B_1)+P(W\mid B_2)P(B_2)}
$$



#### Solution

**Source / assumption note.** The bag-selection prior is not stated. Assume each bag is equally likely, P(B₁)=P(B₂)=1/2. If bags are chosen by a different rule, this posterior changes.

##### Step 1. Calculate both white-event contributions



$$
P(W,B_1)=\frac3{10}\frac12=\frac3{20}=0.15
$$





$$
P(W,B_2)=\frac58\frac12=\frac5{16}=0.3125
$$



##### Step 2. Find total white probability



$$
P(W)=\frac3{20}+\frac5{16}=\frac{12+25}{80}=\frac{37}{80}=0.4625
$$



##### Step 3. Normalize the B₁ contribution



$$
P(B_1\mid W)=\frac{3/20}{37/80}=\frac3{20}\frac{80}{37}=\frac{12}{37}\approx0.324324
$$



**Final answer.** Under equal bag-selection priors, 12/37 ≈ 0.324324.
