Bayes Theorem Q.

480 Views Asked by At

I have 30% chance to have cavity gene. If I do have the gene, there is 61% chance that I will have at least one cavity over 1 year. If I don’t have the gene, there is 29% chance that I will have at least one cavity over 1 year. Given that I have a cavity in 6 months, what’s the probability that I have at least a cavity over 1 year?

So my approach was something along the lines of:

$$P(\text{gene}|\text{cavity}) = \frac{0.30 \cdot 0.61}{0.30 \cdot 0.61 + 0.7 \cdot 0.29}$$

Is this correct?

1

There are 1 best solutions below

0
On

I wrote a tutorial on exactly this topic today. It is an introduction to Bayes Theorem it will help give you a little better understanding of what is going on here. Check it out here: http://jeffreyfreeman.me/conditional-probabilities-and-bayes-theorem/

So what we know going in based on the world problem is the following

$$ P(gene) = \frac{3}{10} $$

$$ P(cavity|gene) = \frac{61}{100} $$

$$ P(cavity|gene^*) = \frac{29}{100} $$

What we need next in order to solve this problem is the unconditional probability on having a cavity within a year.

$$ P(cavity) $$

Luckily we have enough information to answer that. If we calculate the joint probability for cavity and gene, and add that to the join probability for cavity and the not having the gene, then we will arrive at the unconditional probability for having a cavity.

$$ P(cavity) = P(cavity, gene) + P(cavity, gene^*) $$

For that we can easily solve using our current knowns.

$$ P(cavity, gene) = P(cavity|gene) \cdot P(gene) $$

$$ P(cavity, gene^*) = P(cavity|gene^*) \cdot P(gene^*) $$

$$ P(gene^*) = 1 - P(gene) $$

Plug in known values and solve and we get a bit more information we can work with.

$$ P(cavity, gene) = \frac{61}{100} \cdot \frac{3}{10} = \frac{183}{1000} $$

$$ P(gene^*) = 1 - \frac{3}{10} = \frac{7}{10} $$

$$ P(cavity, gene^*) = \frac{29}{100} \cdot \frac{7}{10} = \frac{203}{1000} $$

Now we can solve for the probability of the cavity event as well.

$$ P(cavity) = \frac{183}{1000} + \frac{203}{1000} = \frac{193}{500} $$

At this point we can use the information we currently have and apply Bayes Theorem to figure out the chance of having the gene given that you have had a cavity recently.

$$ P(gene|cavity) = \frac{ P(cavity|gene) \cdot P(gene) }{ P(cavity) } $$

Plug in our knowns and solve.

$$ P(gene|cavity) = \frac{ \frac{61}{100} \cdot \frac{3}{10} }{ \frac{193}{500} } = \frac{193}{500} $$

So now we can finally answer the question. If you recently had a cavity what is the chance you will get another one within a year. For that lets consider the only two scenarios that can satisfy it.

In the first scenario you have the following probability: Given that I have recently had a cavity what is the probability that I have the gene and will get another cavity within a year. That question can be answered with the following statement.

$$ P(cavity|gene) \cdot P(gene|cavity) $$

The other scenario that we need to consider as an alternative way to get a cavity within a year is if you don't have the gene, but get the cavity within a year anyway. The probability for that is as follows.

$$ P(cavity|gene^*) \cdot P(gene^*|cavity) $$

These two scenarios are the only two ways you can get a cavity again in a year, either with or without the gene. Since either need to be true for the outcome to be true we can simply add the two terms to get to our final answer.

$$ P(cavity|gene) \cdot P(gene|cavity) + P(cavity|gene^*) \cdot P(gene^*|cavity) $$

$$ \frac{61}{100} \cdot \frac{193}{500} + \frac{29}{100} \cdot (1 - \frac{193}{500}) $$

$$ \frac{5169}{12500} $$

$$ 0.41352 = 41.352\% $$

So in conclusion if you have had a cavity within the last year the chance of getting a second cavity within a year of the last one would be 41.352%.