Rants, Thoughts, and Whatnot


20051123 - More an explanation than a rant really

Scaling patterns

I'm going to guess that not too many of the people reading this do much sewing, but most of us occasionally find the need to scale a pattern up to a larger size. A while ago I needed to scale a post-shrink pattern to it's corresponding pre-shrinkage form so that the two would end up the same size after washing.

At first I thought about drawing a 10% oversized grid on the cloth, but that seemed like a lot of work, plus I'd have to erase it once I was finished.

Then I though about freehanding it, which didn't seem like a good idea at all.

Then I remembered something about Hubble's Law of expansion. One of the proofs of his theory is that if a number of points are placed into a contiuum, and the contiuum then uniformly expanded, each of the dots will think all the other ones are moving directly away from it. The important thing is that it doesn't mattery where in the contiuum you're watching from, it always looks the same.

I could scale up the pattern simply by tacking it onto the new cloth, and hinging a paper ruler (IKEA style) from a pin placed anywhere on the pattern. I picked 20 or so places on the original, measured their distance from the arbitrarily chosen hinge point, multiplied it by 1.1, and marked off that same distance on the same radial. By interpolating the new points I got a perfectly scaled version of the original pattern.

The cool thing about it is that this method works for a) any scale factor and b) any chosen hinge point.

Not that clever I suppose...


And now a special presentation: A guest rant by my little bro!->

Quote of the Day:

-- Salman Rushdie

I personally find the quote dissapointing.

Certainly, there is a broad spectrum of lousiness in religious fanaticism but I feel that the real problem these days is in the people that have given up spirituality at all. It's no good for me to say that my understanding of God is better than yours. It is also no good for me to say that I have none. To illustrate with another popular topic, it seems that a large chunk of influence enjoyed by the US's goon government comes from what just enough of the the American people fear to be "anti-americanism" when its not Americans that people hate but all their crazy out of control capitalism. As far as I've noticed, more North Americans blindly worship SUV's than any kind of God and that gives me the willies. I personally feel as threatened by this as by the overblown, bizarre values that stuck it to the WTC. However 9-11 is now such a vivid symbol that no one can see past it any more than boobs on a billboard. The sad fact is that throughout history fear mongers have capitalized on such symbols and the more we wish people like Bush would leave the more reason they have to stay, selling us on new threats with enraging ease. That's sick but what's the point in being so sure that there isn't a cure. Maybe the trick is actually to be actively pro-American (and ant-Bush)! It doesn't mean we have to buy into their wars or keep selling them our resources but if we believe in democracy then let's show them (and a lot of the rest of the world for that matter) what democracy is all about. And if we do believe in democracy then we know that it is our individual choices that change things. I guess I'm saying that if we look for the best in ourselves, we look for the best in our country/planet. So vote next time 'kay? I can't see another option at the moment.

But to get back on track, I've started to believe that we each have some sort of holy book revising within us. At the best of times we read it and at the worst of times we recite it. Ignorance is a drag but reactionary mindsets are just as bad. I guess that's what I don't get about Rushdie. All I can find here and in the Satanic Verses is contempt and impatience. Could be wrong though.


20051016 - How is it that most people don't understand this?

Who cares what the idiots think

I recently heard someone agonizing about what people would think of them if they did something in a certain way.

I tried to explain to this person that people generally look out for their own interests first, and that in a good number of cases those interests conflict with your own. If you behaved the way other people wanted to, you'd be acting in their interests, which are not necessarily the same as your own. People use their communicated judgement of what you're doing as simply another tool to serve their own goals.

The only time you need to be concerned about what someone thinks about what you do/how you do it is if the person speaking a) is not acting to a conflicting interest, and b) knows what they're talking about.

By this logic, if someone you consider an idiot is giving you a hard time about how you do things, celebrate! If you did it a way they approved of you'd be doing the way an idiot would.


20051005 - Why should people complain about government, when it's just a passing stage.

Freedom from oppression and unequal distribution of wealth!

It's not only within our reach as humans, I believe it's inevitable.

There will be no oppressive government when any would-be tyrant spends more food walking from one group of starving hunter gatherers to the next than he can possibly extort from them.

There can be no unequal distribution of wealth when the niftiest thing in the tribe is a freshly chipped rock, and the only source of income is the grass in the sorounding hills.

Stupidity will once again be a capital crime, as it should be.

Epidemic disease will fade into history.

History will fade into history.

Child mortality will rise. Life expectancy will fall.

A few million humans on the planet, in groups of 20-30 individuals.

We'll have used up all the metals, all the oil, all the coal within low-tech access. During the famines/nuclear winter we'll have eaten all the large animals, so no more domesticaion of anything slower breeding than chickens or hamsters.

And it'll be stable for a very long time. Long enough for nature to back-fill the holes we knocked in the biosphere (hamsters the size of cows graing the prairies?). Long enough for forests to again cover europe and north america. Long enough for volcanoes, weathering, heat and pressure to make more mines and oil.

Some day, many millions of years from now some animal may turn to another one and say "Hey, those shinny rocks you found last week make really good axe heads.", but I don't think they'll be what you or I would recognize as humans.

Wait 500 years and see if I'm not right.


20050907 - See how often you update your website once you have a kid!

Something to Take the Pressure off

Feeling middle aged? Worried that you'll never amount to anything? Don't worry about it. Compared to Ramesses II we're all insignificant nobodies.

Consider:

Now look at your neighbour's fancy car, his nice suit and golf clubs, his fancy gold watch. Pah! Peanuts. We can all grovel in the dust together.


20050218

An ethical question

