Tuesday, July 24, 2012

The Mind-Bending Math of Probabilities


The laws of probability, so true in general, so fallacious in particular.
    —Edward Gibbon

This is the first of a short series on probability and statistics.  You remember, the bit about if you have 3 white marbles and 3 black marbles and you simultaneously draw 4 random marbles what are the odds of grabbing exactly 2 black ones? (Answer: 9/15 or 60%).

We are bombarded by probabilities and statistics everyday, yet for most of us our intuition actually works against us.  Like the guy who thinks that the more lottery tickets he buys, the better his chance of winning money.  In fact, the more lottery tickets you buy, the better your chance of losing money.  Think of it this way:  If you bought one lottery ticket, you might hit the jackpot.  But if you bought all the lottery tickets, then (since the total winnings are always less than the total income generated from ticket sales) you are guaranteed to lose.  Put another way, buying more lottery tickets for a specific draw will increase your chance of a winning ticket, but will decrease your chance of winning money.  This is because the odds are stacked against you from the start (the "house" always ends up ahead), and therefore every dollar you spend, in a probabilistic sense, loses you money.  As a poker pro would tell you, the entire scheme has a "negative expectation."

In other words, gambling is a tax for people who can't do math. 

This is especially true for the case of BC, where the government runs the lottery and, being the government, affords itself shameless odds.  Take the game Sports Action.  All you need to do in this gamble is to call the winner three sports games correctly and you're a winner. If you're a die-hard hockey fan, what could be easier?   Just pick three sure things and you're off to the bank.  Well, not really.  What's a "sure thing" in hockey?  Say Vancouver versus Edmonton in 2011 (or Oilers versus Canucks in 1986, if you prefer).  Even then your odds are maybe 80%.  So what are the odds of calling two sure things?  That would be 80% x 80% which is (0.8)2 = 0.64.  Two sure things and we're already down to a 64% chance.  Calling three games would be (0.8)3 = 51.2%.  So intuitively you might think you have an 80% chance of calling three "sure things" but in reality your odds are little better than 50:50.  Did I mention that if they do a lousy job on the odds and the lotery company that runs Sports Action ends up losing money in a given weeks, they can cancel the whole week's tickets and not pay anyone out?  That, my friends, is what is known in the business as a sucker bet.

OK, try this one:  

You’ve flipped Heads 9 times in a row.  What are the odds of flipping Heads again?

Got your answer?

Here’s where things get tricky.  The odds of flipping Heads on a fair coin ten times in a row are easy to figure out:  1 in 210 or 1 in 1,024.  So it might be intuitive to you that the odds of you flipping one more Heads is 1 in 1,024.  I mean, there's no way you're going to keep that streak going!  But this fails to account for the fact that you’ve already flipped nine Heads in a row.  The odds of that were (before you started) 1 in 29 or 1 in 512.  But now that you’ve already done it, the probability is 1.  A probability of 1 means 100% or certainty.  And you are certain that you’ve flipped nine Heads in a row.  So thinking about it, even though you’ve already flipped nine Heads in a row, your odds of flipping Heads again is simply 1 in 2, otherwise known as 50:50.  Probabilities predict the unknown or the future; the known past has a probability of 1 because it happened. 

It's this peculiar notion of luck that screws up people's rational analysis of the situation.  Our intuition tells us that after a streak of good luck, we're do for some bad luck, despite the fact that your odds of bad luck are the saem as they were before you had the god luck.  Nothing has changed.  I wonder if the idea luck is genetic or learned behaviour?  Does it occur in all cultures?  I should look into that.

Want another mind-bender?  How about this:

Say you plan to roll a die 20 times. Which of these results is more likely: (a) 11111111111111111111, or (b) 66234441536125563152?


Marilyn vos Savant, who was famous for having the Guinness Book of World Record highest IQ in the 80s (before, apparently, they did away with the highest IQ record), answered:

In theory, the results are equally likely. Both specify the number that must appear each time the die is rolled. (For example, the 10th number in the first series must be a 1. The 10th number in the second series must be a 3.) Each number—1 through 6—has the same chance of landing faceup.

But let’s say you tossed a die out of my view and then said that the results were one of the above. Which series is more likely to be the one you threw? Because the roll has already occurred, the answer is (b). It’s far more likely that the roll produced a mixed bunch of numbers than a series of 1’s.

