Sunday, August 23, 2009

A fight for Independence

Docula had a great comment on my last PSA and I'd like to touch a little on what he said.

Let's talk a little about statistical independence. Loosely speaking, we say two events, A and B, are independent, if knowing that event A occurs does not change the probability that event B occurs.
E.g. Let A = the event that I play Rock Band 2 tomorrow. Let B = the event that Fast Eddie eats a salad for lunch tomorrow. These events are logically independent since my video gaming habits are not going to affect Eddie's lunching habits.

A little more complicated: Suppose you have a standard deck of playing cards. Suppose you're going to draw two cards. Let A be the even that the first card drawn is black. Let B be the event that the second card drawn is black.
Are these events independent?



Well, the probability that A occurs, denoted P(A), is 26/52 = # of black cards / # of cards total = 1/2

What's P(B)?

Well, if you drew a red card on the first draw, then P(B) = 26/51 (26 black cards but only 51 cards left)
If you drew a black card on the first draw, the P(B) = 25/51 (25 black cards (since you got one on the first draw) out of 51 cards left)

So P(B) changed DEPENDING on what you got on the first draw. So P(B) DEPENDS on what happened with A. Hence, these two events are dependent.

So why is this sometimes counter-intuitive? Suppose that I have a fair coin. By fair I mean that on each flip, the coin is as likely to land heads as it is to land tails. P(heads) = .5 = P(tails). Coin flips are independent. If I flip a coin and it lands heads then it's no more or less likely to come down heads on the next flip. Easy to say, but in practice this throws a lot of people off. Let's say I plan to flip a coin 10 times. The first 9 flips all come down heads

H H H H H H H H H

I pause for a moment and say, "what do you think it will land on the next, and last, flip?" We all (including me) have the urge to say "Tails! For the love of Buddha this string of heads is improbable!" This sentiment was dangerously echoed by some gamblers I observed when working at Treasure Island Resort and Casino. These gamblers would sit by the electronic roulette machine with notepads and they would write down the color and number of each outcome of the spin of the virtual roulette wheel. They would then attempt to use this information to help them predict the next outcome. At the most basic level of statistics just discussed, this would be a good strategy if the events were....drum roll please....dependent. If the spins of a roulette wheel were dependent then knowing something about previous outcomes could give you some information about future outcomes.
But...just like a coin flip, the spins of roulette wheel are INdependent. If that weren't true, then you would have to believe that the little wooden ball (or computerized wooden ball) somehow remembers what it has landed on and in the future will act upon that knowledge. If these men saw the ball had landed red 5 times in a row, they would probably bet on black for the next spin. This is FOLLY! Just because I flip 9 heads in a row doesn't mean the last flip is more likely to be tails. The coin doesn't remember that it just landed heads up 9 times in a row.

People have a false intuition about this empirical law called the Law of Averages, which, roughly put, states that thing even out after a while. I might get more into that in a different post, as it deserves it's own clever title.

Some real world applications? If you win the lottery using your favorite 10 digit number, there's no reason why you shouldn't keep playing that number afterwards.



If you haven't already, please, for me, watch (or read) Tom Stoppard's Rosencrantz and Guildenstern are Dead. It's the funniest, cleverest thing you'll ever put your eyes on. The first ten minutes are a beautiful homage to probability theory.






p.s. something to think about. suppose that people flip coins for fun. you know, for choosing between two movies, dates, desserts, colors of ties, etc. Suppose that the average coin is flipped 100 times in it's lifetime. Meaning someone flips the coin then buys something with it and the next person to get that coin flips it for some reason or another etc. Now, do you think that somewhere out there is a coin that's always landed heads? It's been passed around from person to person and no one single individual would notice, but could there be a coin out there that's been flipped 100 times and every time the coin has come down heads? How many coins would there need to be in circulation for this to have a better than 50% chance of happening? Is this coin magical?

6 comments:

fast eddie said...

i appreciate being in your examples. i did not eat a salad today, just for the record. i did eat some chickpea coconut curry soup i made a couple weeks ago. it was delicious. did you play rockband 2?

i like your recent bender of stats related posts. thinking is fun.

i would posit that, yes, a coin out there was flipped 100 times. your question is slightly ambiguous in that are you meaning it has only been flipped 100 times total? or does any coin out there have a string of 100 heads landings that happened after a previous string of mixed landings but before a future string of mixed landings. as in, sometime in the lifetime of the coin, it was flipped 100 times and landed heads in a row but has since been flipped and landed tails.

