I'm trying to derive the posterior density of the probability parameter of a binomial random variable, given one realization of the random variable and a uniform prior density on the probability parameter.
X ~ Binomial(m, p) π(p) ~ Uniform[0, 1]
I know that to derive the posterior density, f(p|x), I want to divide the joint density f(x|p)π(p) by the marginal of X. Since the prior is uniform, I have that the joint density f(x|p)π(p) is just f(x|p), the binomial density.
However, I'm a bit at a loss for the marginal density of X. I think that I obtain it by integrating f(x|p) over all p in [0,1], producing 1/(m+1).
If I do this, I get that the posterior density is
(m+1) * choose(m,x) * p^x *(1-p)^(m-x) ,
which doesn't seem right. Am I doing anything wrong here?