Is she right or wrong?  Think about that. I'd be interested in your comments.

Statistics and probability are important factors in a lot of research science.  But they are notoriously difficult to understand, as the above puzzles demonstrate.  As a matter of fact, of Ms. vos Savant's four most controversial puzzles, all of them have been concerned with probabilities. 

Let's hear your answers!

Sunday, July 22, 2012

Ayn Rand and Objectivism: The Loathed Philosophy


Ayn Rand was a Russian-American philosopher and novelist of the mid-20th century, famous for her works The Fountainhead (1943) and Atlas Shrugged (1957).  She founded the philosophy of Objectivism and is credited with giving rise to the political offshoot of that philosophy, libertarianism.

Love her or hate her—and there doesn't seem to be much middle ground—she was a ferocious intellect who developed a complete and integrated philosophy from basic principles.  She was an uncompromising figure, given to a rather harsh derision of anyone who disagreed with her.  Even libertarianism, a political movement she helped launch, she considered an unwanted bastard child of her philosophy.  Her novels were a financial, if not critical, success.  She became politically active in the 1940s, participating as a "friendly witness" in the infamous US House Un-American Activities Committee, which blacklisted many Hollywood figures including Charlie Chaplin, who left the US.  She gathered around her a group of acolytes including future luminaries such Alan Greenspan (Chair of the Federal Reserve).  Later in life she was struck with lung cancer, and signed up for government-assisted social security and Medicare (to the schadenfreude of many of her adversaries on the political left) and died in 1982.

She called the philosophy Objectivism because she believed that the real world was objective—it existed as real things independent of the observer.  The way to know the world was through reason, a noble capacity unique to humankind.  She rejected all forms of mysticism, including religion.  She believed that humans, as rational beings,  were born with natural rights.  Chief among them was the right to life.  She believed that property was fundamental to life and therefore the right to property was also fundamental.  No man, she said, had the right to initiate force against another.  Force was widely defined: it didn't just include physical force but any type of coercion backed by the threat of force.  For this reason, she believed that taxation by the government was wrong.  She believed in the will of the individual, the morality of rational self-interest, the good of free market capitalism.  She opposed all forms of collectivism and statism.  The role of government was to protect individual (as opposed to collective) rights, through police, army, courts and an executive branch.  Any other role of government was illegitimate.

She was pro-abortion, a feminist, supported Israel in the 1967 war, considered homosexuality disgusting (though, true to her beliefs, she opposed any government intervention in it).  She condemned altruism, rejected animal rights, rejected capital punishment,  and opposed any form of censorship.  I'm guessing she wasn't a big fan of unions.

Two good quotes that nicely sum her philosophy are:

My philosophy, in essence, is the concept of man as a heroic being, with his own happiness as the moral purpose of his life, with productive achievement as his noblest activity, and reason as his only absolute. (Atlas Shrugged)
and
I swear—by my life and my love of it—that I will never live for the sake of another man, nor ask another man to live for mine.

I, like many curious teenagers, read Atlas Shrugged.  After Zen and the Art of Motorcycle Maintenance (a book which had a profound effect on me, and which I highly recommend) it was my first "important" book.  It's a real behemoth, over 1000 pages.  It's basically about a dystopian future America which veers towards severe statism, where the government starts taking over everything, even posting armed agents in company boardrooms.  As a result, a number of captains of industry, including the hero John Galt, withdraw their services (that would be Atlas shrugging, for the metaphorically tone-deaf) from the US and set up a shadow state where laissez-faire capitalism rules.  The government, having enslaved the people, collapses and there's a nice happy ending. 

It was a dreadful book as far as I was concerned.  Sure, many find the philosophy itself, particularly the rejection of altruism, to be loathsome, but I just thought it was poorly written, with wooden characters and a didactic voice that never stopped bludgeoning me.  At one point there was a speech by the hero, John Galt, that lasted over 50 pages.  Just repeating the same message over and over again.  I think I finally threw in the towel at that point.

Does that man you're going to make a 50-page speech?


Atlas Shrugged has been rather cattily called the "gateway drug" for right-wing philosophy, as it is apparently widely read by young readers.  If anything, it inoculated me against far right politics through the sheer pedagogy and intolerance of other views.  Others were obviously quite impressed though.  Ron Paul, the iconoclastic perennial runner-up in US Republican nominations is has a large dedicated following, and the Tea Party movement has its philosophical home in libertarianism.