The owner of a property wants to get a ditch dug from one end to the other. He heads into town and finds ten people to bid on the job. Each worker is equally suitable to do the work, so competition is entirely based on price. Jobs are scarce, and each worker is desperate for work. He explains to them that whoever will do the job for the least gets the contract. One of the ten takes the other nine into a huddle, and says "In return for a 10% cut from the winner, I'll make sure that nobody here bids less than $5/hr." The others agree, and tell the property owner that none of them will big less than $5/hr. The property owner flips a coin and selects one of the 10 at random, who does the work for $5/hr.

Comment on the ethical behaviour of "Mr. 10%"

How would your answer change if:

Any other modifications you might suggest.

My instinctive answers would be ones that restore balance to the market. But I'm not sure I could make a case of how any of the ethical systems I've been taught demand economic balances of power be maintainned.


20050202

The Zero Sum nature of the stock market

So, thinking of playing with stocks? Thining of doing some investing?

There's an aspect to securities trading which isn't advertised to the general public, but which I think is very important for every potential investor to know. I'm going to use a control volume analysis try to prove to my avrty id reader(s) that the stock market is a zero sum game (actually, it's worse).

First some definitions:

The control volume analysis is one of our most useful engineering analysis tools. What it means is that rather than trying to analyse the inside workings of a complicated object (or system) we draw an imaginary surface around it and concern ourselves only with anything that passes through boundary. The application of conservation or ballance rules then lets us digure out things about what the system is doing. An example of this would be the performance of an internal combustion engine, where we care primarily about the fuel, power and heat that pass through the envelope, rather than what each of the little bits are doing inside or how the gasses are swirling around in the cylinder.

A zero sum game is a game between two or more parties, in which the total lost and won by all the players when added together is always 0. Poker for money with your friends is an example of a zero sum game. No matter who bets what, or who wins the round, the total amount of cash on the table is the same at the end of the round as at the beginning.

Now we put the two together

Let's assume that Ulrich starts up his own stock exchange. For simplicity's sake we'll assume that all purchases are made in person, by people standing at the bar and mumbling offers to each other over glasses of watered down orange juice (it's a relaxed sort of place, not as stressful as the real thing). Fred, Bob, and Mr. Smith all show up one morning to trade stocks.

Each starts the day with a nice portfolio, and a pocket full of cash. This amount is recorded as they walk through the control volume I've drawn outside the building.

All together, they're carrying $1,000,000 dollars in cash.

All day long Fred buys from Bob, who buys from Mr. Smith, who buys from Fred. Large amounts of money change hands between the three of them. Bob concentrates on stocks with fast growth potential. Fred concentrates on low risk vehicles, and Mr. Smith buys and sells seemingly at random (but actually according to a fiedishly complicated system based on the analysis of years of market movements).

Finally, the big bell rings, they all down their last glass of juice, and go home. Bob came out ahead, Fred is almost broke, and Mr. Smith broke even, but feels he's set for huge gains tomorrow. We again record the amount of money in each of their pockets as they leave the control volume.

Now if you add up the total amount of cash they each walked out with, what would it be?




Not a fair question to ask really, as you don't know what they were paying for the juice.:)

The reason the price of the juice is important is that except for the orange juice, the total amount of money they together walked off with is exactly the same as the total amount they together walked in with. All that's happened is that the money has (probably) been redistributed among them.

No mater how they trade, or what sort of deals they strike, any transaction that takes place in the exchange is simply a transfer of money from one actor to another inside the exchage. The total amount of cash in the exchange is not affected.

Q: "But what about the stocks themselves. They have value!" you ask.

A: They only have value when traded for something (See exception below). You can't eat them, or wear them, or live in them. Their value exists only as a potential (Try borrowing money with stocks as collateral some time and see). The only way you can sell them is through another zero sum interaction with a buyer.

Q: "But individuals can make money."

A: They most certainly can. That's the nature of a zero sum game. But for every guy who makes $1,000,000, 1000 people loose $1000. Read on below why I don't think you'll be one of the individuals that benefits.

Q: "What about futures or precious metals?

A: As long as its something which you're trading inside the control volume, it makes no difference what the specific nature of the vehicle is.

Q: So how how does one reliably make money off the stock market in Fred/Bob/Smith's scenario?

A: Three ways.

Any highly educated securities folks are humbly asked to email me if they have any input on this aspect of the market.

Note that since there are overhead costs associated with trading (A desk, lights, fees for market info, banking charges, orange juice etc) the system is actually less than zero sum, but we'll leave that wrinkle aside.

Q: Ok, trading stocks is a zero sum game. I still think I can make money from it.

Now we come to the second part of the issue. Who makes money, and who looses it. I'll analyse the system again in a single transaction view, and see if I can generalize it convincingly. I'll keep the timescale short, again to simplify things, then we'll see it lengthenning it makes a difference. We'll also assume that neither Bob, or Fred are in an end-game, desperately need cash, are feeling suicidal etc.

Fred and Bob are sitting at the bar, orange juice in hand. Thousands of people have joined the market since, so that neither Fred nor Bob's transactions significantly affect share value. Fred has some cash in his pocket he wants to invest, and asks Bob what he's got to sell. Bob has, in his possesion, 1000 shares of UlrichCo (the oppresive internaltional megacompany).

The shares currently list at $1.00. Bob thinks long and hard, and comes to the conclusion that tomorrow the shares will be worth $1.02. He will therefore not sell. Bob will only sell if he thinks that tomorrow they will be worth less than $1.00.

Fred likewise will only agree to buy if he thinks that tomorrow they will be worth more than $1.00.

The only situation in which the trade actually happens is if a) Bob thinks UlrichCo is going down, and b) Fred thinks it's going up.

Now, what happens when the morrow dawns? Either Fred was right, or Bob was right. If Fred was right then he now has more cash (if he were to sell out that day) than Bob. Likewise if Bob was right. The net effect then is of a transfer of cash from the person who made the poorer guess, to the person who made the better guess.

