Recall the definition of conditional probability
\[ P(A|B) = \frac{P(A \text{ and } B)}{P(B)}\]
From which we can easily rearrange to get:
\[P(A|B)\cdot P(B) = P(A \text{ and } B)\]
and
\[P(A|B^c)\cdot P(B^c) = P(A \text{ and } B^c)\]
\[ P(A) = P(A \text{ and } B) + P(A \text{ and } B^c) = P(A|B)\cdot P(B) + P(A|B^c)\cdot P(B^c)\]
\[ P(A |B ) = \frac{P(A \text{ and } B)}{P(B)} = \frac{ P(B|A) \cdot P(A)}{P(B|A) \cdot P(A) + P(B|A^c) \cdot P(A^c)}\]
(.98)*(.02)/((.98)*(.02) + (.26)*(.98))
## [1] 0.07142857
# IF you test positive for Lupus, there is only a 7% chance that you actually have.
The accuracy of the lie detector polygraph test is often questioned. Several reports say that a polygraph is about \(95 \%\) accurate at determining if a person is telling a truth or a lie. Let’s assume these reports are correct. Let’s also assume that people are generally honest, so there is only a \(1/1000\) chance they are lying. A randomly chosen person takes the test and is determined to be lying, what is the probability that they actually lied?
Suppose \(0.1 \%\) of the population have a new Covid variant and there is a test that is \(96 \%\) accurate. Suppose you test positive, what is the probability you have it?
After an intro to stats course \(80 \%\) of people can draw a box plot. Of those that can draw a boxplot, \(86 \%\) passed while only \(65 \%\) of students that couldn’t draw a boxplot passed. Find the probability that a student who passed can draw a boxplot.