Lorenzo Biasi and Michael Aichmüller
Let's say that A is the event "car is green" and B is the event that "he sees a green car". We want to compute the probability that the car is green given that he sees a green car. For that we will use extended Bayes theorem:
$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$
$P(A) = 0.15$
$P(\neg A) = 0.85$
$P(B\mid A) = 0.80$
$P(B\mid \neg A) = 0.20$
The result $P(A\mid B) = 41.379 \%$
In [4]:
0.8 * .15 / (0.8 * .15 + .2 * .85)
Out[4]:
Let's say that A is the event "dot was sent" and B is the event that "dot is received". We want to compute the probability that a dot was sent given a dot was received. For that we will use extended Bayes theorem:
$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$
$P(A) = 3 / 7$
$P(\neg A) = 4 / 7$
$P(B\mid A) = 3 / 4$
$P(B\mid \neg A) = 1 / 3$
The result $P(A\mid B) = 62.791 \%$
In [5]:
((3 / 4) * (3 / 7)) / ((3 / 4) * (3 / 7) + (1 / 3) * (4 / 7))
Out[5]:
Let's say that A is the event "the student actually knows the answer" and B is the event that "student aswered the question correctly". We want to compute the probability that at he student actually knows the answer given that student aswered the question correctly. For that we will use extended Bayes theorem:
$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$
$P(A) = p$
$P(\neg A) = 1 - p$
$P(B\mid A) = 1$
$P(B\mid \neg A) = 1 / 5$
The result $P(A\mid B) = \frac{p}{p + \frac{1 -p}{5}} \%$
In [ ]: