@markr,
If you use this form of the theorem it works
Another form of Bayes' Theorem that is generally encountered when looking at two competing statements or hypotheses is:
P(A |B) = P(B | A)*P(A)/{(B | A)* P(A) + (B |-A)P(-A)}
Where
A is the probability someone is a computer science student: in the first example its 0.03 then 0.8 in the second example
B is the probablility someone has Tom W's personality: this is unknown and doesn't need to be known (read on)
-A is the probability someone is NOT a computer science student: first 0.97, then 0.2
P((B | A) is the probablility a computer science student has Tom W's personality. This is technically unknown though we do know it is 4 times higher for this group of students than other students, so we call it 4X
P(B | -A) s the probability a student of something other than computing has Tom W's personality. This is unknown though we do know it is 4 times lower than the above (so call it X)
We want to know P(A |B)
If you plug in the numbers then the X's cancel on top and bottom and the equation works out to give the answers Kahneman gives.