Saturday, January 27, 2007


One of the local newspapers has a puzzle with the prize of a 2 GB iPod Nano. You send an SMS with the solution to a number, pay 5 DKK (app. $1, a little less than 1€) and take part in the draw if your solution is correct.

I recently noticed that they are kind enough to print the number of correct solutions sent to them the previous week. It turns out it is very few. This week it was 28. That probably says something about the quality of the newspaper...

Anyway, what's interesting here is that you pay 5 kroner to get about 1/28 chance of winning a prize worth 1600 kroner. Assuming a probability of 1/28 every week, the outcome is binomially distributed. The expected number of wins is thus np, the number of draws times the probability. Consequently, after 28 weeks you can expect to have won the prize once, paying 140 kroner to get an iPod!

So we've decided to start sending in the solutions from now on.

The thing about gambling is that the variance is usually high. For the binomial distribution the variance is np(1-p). Since the probability is 1/28, the extra factor compared to the expected value is 1-1/28, or almost 1. In other words, the variance is almost the size of the expected value. We take the square root to get the standard deviation, but this does not change the value much.

For the normal distribution, which the binomial distribution approximates, one should not be surprised to get a value within 2 standard deviations of the mean (this is about 95% of the probability mass). Here are two plot that shows the expected value (red line) with one and two standard deviations added as a function of the number of weeks. The first one is zoomed in on 0-28 weeks.

The good news is that after 28 weeks, I wouldn't be surprised to have won two or even three iPods. The bad news is that I might as well not have won one at all. As you can see on the second plot, it takes more than 150 weeks to make the expected value minus two standard deviations greater than one.

I am crossing my fingers.

Monday, January 22, 2007

Open source community building

A guy describes his experiences with building an open source project. The most interesting part is the check list to the right.

Sunday, January 21, 2007

A model of eating

I have known for some time now that Janne and I don't eat a lot of meat. It's not that we are vegetarians, most of our meals include meat in some form or another, it's just that the amounts are small.

On the other hand, we eat a lot of vegetables. Since moving in with Janne I'm beginning to think that a standard Danish dinner consisting of some kind of meat with boiled potatoes and a sauce is extremely boring. It needs to be augmented with vegetables.

So today I was wondering whether there is a correlation between these two facts, less meat and more garniture. I think I've found a model that can explain it.

When I eat, I usually alternate between putting the various stuff on the plate in my mouth, e.g. with potatoes and a beef it is one mouthful of potato with sauce, one mouthful of beef, one mouthful of potato, etc. Let's pretend it takes 100 mouthfuls to get full, ignoring differences in the saturation effect of different types of food. Then roughly 1/2 of these, 50 mouthfuls, will be of meat.

If instead the plate contains of two kinds of vegetable garniture plus the potatoes (Janne and I almost always cook them in the oven and forgo the sauce) and the beef, then I'll usually alternate in a round-robin fashion between the vegetables, the potatoes and the meat. So only roughly 1/4 of the mouthfuls will be of meat, i.e. 25 mouthfuls.

If the model is correct, and I'll think about validating it, then I eat about twice as much meat at a traditional dinner at my parents' compared to a typical dinner cooked by Janne or me, without really noticing it.

So now I'm just left wondering exactly how many mouthfuls it takes for me to get full. I think I'll try counting them.

Tuesday, January 16, 2007


Some guy tried living on $30 for a month. Incidentally, he appears to have found an effective means of losing weight.

Monday, January 15, 2007

Talk by Claus Elgaard

A couple of months back I attended a talk by Claus Elgaard with my iola comrades. Coming from the world of sports and athletes, he talked about motivation, preparation, excitation and hybris in the extreme. Fascinating. I found my notes while cleaning up the office in preparation for our move.

Unfortunately, almost noone showed up so financially it was a disaster. A picture of life, perhaps.

Saturday, January 13, 2007

Small games

I recently discovered Pang Zero, a small game in which you try to avoid getting hit by balls and at the same time shooting them away. I have been playing it a couple of times lately. It reminds me of another game, AckAck!, that I played back when I was using Allegro. Unfortunately, I can't find it anymore.

Could be interesting to try speed programming small games like these with something like Pygame. I've always spent too much time mulling over the details with my game projects. Perhaps that's why I only got Monster Masher finished enough to actually release. I have the source code for a Spacewar game, a Scorched Earth-like game (we called it Gnome Tanks) and a clone of Helter Skelter stored somewhere, none of them complete enough to be really playable.

Still, I'm secretly proud of Gnome Tanks. The AI can aim perfectly in all terrains, even when it is windy. Wind transforms the equations into something that cannot be solved analytically so I had to research and implement a numerical solver. When I wrote the code, it was the only Scorched Earth-like game that could do this. I wonder if others have figured out how to do it by now.

Wednesday, January 10, 2007

Usability testing

I just discovered that has gotten quite some content now. Cool!

I think they could do with a usability test of the site itself, though. It's a bit confusing.