This problem was in my Maths exam and I was not able to solve it or to get an explanation after the exam. I would really appreciate if someone could explain it to me.
75% of sentences contain a subject. When the parser is presented with a sentence containing a subject, it correctly predicts that there is a subject with a probability of 80%. However, it wrongly identifies a subject with a probability of 40% when the sentence does not contain one. Given that the parser predicts a subject, what's the probability of it being correct? (Hint: use Bayes' theorem)
My reasoning was to multiply 0.75 (A) by 0.80 (B) = 0.60 (A intersect B). This would be P(sentence contains subject) AND P(parser predicts subject | sentence contains subject), which are the conditions we need to be true for the parser to be correct. How would I solve this using Bayes' theorem and incorporate the info that the parser predicts a subject even when one is not there with P 40%?
Thank you.
Let $S$ be the event that the sentence contains a subject, and let $P$ be the event that the parser predicts that the sentence contains a subject. I interpret the given data to mean $$\begin{align} \Pr(S)&=.75\\ \Pr(P|S)&=.8\\ \Pr(P|S^c)&=.4 \end{align}$$ (The word "identifies" in the statement confuses me, but I finally decided to read it as meaning the same thing as "predicts.")
Then we have $$\begin{align} \Pr(S|P)&=\frac{\Pr(P|S)\Pr(S)}{\Pr(P|S)\Pr(S)+\Pr(P|S^c)\Pr(S^c)}\\&=\frac{.75\cdot.8}{.75\cdot.8+.25\cdot.4}\\&=\frac67 \end{align}$$