Bayes` theorem

Bayes' theorem
Bayes' theorem shows the relation between one
conditional probability and its inverse.
Example: probability that a DNA sequence S codes for a protein
given its nucleotide statistics ⇔ probability that sequence S has
some statistics given that it codes for a protein.
this is what we
want to calculate
can be computed from the
given sequence S
P(S codes for protein | CG content of S is high)
Bayes' theorem
P(CG content of S is high | S codes for protein )
can be computed from sets of sequences for
which we know if they code or not for protein
Bayes' theorem
The Bayes' theorem can easily be derived form conditional
probabilities
Let's start with the definition of conditional probability. The probability of event A given
event B is
Equivalently, the probability of event B given event A is
Combining these two equations, we find
This relation can be rearranged to give:
Bayes' theorem
NB: The lemma is symmetric
in A and B: dividing both
sides by P(A), provided that it
is non-zero, gives a
statement of Bayes' theorem
where the two symbols have
changed places.
Adapted from wikipedia
Bayes' theorem
Suppose there are two bowls full of cookies. Bowl x has 10 chocolate cookies and
30 plain cookies, while bowl y has 20 of each.
bowl x
bowl y
Homer picks a bowl at random, and then picks a cookie at random. We may
assume there is no reason to believe Homer treats one bowl differently from
another, likewise for the cookies. The cookie turns out to be a plain one. How
probable is it that Homer picked it out of bowl x?
Intuitively, this should be greater than half since bowl x contains the
same number of cookies as bowl y, yet it has more plain.
Adapted from wikipedia
Bayes' theorem
We can clarify the situation by rephrasing the question to "what is the probability
that Homer picked bowl x, given that he has a plain cookie"? This probability is
denoted P(A|B) where the event A is that Homer picked bowl x, and the event B is
that Homer picked a plain cookie.
To compute P(A|B), we first need to know:
P(A) or the probability that Homer picked bowl #1 regardless of any other information. Since
Homer is treating both bowls equally, we have P(A)=0.5.
P(B) or the probability of getting a plain cookie regardless of any other information. Since
there are 80 total cookies, and 50 of them are plain, the probability of selecting a plain cookie
is P(B)=50/80=0.625.
P(B|A) or the probability of getting a plain cookie given Homer picked bowl x. Since there are
40 cookies in bowl x and 30 of them are plain, the probability P(B|A) is 30/40 = 0.75.
Given all this information, we can compute the probability of Homer having selected
bowl x given that he got a plain cookie by the Bayes' formula:
As we expected, it is more than half.