# Exercise 4.2 of Jaynes Probability theory

Assume we have three hypotheses: $$A\equiv\text{we have a box with 1/3 defective}\\B\equiv\text{we have a box with 1/6 defective}\\C\equiv\text{we have a box with 99/100 defective}$$ given the prior information $X$, we take: $$P(A|X)=\frac{1}{11}(1-10^{-6})\\P(B|X)=\frac{10}{11}(1-10^{-6})\\P(C|X)=10^{-6}$$ The threshold fraction ($f_t$) is defined like this: as the number of tests ($m$) goes to infinity ($m\rightarrow\infty$) with $f=m_b/m\rightarrow\text{constant}$, $e(C|DX)$ tends to $+\infty$ if $f>f_t$ and $-\infty$ if $f<f_t$. $m_b$ is the number of defective draws, $D$ is the data and $e(A|B)$ is the evidence for $A$ given $B$ defined as: $$e(A|B)=10\log_{10}\frac{P(A|B)}{P(\overline{A}|B)}$$ The exercise is this: given the above what is the threshold fraction?

In the book he gives the plausibility flow diagrams in Fig.4.2 using the definition of evidence for two hypotheses at a time: $$e(C|DX)=e(C|X)+10\log_{10}\frac{P(D|CX)}{P(D|\overline{C}X)}$$ where in a two hypothesis case between $C$ and $A$: $\overline{C}=A$. So as shown in Fig.4.2 we easily see that the last term becomes $b=4.73$ if we get a bad draw and $g=-18.24$ if we get a good one. So assuming we get $n_b$ bad draws and $n_g$ good ones the total evidence added to the prior evidence ($e(C|X)$) is: $bm_b+g(m-m_b)=(b-g)m_b+gm=m((b-g)f+g)$ for this to be zero $f$ has to be: $f_t=-g/(b-g)$ placing the values above we get: $0.794079$. This is very similar to the given solution: $0.793951$ but not identical. It also only resulted from considering $C$ and $A$. When I include $B$ through equation 4.39 in the book: $$P(D|\overline{C}X)=\frac{P(D|AX)P(A|X)+P(D|BX)P(B|X)}{P(A|X)+P(B|X)}$$I get $b=7.359974$ and $g=-16.619425$. Placing these in the above equation to find $f_t$ I find: $f_t=0.693070$ which is very much different with the desired answer. I would be very grateful if anyone can help me in understanding how Jaynes derived $f_t=0.793951$?

(It's an old question, but I'll try to answer anyways.)

Keep in mind that the evidence flows depend on which other hypotheses are under consideration: finding the change in evidence at the beginning, with no previous draws to nudge the hypotheses from their priors, means that the static evidence increments you are using will be incorrect if the situation changes: see Figure 4.1 in the text.

Instead, we want to fully express $e(C|DX)$ in terms of the fraction $f$, total number of draws $n$, and then see what happens when $n \to \infty$. Then, we could set $\frac{P(D|CX)}{P(D|\overline{C}X)} = 1$ (so $\log_{10}$ of this quantity would be $0$) and solve for $f$.

Using $b=fn$ and $g=(1-f)n$ as the good/bad counts:

$$\frac{P(D|CX)}{P(D|\overline{C}X)} = \frac{{{g+b}\choose{b}} y^b (1-y)^g}{{{g+b}\choose{b}}(1/3)^b(2/3)^g + {{g+b}\choose{b}}(1/6)^b(5/6)^g}$$ $$= \frac{11 y^{fn} (1-y)^{(1-f)n} }{(1/3)^{fn}(2/3)^{(1-f)n} + 10 (1/6)^{fn} (5/6)^{(1-f)n}}$$

(I skipped some steps where $x$ cancels out.)

I wasn't able to find a way to reduce this in the limit in a closed analytic form, which I presume is Jayne's reason for cheekily hinting that you should write a short computer program to find the correct numerical values, much like this person did in a github gist.

However, when I run my own numerical solution with $y=0.99$ at $n=500$, I find that my $f_t = 0.794155$. Take from that what you will.

There maybe something wrong with the answer.

$$\frac{P(D|CX)}{P(D|\overline{C}X)} \frac {{{g+b}\choose{b}} y^b (1-y)^g}{{{g+b}\choose{b}}(1/3)^b(2/3)^g + {{g+b}\choose{b}}(1/6)^b(5/6)^g}$$

For the $${P(D|\overline{C}X)} = \frac{P(A|X)P(D|AX) +P(B|X)P(D|BX)}{P(A|X)+P(B|X)}, where P(D|AX) = {{{g+b}\choose{b}}(1/3)^b(2/3)^g}$$, So i think the = symbol should be $\approx$, and the coefficient of P(D|AX) is $\frac{P(A|X)}{P(A|X)+P(B|X)} = 1/11$