Solution (source code)

= Solution
{c}

Conditional on $\theta$, the future <Bernoulli random variable> is independent of the observed <statistical sample> and has success <probability> $\theta$. Its <posterior predictive probability> is therefore the <posterior mean> of $\theta$. Put $A=a+s$ and $B=b+n-s$. Then
$$
\begin{aligned}
\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)}
=\frac{\Gamma(A+1)\Gamma(A+B)}{\Gamma(A)\Gamma(A+B+1)}
=\frac A{A+B},
\end{aligned}
$$
using the <beta-gamma identity> and the <Gamma function recurrence>. Hence
$$
\boxed{\mathbb P(X_{n+1}=1\mid X_1,\ldots,X_n)=\frac{a+\sum_iX_i}{a+b+n}.}
$$
The whole <posterior predictive distribution> of $X_{n+1}$ is the <Bernoulli distribution> with this success <probability>.