# Bayesian Stats - Finding a Posterior Distribution

1. Mar 3, 2013

### jumpr

1. The problem statement, all variables and given/known data
Let x be the number of successes in n independent Bernoulli trials, each one having unknown probability θ of success. Assume θ has prior distribution θ ~ Unif(0,1). An extra trial, z, is performed, independent of the first n given θ, but with probability θ/2 of success. Show that $f(\theta | x,z=0) = c(\theta^x (1-\theta)^{n-x} + \theta^{x}(1-\theta)^{n-x+1})$ where $c = \frac{1}{B(x+1,n-x+1)+B(x+1,n-x+2)}$

2. Relevant equations

3. The attempt at a solution
$f(\theta | x,z=0) \propto f(x,z=0|\theta)f(\theta) = f(x|\theta)f(z=0|\theta)f(\theta) = \theta ^x (1-\theta)^{n-x} (1 - \frac{\theta}{2})$
But from here, I can't seem to get it into the desired form, leading me to think I've done something incorrect. Where am I going wrong?

2. Mar 3, 2013

### Staff: Mentor

$(\theta^x (1-\theta)^{n-x} + \theta^{x}(1-\theta)^{n-x+1})$ can be written as $2 \theta^x (1-\theta)^{n-x}\left(1-\frac{\theta}{2}\right)$
I think if you calculate f(\theta | x,z=1) and normalize both properly, you get the correct result.