To solve this problem, we can use Bayes' theorem.
Let's denote the following events:
A: The event that the student knows the correct answer.
B: The event that the student answered the question correctly.
We are asked to find P(A|B), the probability that the student knows the correct answer given that he answered the question correctly.
According to Bayes' theorem, we have:
P(A|B) = \frac{{P(B|A) \cdot P(A)}}{{P(B)}}
We can calculate each of these probabilities step-by-step:
1. P(A) is the probability that the student knows the correct answer. This is given as p.
2. P(B|A) is the probability that the student answered the question correctly given that he knows the correct answer. This is equal to 1 since we are assuming that the student knows the correct answer.
3. P(B) is the total probability that the student answered the question correctly.
To calculate P(B), we need to consider two cases:
a) The student knows the correct answer, which happens with probability p.
b) The student does not know the correct answer, which happens with probability 1 - p. In this case, the probability of answering correctly by randomly choosing one of the possible answers is 1/m.
Therefore, we have:
P(B) = P(A) \cdot 1 + (1 - P(A)) \cdot \frac{1}{m} = p + \frac{1 - p}{m}
Now we can substitute these values back into Bayes' theorem to find P(A|B):
P(A|B) = \frac{{1 \cdot p}}{{p + \frac{1 - p}{m}}} = \frac{{p \cdot m}}{{pm + 1 - p}}
Answer: The probability that the student knows the correct answer given that he answered the question correctly is \frac{{p \cdot m}}{{pm + 1 - p}}