My friends asked me two Bayes questions a while ago. Due to the rapid spread of COVID-19 in US, I’ve been at home for five days. So I decide to put my solutions here for references. The first question is as follows.
There are five balls in a bag. Each ball is colored either black or white with equal chance. Now suppose that someone have already drawn the ball 4 times with replacements, among which he/she got 1 white ball and 3 black balls as a result. Find the probability distribution of the number of white balls in that bag.
This problem is a straightforward application of Bayes’ Rule. The only tricky part is to formulate the problem statement with math language.
Let
where
We use Bayes’s Rule as follows:
I used R to compute the above quantity:
Thus, we have
When we are asked to give a point estimate of the number of white balls, we typically use the posterior mode, which is also known as the MAP (maximum a posteriori) estimation. In this case, it is