or, are you saying a coin was newly minted and has only been flipped 100 times, all heads, and never flipped again.

the never again scenario would be much less likely and i'd guess, no, that coin does not exist. just based off the intuition of a person who flipped it the 100th time, probably went ahead and flipped it again, thus negating that coin fitting that scenario at this very moment. it would also add to the likely improbability that it started its flipping career out of the gate with a 100 in a row perfect batting average.

if the question is if the coin, at some point in it's lifetime of flipping hit a 100 heads only streak, given the billions of coins out there, yeah, it has likely happened. but we'll probably never know.

and it certainly isn't magical.

peace from red wing.

Kate said...

So Mr. Probability....IF Alex and I were crazy enough to have a fourth baby what would the probability be that the child would be a girl?! We truly don't care either way, if it makes a difference...just curious to hear your expert analysis. My Mom claims she heard it was 60% likely that if you have three of one gender that a fourth would be the same...I was highly skeptical...;-)

sprocketplug said...

Hi Katie (and Alex),

This one's a little tricky. You see, unlike coin flips, births might not be independent. If subsequent births *were* independent, then the probability of getting another girl is about 50% (I think in practice male/female is not exactly 50/50) regardless of how many female babies you've had previously. However, I think there's a touch of genetics in here. You've got the medical background so you probably know more about this than I do, but aren't some men more likely to sire females? I can't help think of King Henry VIII, though that could have been bad luck.

If, when you got married, you asked yourself, what's the probability that I'll have four kids and they'll all be girls, that's (1/2)^4 = 0.063 or 6.3 percent. Not very likely, right? However, think of all the women that have four kids, a bunch of them (about 6%) are going to have four girls just by chance.

So, if births are independent and you want a boy, statistics are not on your side, you still have only a 50/50 chance. If genetics play a role, then the odds of having a girl might be higher. HOWEVER, it might be that Alex is 60% likely to sire males in which case having three girls in a row has probability (.6)^3 = .21 which is definitely possible....but experiment evidence would lean me away from this hypothesis...I mean n=3 is much too small of a sample size to draw any real conclusions. Call me when you have 30 kids and we'll really have a nice confidence interval. :-)

Kate said...

hahahaha...oh, so funny! I gotta show this to Alex "call me when you have 30 kids" he'll have a stroke. ;-)
my email is ktmartinson@gmail.com

sorry to have missed your call - we should chat soon!

we really don't care about the gender of our children, really, raising a child is raising a child...you have to want the CHILD not the gender...but I was curious, esp. since my Mom said she "heard" that there would be a 60% chance and I didn't really believe it...and wondered what the find field of mathematics had to say...thanks for the thoughts! we'll discuss...

Alex said...

P-diggity,

What are the chances you're the coolest guy on earth?

-A

fast eddie said...

from a biology perspective,

i actually do recall reading an article sometime in my bio studies relating to gender rates. there does seem to be a genetic predisposition for some men to sire more males or females over the other. obviously it is all based on which "x" or "y" sperm hits the egg first, however the lasting impression (and sorry, i have no reference, this was going on 5-6 years ago) i still have from the article is that a combination of factors from both parents result in more of one sex vs the other for that couple. x and y carrying sperm have different physical markers on their exterior which will be either picked up or ignored by the mother's immune system. if, say, a y sperm marker is picked up by the immune system, the mother's body will seek and destroy those faster than the x sperm, the the field of x contenders an advantage in fertilizing the egg.

i also read two articles with contrasting evolutionary factors - one stating that in times of famine, girls would be favored because their growing bodies demand less energy. the other stating that in times of famine, boys would be favored because they will add to the family's ability to hunt for food.

additionally, new evidence is showing diet has an effect on sperm's ability to swim including having an effect on x vs. y. http://www.physorg.com/news128142852.html
"56% of the women in the group with the highest energy intake at conception had sons, compared with 45% in the lowest group. As well as consuming more calories, women who had sons were more likely to have eaten a higher quantity and wider range of nutrients, including potassium, calcium and vitamins C, E and B12. There was also a strong correlation between women eating breakfast cereals and producing sons."

however someone else then refuted this study as a statistical anomaly.
http://publishing.royalsociety.org/index.cfm?page=1569

so, the matter of whether boy vs girl being independent is up for grabs. my guess is that they are not independent. there is a lot going on in the body and in the genome as well as outside factors such as diet and stress levels and there is most likely a combination of all factors that will lead to a higher rate of boy or girl, if not for a population as a whole, for a parenting couple.