The vast majority of trades are like this. The umpteen billion shares that get traded on the NYSE each day are made up of a huge number of such point-to-point trades, each acting, in the fullness of time, to transfer resources from those with poor future-price-guessing skills to those with better ones.

Q: Who says I can't make as good of a guess as to the future value of a stock as the next guy?

A: Because "The next guy" is (most likely as they hugely dominate the market) a bank or mutual fund. Sitting in their office are a couple of dozen sharp young guys, with economics degrees, proven successful intuition, up to date comporate literature and financial data, up-to-the minute quotes, years of corporate history, a stack of the relevant industry literature, an extensive web of contacts, and 8 hours of paid time each day to do nothing but refine their guesses of the future value of that stock you're eying. Are you seriously going to tell me that you're guess is more likely to be correct than theirs?

Q: Ah yes, but they're overworked, tied to artificial deadlines, and subject to the politcal whims of their bosses!

A: So? I'm also overworked, tied to artificial deadlines, subject to the political whims of my bosses, cursed with pig-headed customers, constrained by legacy technology and burried in endless paperwork. Are you trying to tell me that one of those fund managers can, in his evenning hours, using stuff he buys at Canadian Tire, build a better military communication system than I can here?

Q: But they've got to watch many stocks, I can concentrate on one or two and really get to know them.

A: There's some truth to that, but it'lll take a lot of work on your part to cancel out the fact that he's got much better tools, trainning, and many more hours to spend on those many stocks.

Q: But I've noticed a clever pattern involving buying when....

A: Sure Cletus, and since noone else has thought of it in a hundred years you'll make a killing. Good luck.

What you have to ask yourself is "Who am I going to be taking this money away from?" Unless you've got a good clear notion of that, expect to end up broke. The money isn't just out there, comming from some magical fountain of wealth for you to scoop up. It all belongs to someone, who'll likely fight to keep it.

Q: So you just can't win, is that it?

A: Not quite. There are times when you or me can make a better guess at it than the big guys, and can reasonably expect to walk off with some of their money. There's four that I know of:

The rest of the time you're playing a zero sum game with people who are generally better at it than you are. OK if you do it for fun, but don't expect to make any money at it.

Q: You're oversimplifying things. The value of a stock isn't entirely speculative.

A: True, each stock has a non-speculative component to it's value. This is a combination of a)dividends paid out, and b)real assets owned by the company (desks, shovels, land etc.). The dividends of the stock are valued as an annuity based on a guess at how long they're likely to continue (ok, so they're partially speculative, but not nearly on the same order). The real assets are, in theory at least, partially yours, and will be handed over to you if the company ever shuts its doors (assuming you're not behind any of the big-fish creditors in line). Again there's some variability in this value.

This in effect acts to give the market a small positive sum because those dividends/assets are sourced from cash the company takes in outside the market. Usual dividends are only a few percent of share value, so I've always felt this to be outweighed by the overhead costs in short-hold trading.

Realise, however, that both of these "real value" aspects are subject to the same "My guess is better than yours" angle as the specualtive value, although admittedly to a lesser extent. Every player makes their own estimate of next year's dividends, and values the non-speculative portion of the share accordingly.

So there you go. Hopefully I've managed to show that speculative stock trading is a losing proposition for shmoes like you or me.

Q: OK wiseguy. If stocks are a scam what do you invest in? How are you going to be paying your bills when you get old?

A: Right now every spare dime goes to paying off the mortgage. It's a tax free, risk free investment with a not-too-bad rate of return. Plus, if the economy goes to heck I can always live in it. As for paying the bills when I'm old, I expect to work, full time until a few weeks/months before I starve/freeze.

The reason's why I don't expect a comfortable retirement may deserve a rant one of these days.

Keep smilin' :)


20041221

Estimating

Estimating the time and resources required to perform a task is something that causes many people grief. I thought I'd put down a few sage words on the topic to share my experience.

Quick basic terminology:

So why do we go through estimating excercises? At the end of the day its for cost and schedule, so that the overworked people trying to coordinate things have some information to work with.

Let's say that your brother-in-law is the minister of defence of some small ex soviet block country that needs new radios for their T34 tanks. Conveniently you are the president of a new, little known, but well financed defence contractor. You contact several companies who make such systems, and as them for quotes.

One of these companies is a place called General Mechanics. GM is looking for contracts (most companies usually are) and decide to bid. The sales guys for GM now need to decide what price to quote. They'll play a price/demand game to try to maximize their probable income (possibly modified by long term strategic issues), and to minimize their chance of loosing their shirts.

The main input the sales guys need to play this game is what the system will cost GM to supply.

When you make an estimate you should have two goals in your mind: 1) Give the buisness/marketting guys a realistic understanding of what a given task will cost us to undertake and 2) Give yourself (or whoever will be doing it) enough resources to do a reasonably professional job of the task.

Why are accurate cost estimates important?

The distribution of cost/benefit is not symetrical around the best price guess. Low estimates cost you more than high estimates gain you.

Why do low estimates cost more than high estimates gain?

Simple. Competitive bidding. Three companies bid on a project, one high, one low, and one right on the nose. What happens? The one who bids low looses money on the contract, the other two go on to the next contract. Note that the number of contracts awarded is fixed by how much customers have to spend, and is independent of industry pricing policy.

What it means is that you're more likely to have to live up to a contract you underbid, than one you bid correctly. A margin has to be added on to the price to compensate for this risk. The size of this margin is directly related to the uncertainty of your cost estimate. If your cost estimates are poor quality, you'll often find yourself selected for projects you underbid. You'll then have to crank up your prices on all your bids to stay in buisness, and find that even your right-on bids are now no longer competitive.

How does one make good estimates, so that one does not have to crank up one's prices as much?

