So after a lot of thought, and filling up three sheets of paper with venn diagrams, I think I finally figured it out.
Whuber's comment is correct; there's not enough information to solve the problem. You also need to have the probability of someone being a boy, the probability of someone having brown hair, and the probability of being 6' tall. For my example, I assume that the probability you have brown hair is 50% and the probability you are 6' tall is 50%.
First it helped to take one variable at a time and draw a venn diagram outlining all the probabilities. If you imagine throwing a dart, then 50% of the time you are going to get a male, with 50% being not male. 50% of the time you will get 6', and there is 90% overlap between male and 6'. So if you multiply 0.5 (probability of being male) by 0.9 (probability that you are male given that you are 6' tall) then you get 0.45. I hope that makes sense. Also, notice that they all add up to 1, that's important. And if you add up all the values inside a circle, and divide by all the values inside and outside a circle, then you get the probability for that circle, etc.
Then it's the same concept but you just add another circle and cut up the pie.
So now we have a 60% overlap between male and brown hair. We basically take each portion of the male circle, and overlay the brown hair circle by 60%. So what our male not 6'
portion that used to be 0.05 is split into two portions with 60% of .05 = 0.03
becoming the male and (not 6') and brown hair
portion. You can fill in all the values by doing this trick and just remembering that everything needs to add up to one, and that all the values inside each circle need to add up to 0.5 (the probability of that event).
So to get the probability of a boy given that they are 6' and have brown hair, we would do 0.27 /(0.27+0.02)
, which is the area of the combination of boy, brown, and 6'
divided by the total area of brown and 6'
.
After thinking tinkering with this for a while, I was able to put it into an algorithm to predict the probability of something happening.
probability_of_event_of_interest = 0.5 #being male
current_probability = probability_of_event_of_interest
p_given_x = 0.9 #probability of being male given that person is 6' tall
intersection = current_probability * p_given_x
current_probability = intersection / ((1-current_probability)*(1-p_given_x) + intersection)
>>> current_probability of being male is 0.9 as we'd expect.
p_given_x = 0.6 #probability of being male given that person has brown hair
intersection = current_probability * p_given_x
current_probability = intersection / ((1-current_probability)*(1-p_given_x) + intersection)
>>> current_probability of being male, given that we have brown hair and 6' tall is 0.931