How do MCMC methods allow the estimation of the posterior distribution in this example? I am reading a book example (diagram from p10) in which a person scores 9/10 on which we assumed a uniform prior. The posterior distribution could be easily worked out analytically, but the book gives an example of estimating the posterior distribution by MCMC methods. I can see from the bottom part of the diagram that about about 95% of samples had a theta of between 0.59 and 0.98, where theta represents 'ability' in the sense of accuracy rate on these tests. However, I don't understand how a theta value is obtained for each sample in the chain, and what the relationship is between a sample in a chain and the proceeding sample. The book also does not explain why three chains are chosen or where the initial values for these chains come from.

 A: MCMC works like this:
You need to draw independent samples from a distribution, but it's computationally intractable to do so. It might not even be easy to draw dependent samples.
Your next best approach is to cleverly construct up a Markov chain with the property that, if you run it for a very long time, you can expect it to take values that look like draws from the distribution you care about. That is MCMC. In some cases, you can make those draws approximately independent.
So in this case the $\theta$ draws are computed by initializing the Markov chain, "burning it in" for several thousand iterations to start moving towards limiting behavior, then just watching it bounce around. $\theta$ is the value of the chain at each sample. The relationship between samples is the transition relationship in the Markov chain.
So initial values don't matter. Three chains (as opposed to 5 or 8) is completely arbitrary. More is better, since chains are guaranteed to be independent from each other but not within themselves. There are post-hoc "effective sample size" calculations you can do but there isn't a good way I'm aware of to decide the number of chains and iterations ex ante. But many simpler MCMC problems are well-behaved enough that you don't need necessarily to run 10,000 iterations on 8 chains each.
