Solution (source code)

= Solution

The further observation is independent of the earlier observations conditional on $\theta$. Integrate its conditional success <probability> against the posterior:
$$
\mathbb P(X_{n+1}=1\mid x)=\int_0^1\theta\,\pi(\theta\mid x)d\theta=\frac{B(A+1,B)}{B(A,B)}.
$$
The given factorial formula for the <beta function> gives this ratio as $A/(A+B)$. Thus the <posterior predictive probability> is
$$
\boxed{\mathbb P(X_{n+1}=1\mid x)=\frac{a+s}{a+b+n}.}
$$
It is the posterior mean of the Bernoulli success parameter. Independence here is conditional: sharing the uncertain parameter generally makes past and future observations dependent before conditioning on it.