Suppose you assign a $Beta(\alpha,\beta)$ prior distribution for $\theta$, and the you observed $y$ heads out of $n$ spins. Show algebraically that your posterior mean of $\theta$ always lies between your prior mean $\frac{\alpha}{\alpha+\beta}$ and the observed relative frequency of heads if $\frac{y}{n}$.
I have that $X\sim Bin(n,\theta)$ and $\theta\sim Beta(\alpha,\beta)$ so the posterior is $$\pi(\theta|x)\propto \pi(\theta)f(x|\theta)= \theta^{\alpha-1}(1-\theta)^{\beta-1}\theta^y(1-\theta)^{n-y}$$ $$=\theta^{a+y-1}(1-\theta)^{\beta+n-y-1}\sim Beta(a+y,n+\beta-y)$$ and the posterior mean is $$E[\pi(\theta|x)]=\frac{a+y}{a+n+\beta}$$
Now how I show that $$\frac{\alpha+y}{\alpha+n+\beta}\in (\frac{\alpha}{\alpha+\beta};\frac{y}{n})$$ ?
$\dfrac{\alpha+y}{\alpha+n+\beta}=\dfrac{\alpha+\beta}{\alpha+n+\beta}\cdot\dfrac{\alpha}{\alpha+\beta}+\dfrac{n}{\alpha+n+\beta}\cdot\dfrac{y}{n}$
Take $\gamma=\dfrac{n}{\alpha+n+\beta}\in(0,1)$ then $\dfrac{\alpha+y}{\alpha+n+\beta}=(1-\gamma)\dfrac{\alpha}{\alpha+\beta}+\gamma\dfrac{y}{n}$.
It is a convex combination of $\dfrac{\alpha}{\alpha+\beta}$ and $\dfrac{y}{n}$ so lies between the two.