# Paper 2, Section II, F

(a) Let $B_{1}, \ldots, B_{n}$ be pairwise disjoint events such that their union $B_{1} \cup B_{2} \cup \ldots \cup B_{n}$ gives the whole set of outcomes, with $\mathbb{P}\left(B_{i}\right)>0$ for $1 \leqslant i \leqslant n$. Prove that for any event $A$ with $\mathbb{P}(A)>0$ and for any $i$

$\mathbb{P}\left(B_{i} \mid A\right)=\frac{\mathbb{P}\left(A \mid B_{i}\right) \mathbb{P}\left(B_{i}\right)}{\sum_{1 \leqslant j \leqslant n} \mathbb{P}\left(A \mid B_{j}\right) \mathbb{P}\left(B_{j}\right)}$

(b) A prince is equally likely to sleep on any number of mattresses from six to eight; on half the nights a pea is placed beneath the lowest mattress. With only six mattresses his sleep is always disturbed by the presence of a pea; with seven a pea, if present, is unnoticed in one night out of five; and with eight his sleep is undisturbed despite an offending pea in two nights out of five.

What is the probability that, on a given night, the prince's sleep was undisturbed?

On the morning of his wedding day, he announces that he has just spent the most peaceful and undisturbed of nights. What is the expected number of mattresses on which he slept the previous night?