Suppose we have two bit sources with static probabilities
p1 and p2, and a switching scheme added to that (static too) -
bits are taken from 1st or 2nd source with a probability w.
Then, let's say, we have N0 zeros and N1 ones in
the already processed data, so:
N01 = N0*w; N02 = N0*(1-w)
N11 = N1*w; N12 = N1*(1-w)
p1^N01 * p2^N02 * (1-p1)^N11 * (1-p2)^N12
is a probability of a bit string like that appearing
from switching sources with p1,p2,w as parameters.
(aka "likelihood" of these parameters)
(p1^w * p2^(1-w))^N0 * ((1-p1)^w * (1-p2)^(1-w))^N1
and, supposing we'd add another bit to the string:
l0 = (p1^w * p2^(1-w))^(N0+1) * ((1-p1)^w * (1-p2)^(1-w))^N1
l1 = (p1^w * p2^(1-w))^N0 * ((1-p1)^w * (1-p2)^(1-w))^(N1+1)
Thus,
P(bit==0) = l0/(l0+l1) =
p1^w * p2^(1-w) / (p1^w * p2^(1-w) + (1-p1)^w * (1-p2)^(1-w))
which can be rewritten as
1/(1 + (p1/(1-p1))^-w * p2/(1-p2)^(-1+w) )
...which is what paq mixer does.
Edit: also that - http://nishi.dreamhosters.com/u/stems5.png -
is how the paq mixer update can be derived.