# Problem on Baye's formula

I was reading A First Course in Probability by Sheldon Ross. I think I quite understood the below problem but I still feel fuzzy.

Problem: In answering on a multiple choice test, a student either know the answer or guesses. Let p be the probability that the students knows the answer and 1-p be the probability that the student guesses. Assume that a student who guesses at the answer will be correct with probability 1/m, where m is the number of multiple choice alternatives. What is the conditional probability that a student knew the answer to a question when he or she answered it correctly?

Solution as given in the book: Let C be the event that the student answered the question correctly. And Let K be the event that the student actually knows the answer. $$P(K|C) = \frac{P(KC)}{P(C)}$$ $$= \frac{P(C|K)P(K)}{P(C|K)P(K)+P(C|K^C)P(K^C)}$$ $$= \frac{p}{p+(1/m)(1-p)}$$

Now this seems reasonable, only confusing is that how is

1. Probability that the student knows the answer $$= P(KC) = p$$ but not $$P(C|K)$$
2. While on the other hand the probability that a student who guesses the answer will be correct $$= P(C|K^C) = 1/m$$ but this time not $$P(CK^C)$$ or $$P(K^CC)$$.

I think its just that I am finding it difficult to determine the probabilities relation from the sentence formations.

1. Is there any other simpler, non fuzzy approach to such problems?
• $P(C|K)=1$. (Assume that a student who knows the correct answer always in fact chooses that answer.) – paw88789 Apr 19 '15 at 12:04

The way I work through these is by thinking "the probability of B GIVEN A is equal to the probability of A AND B divided by the probability of just A.

So in this case, the probability that the student knew the answer given he answered it right is the probability he knew it and got it right divided by the probability he answered it right.

So probability is $\frac{\mathbb{P}(\text{Knew it and got it right}) [= \mathbb{P}(\text{knew it})]}{\mathbb{P}(\text{got it right})} = \frac{p}{p + \frac{1}{m}(1-p)}$ since our denominator is the probability he got it right since he knew it, added to the probability he got it right through guessing. Note the top equality comes since if he knows it, he clearly gets it right, too, as you noted with point 1.

I feel thinking through the problem logically like this is much easier than trying to brute force the way through with formulae like your textbook does.

• I know I can ask separate question for this, but want to know how similar logic can be applied for this new problem: A lab test is 95% effective in detecting a disease when it is actually present. However the test also yields 1% false positives. If 0.5% of population actually has the disease, what is the probability that a person has a disease that the test result is +ve? The book as usual follows formula: $P(D|E) = \frac{P(DE)}{P(E)} = \frac{P(E|D)P(D)}{P(E|D)P(D)+P(E|D^C)P(D^C)} = \frac{.95*.005}{.95*.005+.01*.995}$ But I will appreciate to know how u'll think this logically? Please? – Maha Apr 19 '15 at 13:27
• Probability has the disease GIVEN a positive result is the probability they have the disease and a positive result over the probability they test positive. So $\mathbb{P}(\text{disease$|$positive}) = \frac{\mathbb{P}(\text{disease and positive})}{\mathbb{P}(\text{positive})} = \frac{0.005\cdot 0.95}{0.005\cdot 0.95 + 0.01\cdot 0.995}$ which is the same as your answer. – elDin0 Apr 19 '15 at 13:34
• that nice again...which books will you recommend for probability...which books you used for maths (other than probability) – Maha Apr 19 '15 at 13:43
• For probability, I didn't use books, I used these online notes: www0.maths.ox.ac.uk/system/files/coursematerial/2014/2635/21/… What other areas of mathematics are you studying? The only book I really use vigorously is "Introduction To Real Analysis"—Bartle and Sherbert. – elDin0 Apr 19 '15 at 14:01
• www0.maths.ox.ac.uk/courses/material – elDin0 Apr 19 '15 at 14:10

Imagine that the test consists of $N$ questions, each with the same parameter $p$ of the student knowing the right answer; and assume that knowing the right answer on any question is independent of knowing the right answer on any other question.

