Binomial uniform prior bayesian statistics Suppose to have a binomial distribution where the prior of the parameter is uniform.  How can I get the posterior distribution of the parameter? 
 A: This is very simple to do if you use a prior distribution that is conjugate to the Binomial likelihood function. A prior and likelihood are said to be conjugate when the resulting posterior distribution is the same type of distribution as the prior. This means that if you have binomial data you can use a beta prior to obtain a beta posterior. Conjugate priors are not required for doing bayesian updating, but they make the calculations a lot easier so they are nice to use if you can.
A beta prior has two shape parameters that determine what it looks like, and is denoted Beta(α, β). Taking your prior for p (probability of success) as uniform is equivalent to using a Beta distribution with both parameters set to 1. 
In order to obtain a posterior, simply use Bayes’s rule:
Posterior $\propto$ Prior x Likelihood
The posterior is proportional to the likelihood multiplied by the prior. What’s nice about working with conjugate distributions is that Bayesian updating really is as simple as basic algebra. We take the formula for the binomial likelihood function, 
$Binomial Likelihood \propto p^x (1-p)^{n-x}$
where x is the number of successes in n trials. and then multiply it by the formula for the beta prior with α and β shape parameters,
$Beta Prior \propto p^{\alpha-1} (1-p)^{\beta-1}$
to obtain the following formula for the posterior,
$Beta Posterior \propto p^x(1-p)^{n-x}p^{\alpha-1}(1-p)^{\beta-1}$
You’ll see that we are multiplying together terms with the same base, which means the exponents can be added together. So the posterior formula can be rewritten as,
$Beta Posterior \propto p^xp^{\alpha-1}(1-p)^{n-x}(1-p)^{\beta-1}$
which simplifies to,
$Beta Posterior \propto p^{x+\alpha-1}(1-p)^{n-x+\beta-1}$
Which amounts to: Take the prior, add the successes and failures to the different exponents, and voila. In other words, you take the prior, Beta(α, β), and add the successes from the data, x, to $\alpha$ and the failures, n – x, to $\beta$, and there’s your posterior, Beta($\alpha$+x, $\beta$+n-x).
When you start with a Beta(1,1) as your prior the posterior will have the exact shape of the Binomial likelihood, and the posterior is written Beta(1+x,1+n-x).
Graphs
If you start with your uniform prior, Beta(1,1), that looks like this:

If you have 13 successes in 25 trials the new posterior is Beta(1+13,1+12) or Beta(14,13), shown below:

There is code to make graphs like this and others at my blog, here.
