# Bayesian classifier to predict user behavior

I am trying to find a way to calculate the probability that a user will pass a test at a certain certification authority, based on the user's history with answering questions using our service. Looking at a single question at a time (I know how to combine the probabilities), I have the following data:

• pass - The percentage of users who passed the test at the certification authority on their first attempt who answered the question correctly.
• fail - he percentage of users who failed the test at the certification authority on their first attempt who answered the question correctly.
• correct - if the current user answered the question correctly.

Given an example question:

$pass = 0.96$

$fail = 0.42$

If the user answered the question correctly, I believe the probability that he will pass (given that question as the only evidence), is something like:

$P(pass) = \frac{0.96}{(0.96 + 0.42)} = 0.697$

Am I correct? What if the user answered the question wrongly the first time?

On average, 82% of our candidates pass the certification on the first attempt. Of everyone who tries to take the certification, only 50% passes.

Edit: What about a second question, where 70% of candidates who pass the test on their first attempt answer correctly, but 80% of candidates who fail the test on their first attempt answer correctly? (meaning $pass = 0.7$ and $fail = 0.8$) Answering this question incorrectly will contribute to passing the test, even though it logically shouldn't.

Then if the user answered the question correctly (on a first attempt), the probability that he will pass overall (on a first attempt) is $$\frac{0.8 \times 0.96}{0.8 \times 0.96 + (1-0.8) \times 0.42} \approx 0.901$$ while if the user answered the question incorrectly (on a first attempt), the probability that he will pass overall (on a first attempt) is $$\frac{0.8 \times (1-0.96)}{0.8 \times (1-0.96) + (1-0.8) \times (1-0.42)} \approx 0.216$$
Your value of 0.697 (or 0.696) corresponds to the case where the overall pass rate for the whole test is 0.5; in this case the second conditional probability would be about $\frac{1-0.96}{(1-0.96) + (1-0.42)} \approx 0.0.065$. In the same situation, your 0.304 is the probability that the candidate will fail overall given a correct answer to this particular question. But you should make the 0.5 explicit and include it in the fractions.