Although I hate the leftist nanny state mentality as much as the next guy (probably even more) I reject the idea (never stated, but always implied in libertarianism) that the government is inherently evil.  That given half an inch, they will seek to enslave.  The government, in a functioning democracy, is us.  And when we, as Rand does, cast the government as the villain, we cast ourselves.

Nor do agree, fundamentally, that the ultimate goal of a man should be his own happiness.  Happiness can be a rather shallow goal—give an addict his fix when he needs it and he's good to go.

I don't see the philosophy as workable.  Indeed, subjugation of the proletariat by capitalists led to the overthrow of imperial regimes and the institution of communism in countries such as Chin and Russia.  Our government's allowance for the collective bargaining rights of unions was not done out of sympathy for the serfs, but because they were afraid that, unless they granted workers rights, a communist revolution would take place here.  That was a very real fear in the early to mid-20th century.  Workers rights—collective rights—as far as I'm concerned, created the middle class, which was an engine of prosperity.  And countries with little government do not rank very high on the various wealth indexes and usual have poor human rights records to boot.

And some goods are simply not amenable to assignation of property rights, so loved by the libertarians.  Take air, for example.  How would you assign property rights to air?  Think about it.

Finally, I find a major internal inconsistency in Rand's work.  She states that fundamental rights (life, liberty, property and pursuit of happiness) are derived as a result of man's capacity for rationality.  (Aside: Does that mean that a person incapable of rational thought, say someone severely brain-damaged, should not have rights?)  So rights are inherent, natural.  But how, in Objectivism, can you be born with a right? After all, you can't see, hear or smell a right.  Where is it?  It is not an objective thing at all.  It exists only in the minds of men, and therefore, by definition, subjective.  The Founding Fathers of the United States get around this by simply invoking God:

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain rights.

The rights are there because God put them there. End o' story.  But Objectivism rejects all forms of mysticism.  So it opts, instead, for this rather weak stand-in of Man's Noble Rationality.  This just in:  we aren't actually all that rational.  Collectively, many times, we behave in a way quite similar to a pack of outraged baboons. We constantly follow notions and impulses we barely understand.  Take those yahoos who rioted when the Canucks lost to Boston in the Stanley Cup final a couple of years ago.  Afterwards the one question everyone had of these kids—who often had no criminal behavior in their pasts—was:  Why?  They simply couldn't answer.  "I don't know."  Remarkable.  See also a related post I wrote on the subject of Free Will.

A true Objectivist, to my mind, would consider a person to have rights only to the extent that those rights were real and palpable (i.e. objective) and that there was some force in place to ensure that right.  Such a view would hold that the government—a government of the people as we live in a democracy—created those rights for us. 

Anyways I suppose I could have written off Any Rand and Ron Paul as just crazy as fruit bats, like a lot of people do.  But even though I personally find their philosophy detestable on many levels, they offer a certain intellectual integrity that I think needs to be respected.  Plus, I'm hoping that Rush Limbaugh, Michelle Bachmann and the North Iowa Tea Party (below) will be impressed with my philosophical refutation of Objectivism.


Tuesday, July 10, 2012

Life at HQ ISAF


Dusk at HQ ISAF after a sweltering day.  The Headquarters of the International Security Assistance Force is located in the heart of Kabul, in a fortified green zone also housing several embassies, and ornate, gilded Afghan houses occupied by ex-pats and wealthy Afghans.  The camp is quite small--the inner running loop is not even a kilometer—but, in the daytime,  home to over 2000 soldiers, civilians, diplomats and Afghan employees.  Not surprisingly, as this is a war, this is a 24/7 operation.  There’s always people around you where ever you go.  Folks here talk about, when they get home, how they love to wander around an empty house and luxuriate in the solitude.

Everything here is shades of grey and brown—the camouflage uniforms, the great blast walls surrounding you, the metal containers that contain offices and “hooches."  Everything except for the flapping of the bright flags of dozens of nations in the hot twilight wind.  Some Americans celebrate the 4th of July with a volleyball game in the floodlit court.  Officers from Belgium, France, Germany, the Netherlands, the US, Turkey, Romania and a myriad other nations.  There’s enough brass here to outfit every bar in Dublin.  The mountains of Kabul, with their sprawling square, mud-brick dwellings climbing up the sides, are visible over the twenty-foot blast walls, past the watchtowers and through the miles of coiled razor wire.

