Friday, November 06, 2009

Everyday probability




My mind works in some very peculiar ways.

(If the sentence above is a sudden revelation to anybody, welcome to the blog, since it must be your first day reading.)

One of them is that playing and reading about poker so much has caused me to think about probability a lot. Really seriously a lot. It seems to confront me everywhere, in all sorts of contexts.

Like f'r instance. I have allergies, so I take some medicines for them. One of the things I take is Allegra-D. This is a tablet with two sides, one white, one tan. I assume that one of them is the antihistamine and the other the decongestant part of the combination. They come in blister packs of ten pills, as you can see from the photo of two such packs above.

I assume that in the manufacturing process, the tablets tumble into the dimples in the plastic packaging, and that how they land is effectively random. It certainly looks that way to me, after having seen many, many such blister packs.

How many have I seen? Well, I've been taking this drug for maybe ten years now, though I used to get it in standard prescription bottles. Since moving to Nevada three years ago, I discovered that I could get it much more cheaply by ordering through a Canadian pharmacy, which is what I have been doing ever since. That's when I started receiving it in this kind of packaging. I take one pill a day (occasionally two, when things get really bad). So let's guess that I've taken 1200 of these tablets. That's about 120 of the blister packs, at ten pills apiece.

I have not yet seen one where all the tablets landed in their little target spots facing the same way, i.e., showing me either ten white sides or ten tan sides. I did once see a pack that had nine out of ten. And yes, it gave me a little thrill. But every time I open a box (each box has three packs in it), it's like scratching off the spot on a lottery ticket to see if today is my lucky day. You can see that the top pack in the picture above is completely uninteresting, with six one way and four the other. The second one did a little better, with seven and three.

What is the probability that any given pill pack will be all one way? That's easy to determine. I don't care which way the first pill lands. The second one has a 50/50 shot of matching the first. If it does, the third one similarly has a 50/50 chance of matching those two, and so on. So the overall probability is 1/2^9, or 1/512. That is, on average one out of 512 such packs will be all matching.

How lucky or unlucky is it that I have not seen such a package yet? Let's go to the binomial calculator! Our value for p is 1/512--the probability that any given pack will be all one way. The value for n is 120, my estimate of the number of packs I have inspected. The value of k is 1--my humble target. The calculator tells me that the probability of by now having seen one or more packs in perfect unity of color is 0.209, or about 21%. The probability of having seen none is therefore about 79%. The implication is that I have not been especially unlucky; it would not be surprising to have found the pack I wish to see by now, but my situation is the expected norm, rather than the exception.

(I realize it's kind of philosophically problematic to speak of the probability of things that have already happened. They either did or didn't, and there isn't truly any probability anymore. Schrodinger's cat is either alive or dead. A more accurate way to phrase it would be, "What is the probability that there will be at least one all-one-color pack seen among 120 of them chosen at random?" But I trust you all knew what I meant anyway.)

If I keep it up for another similar interval of time, i.e., another 120 packs, what is the probability that I will by then have seen the package of my dreams? Ha! It's a trick question! The probability is 21%. Why? Well, if you ask the probability of finding one or more monochrome packs out of 240, the calculator will instantly tell you that it's 37%. But it would be incorrect for me to say that my probability of finding one in the next 120 packs is 37% on the grounds that it's a total run of 240 packs and I'm halfway through it without having seen one. The universe does not give me any credit for having already examined the first 120. It does not know that I have done this, nor whether I have already found one. (I guess the universe does not read my blog, which is kind of sad.) The odds are new again with each package, or, if you're looking in bunches, it's new again with every n number of trials you're planning to run. To think otherwise would be to fall for the classic gambler's fallacy, akin to thinking that you will surely make this flush draw, having missed the last eight in a row. But the pills, like the cards, have no memory for past events.

Assuming that they don't invent either a cure for allergies or a drug that works better for me than Allegra-D (and I find it nearly perfect, controlling symptoms nicely with essentially no discernible side effects), I will keep taking the stuff, so it seems almost inevitable that sooner or later I will find the magic package that I have been looking for. At that moment I am going to feel like Charlie spotting the golden ticket inside his Willy Wonka candy bar wrapper. I probably won't use the medicine or open the pack, just hang it on the wall or something as a monument to the weird but wonderful laws of probability.

Yes, I really am just quirky enough to do that.

5 comments:

Chappy & Bailey said...

Too much time on your hands, sir. But still, it was entertaining.

bastinptc said...

It's the little things in life...

Philly said...

Quirky is one thing. Seriously. This is a level beyond quirky. You take yourself way too seriously.

Anonymous said...

Having lived in probabilities and statistics when working my way towards an unfinished PhD (having 2 kids have a way of turning your life sideways), I have some authority when I say this...

Dude, you need to get out more ;-)

Always enjoy your posts, Grump.

Steve

timpramas said...

People reading your blog telling you how to spend your time - the irony.