In a medical experiment, patients with a chronic condition are asked to say which of two treatments, A, B, they prefer. (You may assume for the purpose of this question that every patient will express a preference one way or the other). Let the population proportion who prefer A be $\theta$ . We observe a sample of $n$ patients. Given $\theta$ , the $n$ responses are independent and the probability that a particular patient prefers A is $\theta$ .  

Our prior distribution for $\theta$ is a beta $(a,a)$ distribution with a standard deviation of 0.25.  

(a) Find the value of $a$ .  

(b) We observe $n=30$ patients of whom 21 prefer treatment A. Find the posterior distribution of $\theta$ .  
(c) Find the posterior mean and standard deviation of $\theta$ .  
(d) Using R or otherwise, plot a graph showing both the prior and posterior probability density functions of $\theta$ .  
(e) Using R or otherwise, find a symmetric $95\%$ posterior probability interval for $\theta$ . (Hint: The $R$ command qbeta(0.025,a,b) will give the $2.5\%$ point of a $b e t a(a,b)$ distribution).  