One could write a book on this subject. I'll just rant.

First of all realize that how good of an estimate you want depends on how much you want the contract, and how much risk there is on your bid (alternatively, how much you'd have to pad the estimate to take up your underbid risk). There's no sense spending 1M$ to reduce a 1$M risk padding to $0.5$M, but some refinement is almost always waranted, as the risk pad climbs very quickly as your estimate uncertainty grows large. The following is for a small-to-medium sized program in our industry.

Go back to the position of the sales guys. If you were a sales guy and needed to know how much it was going to cost to put an antenna on a T34 what would you do. Would you make up a number? What do you know about antennas? Not that much, or you'd be an antenna designer. You making up a number would be a big slab of risk, which you'd have to heavily pad the estimate for.

So you'd ask a project guy (usually a special project guy called an estimator, or with a bit more charisma, a "capture manager"). The project guy would grab a system architect, and sit down with the customer for a while to fill in the scope (which is likely to be poorly defined at this point). Once the scope is firming up, the program guy will find himself a posse of engineers, a manufacturing guy, some support people (trainning can be a big cost contributor) and put together a price. This price represents a pretty good guess.

For a smaller risk pad, maybe you'd just sit around with a system architect and chat for a while. For a large risk (on a very juicy program) you might go into a six month risk-reduction phase where a gang of engineers start to design the program.

So as an engineer, how do I come up with a good estimate?

From a smaller picture point of view here's some guidlines I use for estimating. The big one is that things take longer than expected. Even simple, fully constrainned tasks. Much longer.

Here's some of the reasons why:

Keep these things in mind when you figure out how long a sub-task takes. Add all the sub-tasks into a logical chain and total up the time/labour/cost. Sounds simple right?

So how do I protect my tasks against scope changes?

By looking at the task as a whole. Let's say your scope has five tasks or various sizes to do, some short, some long. I'd do the estimate by generating a number for each task, then adding them together, then thinking about all the problems I talked about above, and increasing the number greatly to take them into account. Now when the scope changes I've got enough labour hours and materials to roll with it.

But not all estimates are the same. Where in the distribution shall I aim? Should I just put my best guess.

No! Best guess is 50th percentile. If I was organising a schedule I wouldn't get very far stacking a bunch of 50% chances. If the software had a 50% chance of being done by May, and the Hardware had a 50% chance, and the manuals a 50% chance do you think I'll be shipping in May?

I personally now only give 95th percentile estimates. Since the limits of my skills, and the variable nature of the world make my own estimates dissapointingly squirmy the 95th percentile ends up pretty far out there. At the bottom of my estimate sheet I always put the percentage I'm aimming for. Many people don't know how to interpret it, and so tend to ignore it. Those that ask for a different percentage (say 50th) usually are able to appreciate the value (or lack therof) of such estimates.

Overall 95th percentile or task-by-task 95th percentile?

Try explainning that distinction to an estimator some time. Oy. I use the 95th percentile within the limits of my responsibility, and within the range of my ability to transfer effort.

But if everyone did this the estimates would be way too high!

Buddy we're a long way from everyone doing it this way. For everyone who puts down reasonable numbers there's three other ones writing speculative fiction with rosie glasses on. I've jet to see a project end without labour overspending met without dramatic last minute scope changes. Some day I'll see the other end of the spectrum, and then I'll worry about them being too high.

When we plan with those kind of numbers the projects not worth doing!

And the the sooner we figure that out the better. Congradulate yourself on preventing an expensive mistake.

My manager gave me a really hard time and wants me to cut down the numbers.

If he wants to cut them, that's his concern. If you reduce your numbers because he doesn't like them you're not doing your job. From experience I can say that the managers that brow-beat you about your estimates are the ones most likely to blame you if those estimates are shown to be wrong later. It can be quite stressful to stick to your numbers, but it's worse to get the blame for bad numbers later.

My boss didn't like the numbers and cut them down, now I don't have enough time to do the task.

Make sure the relevant assumptions are on the estimate, and save a copy. If it becomes an issue, bring a printout along when you talk to him. Seriously, if someone changes my estimates in a way I don't agree with they're no longer my estimates. If I make a bad estimate I take the heat and bust my ass to make up for it. If someone else made a bad estimate, I'll do my job but don't expect me to be feel guilty when it all cocks up.

Oh Ulrich. You're just cynical and bitter.

Nonsense. I'm much more than cynical and bitter.

I'd love to hear people's thoughts on this rant.

20050104 Addendum: I've goten a bit of feedback which brings up a relevant question.

Part of my estimate is based on estimates provided to me by others. How do I deal with the risk/uncertainty they bring in?

How much do you trust their techincal/scheduling skills? Numbers provided by a very wise old engineer are ones I'd use as is (and thank them for their time). Estimates for routine activities provided by overhead groups, or in fields I know nothing about, I likewise leave pretty much alone. Numbers provided by a coop student get raised by a factor of 5 at least (bless their optimistic little hearts!).

We're all done the project, and I've still got to 15% of the budget left. How do I explain this to the boss?

First of all, if you've still got budget left I guarantee that there's three other parts of the program which overspent. Your boss will be happy he's got some margin on your areas to move around to balance things out. In the unlikely even you are asked, I suggest you talk loudly and proudly about the excellent job your team members did in coming up with unexpectedly clever and cheap solutions to the design problems. Makes them look good, makes you look like a team player, and won't hurt your team's view of you when it filters around to them. The boss'll likely spend the rest of the day listenning to people moan about how they're behind due to the general spitefullness of the universe, so you'll make a nice break.


20041207

Quotes

Amusing little tidbits to put up.

In heaven:

In hell:

Shameful of me to perpetuate such national stereotypes.

My favorite biblical misquote:

No Rest For The Wicked

It's from Isaiha:22 which reads "There is no peace, saith the LORD, unto the wicked."


20041024

Sincerity and Priests

Talking about our little boy's cristenning this morning got me thinking about the various priests (I can never remember which ones are ministers, which ones are pastors, which ones are monsigneurs, which ones are shamans etc, so I use the generic term) I've dealt with over the years (ok, there's only actually 3 I could pick out of a police lineup).

As one would expect, they all had different styles or priesting (a term I use to address the whole specturm of church related activities, rather than just what they do on stage). Talking with other people at the church I noticed was that my own impression of their relative effectiveness was at different from that of most others.

The one that made the most impression on me was a guy named Ralph. Ralph is your archetypal big no-rythm white guy. He's not particulary charming, not that charismatic, can't dance, and his singing voice is attrocious. He's not that smooth of a public speaker and his sermons aren't that inspiring.

So then why is he so effective from my point of view? Simple, he's sincere. What I see when I talk to Ralph is actually who Ralph is, rather than who Ralph is pretending to be so as to maximize his appeal to the donating audience. I know Ralph isn't just doing this because it pays the bills, because he likes feeling influential, or because he feels the need to impress his view of the world on others. He's not shallow, and he's not a dummy, and I know that he actually feels, in broad anyways, the way he acts. If he had the skills to be more charming or more motivational to his audience, he would use them, because it would increase his overall effectiveness, even though it would alienate Ulrich.

Needless to say, Ralph no longer priests at the church Judith and I attend (once in a while). The majority of the congregation didn't find him inspiring enough, and he's been moved to a small church outside the city. Pity.

His replacement, Catherine, is a nice enough lady. More charming, more charismatic, more appeal to the congregation. She certainly seems like a good, devout person...but I can't be sure.

I suppose I'm just an inherently distrusting sort of person.


20041024

Sincerity and Politicians

Now this is a different ball of wax. I have a veeeery low oppinion of professional politicians.

In my view everything a politician says, and half of what he/she does is a lie. The only time they tell the truth is when it happens (by pure chance) to be exactly what it is they think you want to hear. There are however two ways I know of in which you can actually find out something about their actual motivations or views.

Neither of these is particularly clean or quick, but at least it's a start. If anyone else out there knows of other ways to extract info from such people, please email me.

Another thing I'll add is that while I'll grudgingly admit that a significant fraction of politicians may start out reasonably honest, very, very few stay that way after being in power for a while. Simply put:

Politicians are like diapers. Both should be changed regulary, and for much the same reason.

This also forms the basis for Ulrich's voting system. Unless they're total quacks, I always vote for the party that isn't currently in power.


20041022

Death

So, ever wondered what's likely to kill you? It's useful in trying to really quantify the risks out there, so that you can prioritize your night's worrying.

A quick peek at health Canada's info sites suggest that for a 30 year old male like me, my chances of snuffing it are about 0.1% per year. If my number does come up, it's a 33% chance that I died from some sort of accident, 23% chance that I got so depressed with all this worrying that I killed myself, 12% chance of it being some sort of infectious disease, and 9.3% chance of cancer. Homocide is only a 3% chance, and of those murdered in Canada, 7 out of 8 are murdered by people they know, rather than some axe-wielding maniac (unless of course your friends are all axe-wielding maniacs).

If you want to see the whole gruesome tale, go to The Pages of Death.

So don't worry! It'll distract you while you're using that chainsaw, get you depressed, or make you annoying to your co-workers at the post office.


20041019

and Taxes

This is just a short one, but I've been bothered recently by people I hear demanding all sorts of state handouts for their special interest groups, while at the same time moaning about having to pay too much in taxes. And what cheeses me off even more is listening to slime-ball politicians who promise to do both for whatever special interest group they're standing in front of.

This short rant got me wondering about something. How does the federal budget actually break down? Of the tens of thousands I ship the Fed's each year, how many goes to healthcare? How many to the army? How many to welfare?

So I hop onto the government of Canada's Treasury Board site and there's the info. For the 2003-2004 fiscal year, the total revenue was M$198,546. Revenue Breakdown (just the big sources):

Similarly, total expenditures were M$189,463, Expenditure Breakdown (again, just the big ones):

The source for all this was Page 9 of 2004 Public Accounts.

On the provincial level (here in Alberta), of the M$22,600 the budget spent, M$8,380 went to health care, M$6,350 went to education, and M$2,390 went to social programs. The provincial documentation is much simpler to read than the federal one, but much less in-depth, which makes sense as the Prime Minister has a university education, while the Premier is a drunken highschool dropout.

So there you go. Our taxes here in Canada are roughtly 25% Social programs administered by the provinces, 25% provincial government, 25% federal government, and about 20% debt servicing.


Jan 1, 2003

Weight Loss

There is a depressing amount of misinformation floating around in the heads of the general public about how to control their weight. Usually people express these notions immediately after making some self-depreciating statement about their own body shapes. I'm no dietician, but I am "An opinionated S.O.B." (in the words of my father in law) so I've got a couple of things to say on the subject.

First of all, as long as your body form isn't preventing you from doing things you really want to do, and it isn't overloading your ticker to the point that you'll die years before your time, then you don't need to change it.

For females especially: burn your fashion magazines, sell your TV and learn to be comfortable with who you are. You've got to have a certain amount of fat on your body to be healthy, and a bit more just makes you more cuddly. Any guy who's opinion you should care about isn't going to be comparing you to a 15 year old magazine model.

Now, if there's an actual reason that you want to change your body form (a.k.a. you weight 300lbs and your knee/ankle joints are failling prematurely), then there's only one way to do it:

Do more, and eat less.

Too simple for you? Tough. That's the way it goes.

Humans are no different from any other animal in this regard. Every day we use a certain amount of energy. Every day we get a certain amount of energy from our food. If you take in more energy than you put out, your body (remembering a thousand generations of starvation) stashes it away as fat. If you take in less energy than you put out, your body will metabolize some of your own tissue to make up for the difference.

Now there are some modifiers here, because us humans are complicated machines. None of them, however, change that basic five word instruction. Some of these modifiers are thermodynamic, and some are biological.

Some foods are easier to turn into fat, than they are to burn now. Chomping a big serving of bacon just before you go hiking is not a good idea. Chomping some pasta and veggies is better.

Some people are genetically programmed to have a stronger put-extra-energy-into-fat mechanicsm than others. Them's the breaks, it just means you'll have to work harder than others.

Things not to do to loose weight:

1. Excercise 'till you have a heart attack. The reason is obvious enough, I trust.

2. Starve yourself. Your low-food optimized system will burn muscle mass in preference of fat, leaving you weak and without energy.

3. Go on fad diets. You'll feel awful, be cranky, an any improvements in your body shape will be temporary.

4. Set unrealistic goals, or try to do things too quickly. "It's december 3rd, and I'm going to loose 30 lbs by Christmas." is silly. Things like "It's the first of the month, and by this time next month I'm going to work towards wighing 5 lbs less." are better. Gradual, step-by-step lifestyle changes are more likely to be things you can keep doing for the long run.

Things to do in order to loose weight:

1. Be more active. The added muscle mass from physical activity will increase your idle energy consumption, and you'll feel more energetic. You'll notice the difference almost immediately.

2. Stay away from the fast food, and heavily processed food. A good rule of shopping is:

Everything you need is on the outer periphery of the supermarket: Meat, Bread, Fruits, Vegetables and Dairy. Stay away from the inner aisles.

3. Eat slower. Talk to people while you're eating (but not with your mouth full). Wait 10 or 15 minutes before deciding whether you're going to have dessert. A human's "I've had enough food now" response seems to be delayed around 10 minutes, so if you just power through the meal you'll feel very full afterwards.

4. If you're hungry before going to sleep, or in the middle of the night, try drinking a nice big glass of water. Most of the time it'll keep your tummy happy.

Overall, stay reasonable and stay focussed.


Algorythms

In the past I've had a rough time explainning what an "algorythm" is to non-technical types, and have been trying to dream up a good way of doing it. Tonight, during dinner, an example occured to me that I think does a fairly good job of demonstatrating not only what is meant by an algorythm, but even what a "recursive algorythm" is.

Basically, and algorythm is a series of steps carried out to solve a problem. The example I'll use deals with a teacher who wants to arrange all of her students in a line from shortest to tallest, what we call a sorting problem. There's a couple of different ways she can do this. These different approaches are different algorythms that can be used to solve the problem.

We'll say she has 30 students (enough to make it interesting). We'll also give her a good eye, meaning that she can judge which of two students is taller without having to pull out a measuring stick. The intended order is for the tallest student to be at the north end of the wall, and the shortest student to be at the south end.

When comparing different approaches a good comparison is how many student comparisons are required to finish the sorting process. The less comparsions are required, the quicker (and better) the sorting approach, in general.

Here's one possible approach:

Line up the students randomly against the wall. Then starting at the south end look at the students in pairs. If the southern of the pair is taller, have them trade places, if not leave them be. Once done with the first pair, step one student to the north and repeat the comparison for the next pair. Once the teacher gets to the north end of the line the students will be in a bit better order than before, but not yet in order by any means. To get the students in order will probably require about as many trips up the line as there are students in the class.

So to sort all 30 students using this technique will require 30 comparisons to be done 30 times, for a total of 900 comparisons. That'll take a while.

Another possible approach would be to group the students in the middle of the room, then measure them all to find out which is tallest, and move that student over to the north end of the wall. Then go back to the group and pick the next tallest and put them next in line. Repeat until all the students are in line at the wall and you're done. Counting comparisons again, the first time you'll have to measure 30 students, the next time 29, the next time 28, and so on. All students together require 30 x 15 (15 being the average of the 29 comparisons for the second kid, and the 1 comparison for the 2nd to last kid) comparisons for a total of 450. Better, but still not so good.

A third approach would be this; Again group the students in the middle of the room. Pick a student at random and call him/her the average height (they won't be, but on average it'll be close). Now compare all the students in the class to this student. All the ones taller go to one side of the room, all the ones shorter go to the other side. Now you have two groups of (on average) 15.

Now repeat the process with each of the two smaller groups, again dividing them into those taller than the group's average, and those shorter. Now you have four groups of 7 or 8.

Another repetition gives you 8 groups of 3 or 4. You can repeat it again if you like, to get groups of 1 or 2, at which point the groups are now sorted. Now move the groups over to the wall one after the other, and the class is sorted. Done.

Now count the comparisons again. The first time the teacher compared 30 students. The next time 15x2. The next time 7 or 8 times 4. The next time 3 or 4 times 8, and you're done. Total comparisons are 30 x 5, for 150. That's good. In reality your chosen "average" student won't actually be the average, so it'll be a bit worse than this, but 150 - 200 is probably in the ball-park.

So here we have a task, sorting, being solved by three different algorythms. Some more efficient than others. The real payoff from using a smarter algorythm is apparent as the number of kids rises. For a class of 30 students algorythm 1 takes 900 comparisons, Algorythm 2 has 450 comparisons, and algorythm 3 has 150-200 comparisons. Now what if we had a class of 100 students (wait a few more years, it'll happen).

Now method 1 uses 100 x 100 = 10,000 comparisons. Method 2 uses 100 x 50 = 5,000 comparisons. Method 3 uses...100 x 10 = 1,000 (maybe 1,500) comparisons:

Now there's a factor of 6 or 10 difference between the best and worst algorythms, and it starts to really pay off.

The last one of the three alogorythms is what's called a recursive algorythm. This means that each step of the solution is like the last, but is applied to a smaller subset of the problem. After reducing the problem far enough, the solution of each of the parts becomes trivial and you can put them back together into the total solution.

Dig it?


Living in interesting times.

There's a mini-series called "Hitler: The Rise of Evil" comming out regarding the rise of the Nazi party in Germany before WWII. Apparently the producer of the series has been fired for expressing the view that there are some similarities between 1930's Germany and 2000's America in terms of national spirit and rampant right wing sentiment. Here's an interesting article on the subject which I swiped (without permission, so by all means subscribe to their excellent newspaper) from the Los Angeles Times:

---------------------------------

The brutal politics of war -- and television -- have cost Ed Gernon his job.

How ironic that the executive producer of a coming CBS drama about the rise of Adolf Hitler -- whose iron fist crushed free expression -- would be fired for publicly likening the climate in America in advance of invading Iraq to the Germany that produced the Third Reich.

And how outrageous.

The U.S. is never scarier than when the fearful climate Gernon mentions inhibits Americans from publicly going against the grain and saying publicly what they think, in this case even as our troops and others risk their lives and die ostensibly to ensure, among other things, that Iraqis attain the freedom of expression denied them under Saddam Hussein.

The same freedom some would deny Gernon.

Made in a TV Guide article about the two-part "Hitler: The Rise of Evil," Gernon's Bush-era analogy may have been a stretch even for some opponents of the war in Iraq. Or perhaps not. But he had every right to state it without being shunned as a traitor to freedom -- which he isn't -- and getting thumbs down from his Alliance Atlantis bosses and from CBS, which issued a statement calling his remarks "insensitive and outright wrong."

Words that apply to his dismissal by Alliance Atlantis, which is making the miniseries for CBS, and slap-down by the network, which, reading between the lines, appears to be the guiding hand in Gernon's demise. To say nothing of inflammatory accounts in the New York Post -- both before and after the firing -- that distorted Gernon's comments and made him out to be the Benedict Arnold of prime time.

Gernon was sacked as an executive vice president by the Canadian production company after being quoted in an article explaining the essence of the Hitler drama, which dwells largely on conditions that made his ascent possible in the aftermath of World War I. Scheduled to air next month, the drama was filmed mostly in Prague and stars Robert Carlyle as Hitler.

Here is what Gernon, interviewed before the U.S.-led invasion of Iraq, told reporter Mark Lasswell about Germany and Hitler's route to infamy as shown in the CBS story:

"It basically boils down to an entire nation gripped by fear, who ultimately chose to give up their civil rights and plunged the whole nation into war. I can't think of a better time to examine this history than now."

Here is what Gernon said about Americans accepting President Bush's decision to launch a preemptive strike against Iraq aimed at toppling Hussein and stripping him of weapons of mass destruction:

"They will stand by and let it happen because of the fear of what will happen if they don't."

Lasswell writes that Gernon went on to say that a similar climate "absolutely" nourished Germany's endorsement of Hitler's extremism. "When an entire country becomes afraid for their sovereignty, for their safety," Gernon added, "they will embrace ideas and strategies and positions that they might not embrace otherwise."

Although these comments hardly threaten the republic -- and do not equate Bush with Hitler -- CBS responded as if Gernon had urged America to rise up and overthrow the president. It went on to say in its statement: Gernon's "personal opinions are not shared by CBS and misrepresent the network's motivation for broadcasting this film. It is very important that viewers understand that these views are not reflected in the tone or the content of the miniseries, which recounts the rise of Hitler to power and portrays him as the ruthless, maniacal force he was."

Which of Gernon's "views are not reflected in the tone or the content of the miniseries"? That fear drove public opinion in the devastated Germany that emerged from World War I? That German acquiescence allowed Hitler to plant himself firmly and then tighten his grip?

If anyone is expert on the tone and content of "Hitler: The Rise of Evil," it's Gernon, who more than anyone has shaped it since its controversial inception, when a first draft of the shooting script was loudly accused by Jewish activists of being soft on Hitler. That script, which Gernon himself later said was unintentionally "anti-Semitic," was scrapped, and the project revised to place less emphasis on Hitler's youth and more on the German environment that abetted his ascent.

But the bitter aftertaste lingers, and some Jews remain suspicious of what will appear next month, making CBS all the more nervous about further controversy being attached to Hitler's story. That includes antiwar comments at a time when Hussein has been dispatched and the overwhelming bulk of Americans support the U.S.-led war effort.

So Gernon takes the fall.

When I spoke with him in Prague in February, he made comments similar to those in TV Guide, but I omitted them from my own article on the CBS project for reasons of space.

I asked him then what he wanted viewers to take away from this story.

"Don't give up your vote," he said. "Don't ever give up your right to think, to feel, to have a voice. That's what this kind of leader does to you. There's a sense that each person would be better if they surrendered to this greater good."

He then related this TV story to war fervor then building. "We're on the verge of a war that a lot of people are ambivalent about, and yet we're marching towards it, nonetheless. And we would sit smugly back and say history can't repeat itself. We don't have to have a crazed lunatic who is a monster for history to repeat itself."

Was he comparing burgeoning Hitlerism in the early 1930s to Bush's push for invading Iraq? "All I'm saying," he replied, "is that an enlightened society has a responsibility to govern itself intelligently and not be swept along by fear."

How could I have guessed, listening to him in a trailer on the Hitler set, that expressing similar feelings in another publication would get him fired? And that speaking his mind, while giving this Hitler story a topical framework, would backfire on him and send him packing.

In an industry swept along by fear.

------------------------------------

It should be noted that the LA Times web designer knows about 115 times more regarding HTML than I do, so I've had to butcher some of their nice formatting.

The article expresses my feelings on the subject fairly well. The situation is heading downhill.

Any direct comparison between Hitler and Dubya is meaningless. Hitler had brains, and he had charisma (and he was a raving psycho). One really could imagine him leading a country to do things, and attach some responsibility to him for how things turned out. Dubya (no offence here, dear American readers) just isn't there. He comes across as a confused old guy who could organize his way out of a wet paper bag without a couple of flunkies to grease the palms of the bag-wetters, and a dozen more to write his "I'm out now. God Bless America." speech. The whole Born Again Christian thing doesn't do much for his credibility either. Deep down inside I have a hard time attaching blame to such a person.

On a less flippant note, I don't see global racial genocide on the US agenda, although the running vilification of muslims and arabs is eroding my faith in this.

Mind you, one never knows what the religeous right is up to. As my Dad used to say (it suffers in translation) "Between reasoning people (those who think the physical world runs according to logical rules) and magical people (those who think the world operates by mystical forces, or god's will) there is twenty metres of steel." The last part of this is the charming German version of the english "brick wall" analogy.

Oh well. Good thing us humans breed fast and know how to sharpen sticks. It should allow some of us to survive.


Association and Causation

Chatting with my bro a little while back, I was reminded of an example of the difference between association and causation.

For those not clear on what I mean by those two words, here's some quick definitions:

Association: Features of a statistical set that correlate to each other. For instance, if you were to sample the number of cars waitting at a downtown intersection, and plot time-of-day against the number of cars, you would find that there is a correlation between the two, namely that there are more during rush hour. Another example of two things that correlate would be the age of a driver, and how likely they are to get into an accident. Things that wouldn't usually correlate are the weather in Toronto and the number of micro-meteors falling into the Indian Ocean, or that same downtown traffic and the colour of shirt your bus driver is wearing today.

Causation: A logical causal relationship between two events. An example is hitting your head with a rock can cause it to hurt. If you hadn't hit it with the rock, it would not be hurting. Another example is liver disease and excessive drinking. A relationship that isn't causual is that between two flowers growing next to each other.

Having hopefully made that somewhat clear, consider this piece of statistical wisdom:

Statistics show that people who eat fruit loops for breakfast each morning are far less likely to be hospitalised for heart disease than those who eat "healthy" high fibre cereals.

I absolutely guarantee that the above is a true statement. In a minute, so will you.

Now does this mean we should all head out and start munching coloured sugar puffs to keep our ticker healthy? Remember that Association and causation are two different things, so simply because two things are associated, doesn't mean that there's a causual relationship between them.

The key to figuring out whether Association means Causation is to look for a mechanism. What's a mechanism? I'll borrow a definition: "An instrument or a process, physical or mental, by which something is done or comes into being". Looking at the earlier example causations the mechanism would be "Hitting your head with a rock can damage it. That damage shows up as pain", a good clear mechanism. Similary "Alchohol is toxic. Your liver works to take poisons out of your system. Pour enough poison onto it and it'll stop working.", less clear, and I'm sure I'm missing much of the detail, but it's still a mechanism I'd believe.

Let's see if we can come up with a mechanism to relate Fruit Loops and hear disease. Sure, Fruit Loops are dyed sugar puffs. Eat too many and all your organs fail. - Hold on, that's a mechanism, but it points in the wrong direction. The assertation is that eating FL's reduces your chance of heart disease. Perhaps one could connect the almost total lack of nutrition with some sort of weight loss? Seems flimsy. Without a good idea as to what the mechanism might be, it would however be foolish to believe there was a causual link between FLs and tickers.

So now you're asking, how can two things be associated with each other, if there's no causual link between them?

Simple. They could both have a causual link to some third thing. The association between time-of-day and traffic is caused because both link to the oppening and closing of buisnesses. Not because cars multiply at regular intervals.

Can you think of the third object link between FLs and your heart? Age. People who eat FLs for breakfast are generally 3 or 4 years old, and not at a stage in their life where their likely to be in the hospital for circulatory problems. Likewise if you're choking down a bowl of All Bran every morning, it may well be because your doctor's told you to lay off the bacon-and-eggs or you'll soon be pushing up daisies.

So the next time you hear someone claim that "Black people commit more crimes than white people" or that "People who take Poralignon 7 have a 40% better chance of recovering from their strokes than those who don't", ask yourself about a causal mechanism. Is there one, or are they both symptoms of something else. If for instance, the population sample in the first claim compared 1000 wealthy Montana suburbanites, with 1000 inner city welfare people from Chicago, perfectly reasonable mechanisms to explain the difference would be income or environment. Maybe Poralignon 7 costs $90 per pill, so that only wealhy people can afford to take them while being pampered in their private hospitals. Or maybe Poralignon 7 is only prescribed for young people because it has severe side effects that only relatively healthy systems can survive?

Honest test design would make sure that other potential mechanism are excluded from the statistic. The people planning the test would sit around dreaming up all the other potential mechanisms that could interfere with the one their trying to show, and make sure their test cancels them out. For instance, selecting your crime-rate population sample at random from the entire US or Canada. Or count only stroke patients within a given income bracket or age group.

Honestly reporting test results involves stating the limitations of the test. For instance it would be "People given Poralignon 7 had a 40% higher recovery rate than those on an identical treatment program with Pez".

However, you can be certain that those presenting statistics for marketting or political reasons are anything but honest.

Hopefully, armed with a somewhat improved understanding of the difference between Association and Causation, you'll be a bit more resistant to their BS than before.


Retired:

Thoughts on Fence construction rant. I learned much while rebuilding our own fence, and until I revise the text accordingly I've taken it down.

Machine Tools rant. I'm so broke these days that such thoughts don't even bear consideration.