The view outside my base.

Rzaor wires, blast walls, check points: a reality for the citizens of Kabul.


The camp is dominated by the “yellow building,” which was previously the hub of a renowned military sports club.  Sports, like most everything else, were pretty much banned under the Taliban, and the building fell into disrepair.  When coalition forces seized it, it had been used basically as a toilet and cooking fires had been used in the middle of many of the rooms.

Headquarters, ISAF.


Nearby are the Destille Gardens, not much bigger than a large backyard, but a haven that is the envy of nearby bases.  Here you can rest in the gazebos or under the desert stunted trees and watch the fattest cats in Afghanistan in their comic attempts to snare the garrulous birds.  Many nights it hosts a special-event barbeque.  With all these countries present, national days roll by regularly.


Destille Gardens (aka Dusty Old Gardens) decked out for Canada Day.


My hooch is basically a metal container, probably about the size and appearance of a boxcar.  We have it pretty good at HQ, and there’s only two to a room, and I end up with about sixty square feet of personal space.  Bed, wardrobe, table, chair.  Online is the lifeline for many here, and we spend evenings viddying back home, or watching movies. The web is frustratingly slow and sketchy, but it’s there so we don’t complain.

A rare rainbow in Kabul.  Right over where I live too!


You really don’t complain about much here.  Its HQ.  If you want to moan about it, there’s always somebody to remind you of what it’s like in a combat outpost in Helmand province.  Or what life is like for the refugees swarming into the outskirts of Kabul.  We’re here for those soldiers and those people, not to get a tan.

The food here is, well, I guess what you’d expect when you get British multinational to provide sustenance to suit the culinary peccadilloes of 50-odd nations.  It provides the necessary nutrients to sustain life, let’s put it that way.  Yesterday they had hot dog soup.  There are a couple of other places to eat on base, a pizza joint and a burger joint, that, in the end, just make you miss pizzas and burgers back home.  Still, in comparison to the fare at the dining hall, it’s pretty good.  Or “Afghan good” as they like to say here.

The gym is another highlight, though.  They’ve got a court, a spinning room, a weight room and a treadmill room, and plenty of classes and activities to make it easy to stay in shape.  I was about 220 lbs when I got here and now I’m 195.

Alcohol is strictly verboten on base (except for the two we were allowed on Canada Day—Yay!), and fraternization with the opposite sex is not allowed.  After more than ten years , the bureaucracy of the military has had time to assert itself and the list of Do’s and Don’ts is lengthy and detailed, prompting one friend of mine—a veteran of many campaigns—to remark, “I remember when war used to be fun.”

The best thing about it is the people you meet, from all over the world, all cast into this remote, violent, backward place to deal with seemingly insurmountable problems.  Fighting the insurgents in six regional commands throughout the country and along the Pakistan border, training Afghan police and military (who have a nasty habit of occasionally turning their guns on you), dealing with a democracy imposed over top of a tribal feudal system we do not understand.  Logistics, intelligence, engineering, planning and operations in a hostile environment, thousands of miles from home and family.

These challenges forge a strong camaraderie, as strangers from strange lands like Texas, Sicily, Queensland, Manchester,  Dusseldorf , Kuala Lampur, the Faro Islands and Reykjavik become your family. Sure the bad guys are out to get us, but its amazing, even in the thick of it, how we can all have a good laugh.

The mosque outside the walls is calling the faithful to prayer now.

Four more weeks to go.

Monday, July 2, 2012

The Entrepreneurs of Kabul


Today I went on a tour of a number of recycling facilities in Kabul.  I'd heard rumours about Afghan capability to recycle various goods, and I wanted to see for myself what they could do, so when a local Afghan contact offered to take me out on the town, I jumped at the opportunity. 

Also, I'd been informed that trucks carrying sewage, ostensibly to the Kabul sewage treatment plant (STP), were in fact just dumping it in ditches.   I wanted to witness this as well, as well as determine if any of these trucks were being paid by us.  Our drivers are paid to deliver their load to the STP.

Easy right?  See if any of these trucks were illegally dumping and report back and hopefully get the problem fixed.  Sorted.  Move on.

