Solution (source code)

= Solution

The <beta distribution> <prior density> is proportional to $p^{a-1}(1-p)^{b-1}$. By <Bayes' theorem>, its product with the <likelihood function> gives the <posterior density>
$$
\pi(p\mid x)\propto p^{a+n-1}(1-p)^{b+S-n-1}.
$$
This is again a <beta distribution>, namely
$$
\boxed{p\mid x\sim\operatorname{Beta}(a+n,b+S-n)}.
$$
Thus the beta family is a <conjugate prior> family for the <geometric distribution>. The update is an instance of <beta-geometric conjugacy>: counts of observed successes and failures are added to the two beta parameters.