# Bayes theorem problem

1. Jun 15, 2013

### aaaa202

1. The problem statement, all variables and given/known data
This problem was under applications of Bayes theorem, but I feel like I am bad at using it if thats the case:
At a school 30% of the students are girls. 4% of the girls are geeks and 2% of all geeks are girls. What is probability that a random student is a geek.

2. Relevant equations
Bayes theorem

3. The attempt at a solution
P(AlDI) = P(DlAI)/P(DlI) *P(AlI)
I guess I should assign the statement to A: a student is a geek
And as my data I don't know what to use. That 4% of girls are geeks?
Using Bayes theorem I found that 3/5 is the probability. Is this right and how do you arrive at it using Bayes theorem?

2. Jun 15, 2013

### LCKurtz

I don't know where you got that equation from. Generally you have $P(A\cap B) = P(A|B)P(B)$ and $P(A\cap B) = P(B|A)P(A)$, so $P(A|B)P(B)=P(B|A)P(A)$. Try using that.

3. Jun 15, 2013

### marcusl

The equations are equivalent.

4. Jun 15, 2013

### D H

Staff Emeritus
Wait a second. You said you used Bayes' theorem, and yet you're asking us how to use it?

Show us how you arrived at that result (it's correct, BTW) and we'll be able to tell you if you did things right, or in case you didn't, help you get past your stumbling blocks.

5. Jun 15, 2013

### Ray Vickson

My personal recommendation would be: stay away from Bayes Theorem for a little while, until you understand the concepts and issues. At that point, Bayes results become handy shorthands that help you get answers quickly---after you know what it is you should be trying to do. In other words: understanding and intuition come first, formulas come later.

So, what is happening in this problem? An approach my students often found useful back in the Stone Age when I was still teaching is essentially a "tabular" method: image a school with a large student population---say 1000 students. How many are girls? How girls are geeks? From that, how many students altogether are geeks? Once you have figured that out, can you see how to complete the calculations?

I will just do a couple of steps to get you started: 30% of the students are girls, so N(girls) = 300. We are given that 4% of the girls are geeks, so N(Geeky girls) = 0.04*300 = 12. You are told that 2% of all geeks are girls, and you know how many girls that is; so how many geeks are there?

6. Jun 15, 2013

### aaaa202

thats exactly how I did. Multiplied the number of geeky girls by 50 to get the total number of geeks. I just wanted to see how to set the problem up with Bayes theorem.

7. Jun 15, 2013

### D H

Staff Emeritus
The form of Bayes' theorem cited by you and by LCKurtz appear to be different, but as marcusl already said, they are equivalent. Personally, I'd go with the simpler form.

Using that simpler form, Bayes' theorem says that
$$P(\text{geek}|\text{girl})P(\text{girl}) = P(\text{girl}|\text{geek})P(\text{geek})$$The question gives values for every single one of these except for $P(\text{geek})$, and that one missing value is the exactly the one to be solve for. So simply substitute the known values and solve for the unknown $P(\text{geek})$.

For now I'll leave it up to you to translate the word problem text to the mathematical terms such as $P(\text{geek}|\text{girl})$.

8. Jun 15, 2013

### HallsofIvy

Staff Emeritus
I prefer to use specific numbers rather than percentages. Let's say there are 1000 students in the school. 30% of the students are girls so there are 300 girls. 4% of the girls are "geeks" so there are 12 "girl geeks". Those 12 girls are 2% of the geeks: letting N be the number of geeks, we have .02N= 12 so N= 12/.02= 600 geeks. Yes, 600/1000= 3/5.

9. Jun 15, 2013

### D H

Staff Emeritus
That's correct, and that is equivalent to how aaaa202 solved the problem.

However, the question is listed "under applications of Bayes theorem", so presumably a solution based on Bayes' theorem is what is desired.

10. Jun 15, 2013