# Basic problem in Bayesian inference

I have questions with the following Bayesian inference problem I found in the book by Bertsekas & Tsitsiklis (Introduction to Probability 2nd ed.).

Problem is as follows (P.445, Problem 2):

• A student takes a test with 10 questions, each with 3 choices.
• For each question, she either knows the answer or not. $Pr(know)=Pr(not know)=1/2$.
• Each question is independent of others.
• When she knows the answer, she always gets it correct, i.e., $Pr(correct|know)=1$.
• When she doesn't know the answer, she randomly guesses, i.e., $Pr(correct|notknow)=1/3, Pr(wrong|notknow)=2/3$
• Given that she correctly answered 6 out of the 10 questions, what is the posterior PMF of the number of questions that she knew the answer?

I can solve it like this:

Let $\Theta$ denote the random variable for the number of questions she knows the answer out of 10 questions, and $X$ denote the random variable representing the number of questions she answers correctly out of 10 questions. Then we have $$Pr(\Theta=\theta)= \left\{ \begin{array} \scriptstyle\binom{10}{\theta}(1/2)^{10}&0\leq\theta\leq10\\ 0&Otherwise \end{array} \right.$$ The posterior PMF we want is $$Pr(\Theta=\theta|X=6)=\frac{Pr(X=6|\Theta=\theta)Pr(\Theta=\theta)}{\sum_\theta Pr(X=6|\Theta=\theta)Pr(\Theta=\theta)}$$ To obtain $Pr(X=6|\Theta=\theta)$, notice that she knows the answer for $\theta$ questions and she always gets them correct. Thus, we consider the probability that she gets $(6-\theta)$ questions correct out of $(10-\theta)$ questions that she does not know the answer: $$Pr(X=6|\Theta=\theta)= \left\{ \begin{array} \scriptstyle\binom{10-\theta}{6-\theta}(1/3)^{6-\theta}(2/3)^{4} & 0\leq\theta\leq6\\ 0&Otherwise \end{array} \right.$$ Using this, the denominator is $$\sum_\theta Pr(X=6|\Theta=\theta)Pr(\Theta=\theta)=\sum_{\theta=0}^{6}\binom{10-\theta}{6-\theta}(1/3)^{6-\theta}(2/3)^{4}\binom{10}{\theta}(1/2)^{10}\\ =\binom{10}{4}(2/3)^6(1/3)^4$$ and the posterior PMF is $$Pr(\Theta=\theta|X=6)=\binom{6}{\theta}(1/4)^{6-\theta}(3/4)^\theta$$

Now my questions are as follows:

1. Considering $Pr(know|correct)=3/4, Pr(notknow|correct)=1/4$, the final posterior PMF can probably be derived in a much simpler way using these, but I cannot think of a good reasoning.
2. When evaluating $Pr(X=6|\Theta=\theta)$, we rely on the fact $Pr(correct|know)=1$ in the bold part. What if $Pr(correct|know)<1$? Can we still solve it in the same way?
• Are you sure you copied the question statement accurately? If Pr(correct|know)=1, then Pr(wrong|know) must be 0. Perhaps "Pr(wrong|know)=13" should read Pr(correct|not know). – gung Jul 22 '14 at 18:42
• You are right. It should be $Pr(correct|notknow)=1/3$. I've fixed it. – ckcn Jul 22 '14 at 19:06