Well, we did see some trucks dumping sewage in area next to the sewage treatment plant.  They got a little testy when we pulled up and took some pictures so, discretion being the better part of valour, we pulled out of there post haste.

But then we went around back to where the sewage treatment plant discharges, and it occurred to me that the treatment plant wasn't doing much good. 

The Kabul STP is an old Russian relic that had been originally designed to serve a very small area, but it now serves all of Kabul, currently numbering around four million inhabitants.  It simply cannot meet this capacity and subsequently it discharged what appeared to pretty much untreated sewage to a tributary directly upstream of the Kabul River.  (Click to enlarge.)

Near the discharge of the sewage treatment plant near the Kabul River.  This is basically untreated sewage.


The entire area stunk of raw sewage, and the river was covered in scum and was literally bubbling with toxins.  What's worse, is that the area is inhabited, and there are farms in the area that use the water as irrigation.  The elders told of children being sick and getting growths on their faces that sometimes lasted a year.  The locals would use the "water" to wash their harvest in, and would be on their knees in the muck all day doing their farming.  The river also floods in this area, and the people living here get their water from shallow wells.

Fields irrigtaed by, basically, raw sewage.  The burlap sacks is where they put the vegetables, to keep them from drying out during harvesting.


Women toiling in the fields.


But there's no money for a new treatment plant, and with the list of other pressing priorities—not the least of which is the security of the Afghan people, especially after the vast majority of coalition forces leave.  Meanwhile the problem becomes worse as war and economic refugees increase the burden on the city's scant infrastructure.

So what started off as a little problem soon became a large intractable mess.  This is typical of many problems in Afghanistan, as you attempt to address a small problem and realize that due to decades of war and poor governance....  There's no economy to fall back on.  There's little government to fall back on.  There's no infrastructure to fall back on.  They are on their own.  Eye Opener Number One of the day.

Then it was off to tour some scrap metal and plastic recycling facilities.  Again, this was a real eye-opener for me.  Not only do Afghans have the capability to recycle, but they do it with ruthless efficiency, and always have.  There is no waste here.  Opportunistic garbage dumps are first scoured by the poor for anything of value, and then the dogs have a go at them, and lastly the goats come in to eat anything organic that's left.

The plants themselves tend to be labour-intensive.  For several workers, their job is to take incoming plastic and hack it up with knives, before it goes into the machine to be shredded.  

My job is to hack up the bucket and put it in the machine.


At the scrap metal plant, about a dozen workers pulled a red hot bar from a furnace and passed it through a number of rollers to turn it into rebar (those steel rods used to reinforce concrete).  They all shook hands with me and I noticed a few of them were missing fingers.

Pulling the superheated steel from the furance.  By the way it's 36 deg C outside.

Rolling the red-hot cast metal into rebar.  

As is the Afghan way, we stopped for tea many times and I got to hear from the entrepreneurs running the various factories.  It's not often they see a white guy out and about.  They talked about the international organizations like ISAF (which is essentially NATO plus about 15 other nations operating as the coalition forces in Afghanistan) and the UN and others, holed up in their fortresses, and occasionally zooming about from Point A to Point B, with little real interaction with the Afghan people.  But for all that, they worry about what will happen when the coalition and US forces leave.  They talked about the difficulties running a business in Afghanistan.

One owner told me that he dresses like his workers, and drives a beat-up old car.  (Afghanistan is the Toyota graveyard of the world; about 90% of the vehicles here are old Toyota Camrys and Corollas).  It simply doesn't do to show signs of wealth here, because then you become a target for kidnappers, warlords and corrupt officials.

The final place I visited was a fabrication plant.  Here, the owner had all his workers in hard hats and gloves, with welding glasses.  Workers had to strap themselves in if they were working at height, and there were even labeled first aid stations.

These people have managed to create thriving businesses under daunting circumstances. "We appreciate the efforts of our international friends, said one fellow with an only slightly cynical smile, "But all Afghans know we must do this ourselves."

All in all, a very eye-opening day. I would despair trying to wrap my head around how severe and intractable their challenges here are,  but heartened by the entrepreneurial spirit, resilience, candor and hospitality of the Afghan people.

As my tour guide told me, dropping me off after a long day in the desert sun:

Qatra qatra darya mesha.  A river is made drop by drop.