Skip to content

BloggEd

Programming, Wistful thinking, Geeky stuff & Rants

aka. Things That Everybody Should Know About Probabilities, part 2

Doubling the number of attempts doubles my likelihood to succeed

Ok. This is not that common, but annoying enough. And I wanted to make sure this is a series, and one post is not so series-ish, huh?

Lemme tell you a story. Imagine there was a lottery every weekend, and every time one (1) ball out of ten, numbered from 1 to 10, would be picked. Now, there are exactly 10 total outcomes each time (duh). Think about the probability of winning if you participate only once, using a single ticket. Yes, of course it is 1 out of 10, or 10%. Or 0.1 as mathematicians would say, using the normalized form.

Now try to guess what is the probability of winning — at least once — if you participate exactly twice, using a single ticket both times. Is it 2 out of 10, that is, 0.2?

No. Definitely not.

If you disagree, then, according to that logic, participating ten times should equal 10 out of 10, equal to 100%, meaning absolute certainty of winning at least once! But we all know that you still wouldn’t necessarily win, even if you participated in our contrived lottery ten times. Why is that?

The answer is simple: by picking your choice another time you are not “covering twice the ground” compared to the last time — each lottery outcome and ticket is completely unrelated to next lottery, and you won’t win if the ball you picked last time would be picked now. The case is completely different if you buy ten tickets to single lottery, enumerating all the possibilities (that is, every ball from 1 to 10), but rest assured the winning coefficient has been setup so that you would lose by filling an exhaustive pile of tickets; in real-life situation you would be payed at most 8:1, or maybe as little as 6:1.

But now I digress. What is the actual probability for winning if you’d participate ten times, filling a single ticket. If it is better than one out of ten (which even our intuition tells it has to be) but worse than absolute certainty (again, our intuition should now nod approvingly)… what are the odds?

The solution is simple once you understand the concept of complement probability, which is a very simple one: if any event x has a probability p, the probability “not x” must be q = 1 – p — that is, the sum of probabilities “either x or not x happens”
must be one. So the answer for the question “what is the probability of winning at least once when participating with single ticket ten times” is “what is the complement of the probability of not winning at all when participating with single ticket ten times”. Now, because each time the probability to not win, ie. lose which is the technical term the mathematically inclined mathematicians have a habit of using, is 9 out of 10 = 0.9, according to the principle of product we get

1 - q = 1 - 0.9 \cdot 0.9 \ldots 0.9 (10 times) = 1 - (0.9)^{10}

which says simply “probability of NOT happening lose at first attempt AND lose at second attempt AND lose …”, which is roughly 0.65, meaning that it is actually more likely to win at once than lose every time. Yup.

Also, make sure that the complementary case for “not winning” is not just “winning” but more precisely “winning at least once”, which becomes more obvious if you elaborate the first option more: by “not winning” you probably mean “not winning even once”, because winning say, three times or every time is likely a welcome situation. Now, the complement of “not winning even once” comes more clear, which is “winning at least once”.

Now, I probably got confused myself. Flame on.

aka. Things That Everybody Should Know About Probabilities, part 1

One of my pet peeves is how bad people understand such concepts as randomness and probabilities (hey, gambling wouldn’t work so well otherwise). And I mean very basic stuff, you know. Classical combinatorics can be very hard even for mathematically talented people, as some famous puzzles like the Monty Hall problem demonstrate. But there are also very basic things that
many more mathematically challenged people understand, yet some highly educated people as doctors and others often fail to grasp. So I’ll post a short series, which will remain very short unless I get enough hits, each trying to debunk one myth related to probability, common enough to annoy me out of my mind. So, without further ado…

Myth #1: according to law of standard distribution, it is now more likely to have tails after 12 consecutive heads

This is a very general misconception and should be simple to understand properly: no laws of nature keep “tally count” of events and affect future outcomes respectively. Naturally, it is more likely to get roughly 10 tails and 10 heads in 20 consecutive coin flips than say, 20 consecutive heads, but if you have already flipped the coin 19 times and every one of them is heads (assuming the coin is “normal” and not manipulated in any ways to make the other option more likely), the next flip, the 20th, is just as likely to be heads as tails. The crucial point lies in the fact that throwing 19 consecutive heads is rather unlikely, but if you manage to accomplish such sequence, the next flip is like any other flip, totally unaffected by previous flips or history. You’d have 50% chance to get another heads, leading to 20 consecutive heads, or 19 heads and tails. Really.