In this scenario, each question will fall into one of three categories:

(A) questions where the student knew the answer (and hence and answered correctly);

(B) questions where the student didn't know but answered correctly; and

(C) questions where the student didn't know and answered incorrectly.

We would expect $pN$ questions to fall into category (A); and $(1-p)\cdot N\cdot \frac1m$ to fall into category (B).

Thus we expect $pN$ of the correctly answered questions to have been known. And so the probability of a correctly answered question to have been known is $$\frac{\#\text{known}}{\#\text{answered correctly}}=\frac{\#(A)}{\#(A)+\#(B)}$$

• hey this was awesome explanation, can u please suggest any book that teaches probability in such logical approach instead a formula approach for all/most problems that Ross follows in his book? – Maha Apr 19 '15 at 13:33

Apologies for the long post but this material can be confusing so I tried to be clear by explaining every step.

1. Probability that the student knows the answer $= P(KC) = p$ but not $P(C|K)$.

It's not. The probability that the student knows the answer is $P(K)$, not $P(KC)$. The probability of the joint events student knows the answer and student answers correctly is the numerator in the first equality, $P(KC)$, and that equals $P(CK)$ which, in turn, equals the probability that she answers correctly given that she knows the answer, $P(C|K)$, times the probability that she knows the answer, $P(K)$. That's the numerator in the second equality. Now think about it for a moment. What should the probability that she answers correctly given that she knows the answer, $P(C|K)$, be? If she knows the answer then she'll always answer correctly, right? That means $P(C|K) = 1$.

1. While on the other hand the probability that a student who guesses the answer will be correct $=P(C|KC)=1/m$ but this time not $P(CKC)$ or $P(KCC)$.

I think you're confusing the roles of the various probabilities. Think of it this way. The probability of the joint events knows the answer (K) and answers correctly (C) is $P(KC)$ and that's also equal to $P(CK)$, since the order doesn't matter (both events happen simultaneously). So,

$P(KC) = P(CK)$

Now, express the two probabilities above as

$P(K|C)P(C) = P(C|K)P(K)$

The LHS is the probability of knowing the answer given that she answered correctly times the unconditional probability of answering correctly. The RHS is the probability of answering correctly given that she knows the answer times the unconditional probability of knowing the answer.

What actual information about the various probabilities do we know?

We know that the (unconditional) probability the students knows the answer, $P(K)$, is $p$, so $P(K) = p$. We also know that a student who guesses at the answer will be correct (with probability $P(C|K^c)$, the probability of being correct given that she does not know the answer) with probability $1/m$, so $P(C|K^c) = 1/m$. Finally, we also know that she will answer correctly every time she knows the answer, so $P(C|K) = 1$.

What we want to compute is $P(K|C)$, the probability of knowing the answer given that she answered correctly. What we don't have is $P(C)$.

But $P(C)$, being the unconditional probability of answering correctly, is

$P(C) = P(C|K)P(K) + P(C|K^c)P(K^c)$

What does this really say? Since she either knows the answer or she doesn't, you can decompose the unconditional probability that she answered correctly in only two ways:

1. She knows the answer (with probability $P(K)$) and answered correctly (with probability $P(C|K)$)

or

1. She doesn't know the answer (with probability $P(K^c)$) but still answered correctly (with probability $P(C|K^c)$).

These two events are disjoint, so $P(C)$ is the sum of the probabilities of those two events. Each of them, in turn, has a probability equal to the product of the probabilities I mentioned in each case.

Putting it all together, we have

$P(K|C) = \frac{\displaystyle P(C|K)P(K)}{\displaystyle P(C)} = \frac{\displaystyle P(C|K)P(K)}{\displaystyle P(C|K)P(K) + P(C|K^c)P(K^c)}$

Finally, plug in the values $P(K)=p$, $P(C|K^c) = 1/m$, $P(C|K) = 1$, and $P(K^c) = 1-p$ to get

$P(K|C) = \frac{\displaystyle p}{\displaystyle p + (1-p)/m}$.