I have some doubts that -for many of you- might seem basic and I am basically looking for some guidance verifying my attempt of solution.
The Problem
Let $p(x\mid\theta)=Bernoulli(\theta)$, and let's suppose the Prior Distribution is given by $p(\theta)=Beta(\theta \mid \alpha,\beta)$. ($\theta$ is unknown, and $\alpha, \beta$ are known).
Assume independet observations and obtain: 1) The Posterior Distribution of $\theta$, 2)The Prior Predictive Distribution, and 3)The Posterior Predictive Distribution.
Attempt of Solution
Let $I=\{1,2,...,n\}$, $\mathrm{X}=\{X_i\}_{i \in I}$ the independent observatrions above mentioned, and $\mathbb{I}$ be the Indicator function.
1)
Given the information of the excercise,
$p(\theta \mid \mathrm{x})=\frac{[\prod_{i \in I}\theta^{x_i}(1-\theta^{1-{x_i}})\mathbb{I}_{\{0,1\}}(x_i)][\theta^{\alpha-1}(1-\theta)^{1-\beta} \mathbb{I}_{[0,1]}(\theta)]}{\int_\Theta [\prod_{i \in I}\theta^{x_i}(1-\theta^{1-{x_i}})\mathbb{I}_{\{0,1\}}(x_i)][\theta^{\alpha-1}(1-\theta)^{1-\beta} \mathbb{I}_{[0,1]}(\theta)]d\theta}$
$p(\theta \mid \mathrm{x})=\frac{\theta^{\alpha + r-1}(1-\theta)^{\beta+n-r-1}\mathbb{I}_{\{0,1\}}(x_i)\mathbb{I}_{[0,1]}(\theta)}{\int_0^1\theta^{\alpha + r-1}(1-\theta)^{\beta+n-r-1}\mathbb{I}_{\{0,1\}}(x_i)d\theta}$
$p(\theta \mid \mathrm{x})=Beta(\theta \mid \alpha+r,\beta+n-r),$ $r:=\sum_{i \in I}x_i$.
2) The Prior Predictive Distribution $p(x)$ is given then by
$p(x)=\frac{1}{Beta(\theta \mid \alpha,\beta)}\int_0^1\theta^{\alpha+x-1}(1-\theta)^{\beta-x}\mathbb{I}_{\{0,1\}}(x)d\theta$
$p(x)=\frac{1}{Beta(\theta \mid \alpha,\beta)}\int_0^1(\theta^{\alpha+x-1}-\theta^{\alpha+\beta-1})\mathbb{I}_{\{0,1\}}(x)d\theta$
$p(x)=\frac{1}{Beta(\theta \mid \alpha,\beta)}(\frac{1}{\alpha+x}-\frac{1}{\alpha+\beta})\mathbb{I}_{\{0,1\}}(x)$
3) The Posterior Predictive Distribution $p(x \mid \mathrm{x})$ is given then by
$p(x \mid \mathrm{x})=\frac{1}{Beta(\theta \mid \alpha+r,\beta+n-r)}\int_0^1\theta^{\alpha+x+r-1}(1-\theta)^{\beta+n-x-r}\mathbb{I}_{\{0,1\}}(x)d\theta$
$p(x \mid \mathrm{x})=\frac{1}{Beta(\theta \mid \alpha+r,\beta+n-r)}\int_0^1(\theta^{\alpha+x+r-1}-\theta^{\alpha+\beta+n-1})\mathbb{I}_{\{0,1\}}(x)d\theta$
$p(x \mid \mathrm{x})=\frac{1}{Beta(\theta \mid \alpha+r,\beta+n-r)}(\frac{1}{\alpha+x+r}-\frac{1}{\alpha+\beta+n})\mathbb{I}_{\{0,1\}}(x)$