Bayesian sample size estimation for given HPD

Thanks! I have two questions:
(1) Yes, I can use the conjugacy property of Beta and Binomial. How do I find the 95% HDI interval width for the posterior in this setting? I suspect that I miss some basics here.
(2) Using theano.shared() is the way to go! Does this work if the X is an array which changes size from loop to loop?