Now, don’t say that “my luck has been so bad now that it has to turn to good”. With purely random events each event is independent from the others — otherwise it wouldn’t be completely random. It’s that simple. Now flame on.

Being inconsistent is next to being a doofus, and none of us wants to be one. So, you’ve probably applied the Grand Principle Of Consistency to insurances: you either have none (optional ones, I mean) or you simply exclamate a resounding yes! to almost every suggestion a telemarketer is apt to make to you.

Unless, of course, you have deduced some rules you always apply. Consistently.

Today I had an interesting discussion with my colleague. His suggestion was rather smart one, though simple (hey — many smart inventions are simple as an afterthought, no?). The suggestion was to pick those insurances which have relatively negligible costs AND cover you against damage which is Absolutely Inconvenient To Endure. Another proposition is that appropriate conditions and/or environment exists for the unwanted event to occur. Insurance against water or fire damage in a condominium is a good example. If you accidentally start a fire due to negligence destroying several other peoples’ property, the cost could be so high that your economy would be totally ruined. Then again, an anti-example would be the theft of your beloved mountain bike. I mean, it is now sooooooo shiny and nice to ride with Xenon lamps, carbon fiber wheels, GPS nav computer and whatnot, but after six years or so you’ll be ashamed of showing in public places with the bike because it would be then soooo 00′ies. Getting the bike stolen could be a disappointment in the scale from ε to ξ, the latter being somewhere in the neighborhood of getting your Aztec megalopolis Chihuahuatitlan devastated by the dastard attack of those puny, wretched French in Civilization 4, but not much more. I mean, you have to weigh the product <monetary loss due to theft of the bike> times <probability of the French making their move> against definite loss of monthly/annual money to Acme corp (dial 1-800-gullible-fool for our best offer) insurance company. Yeah.

An inverted principle along the same lines suggested by the friend — somewhat surprisingly due to bad odds — is that it is good to play lottery using negligible investment (yes, I’m very well aware of the phrase lottery is an added tax for the mathematically/probabilistically challenged). The idea is that spending something like 0.2 per cent of your net income to lottery your purchasing power is not diminished at all, whereas in the (extremely unlikely) event you can get gazillions of cash. Well, almost. I mean, Canon EOS-1Ds Mark III with some fine glass costs only so much, and hitting the jackpot in the lottery affords you at least 100 copies, even after taxes. Unless you’re stupid enough to pick a pattern (like your birthday) shared by thousands of other people.

I’d like to refine the principle, but at the moment I’m only able to refine the mentioned idea. Any suggestions?

Nevertheless, next time when you are negotiating with an insurance agent, even if you choose to ignore risk analysis and/or probabilities, remember that the real professionals behind the rates do know their Poisson distributions and eat standard deviations spiced with root mean squares on breakfast. Rest assured that all the tools they posses will be used against you. You’d be better off starting from the definition unless you haven’t yet.

Until recently, I have associated Apple products with reliability, power, simplicity and high amount of polish, extended from simply good products to support, maintenance and lifecycle.

Yup, I’ve noticed that no software is perfect, and Apple products are no exception. But somehow I have overlooked minor deficiencies so far because I have been able to meet my goals (which is the only thing that matters in the end) quickly with satisfying end result.

Alas, that was the Good Old Days, i.e. days before the Snow Leopard upgrade.

Now, I really like the idea of no new features, performance tweaks and all that is fine in the whitey cat release. But the amount of crashes is unacceptable. I mean, several crashes a day! Not even Vista or immature Linux distributions crash that often. And yes, I’ve applied the first SL update — it didn’t affect the crash problem.

Hopefully Apple will learn something and tests the release more thoroughly the next time.

Jos haluat kotisivutilaa, oman domainin tms. tai muuten virtuaalipalvelimen käyttöösi, niin voin vuokrata palvelinkapasiteettia edullisesti. Voin hoitaa myös domain-rekisteröinnin ja vastaavat hommat tarvittaessa.

Miksikö? Maksan virtuaalipalvelimesta > 200 EUR/vuosi, ja kapasiteettia on reilusti enemmän kuin blogini tarvitsee :)

Päivitys: koneella on uusin WordPress (2.8.4) asennettuna.

Ok. I’ve used several blogging systems in the past. I even rolled my own to try out CherryPy. I used to use Mephisto until now, because I have no time to fiddle with systems not related to work, and WordPress does seem to offer very lucrative interface as well as features. I hope I’ll find time to post some ramblings again, maybe not only about programming, but of flying (powered paragliders) and photography (my near-future favorite hobby) as well :)