Thursday, May 28, 2009

The Knife Cuts Both Ways

In latest news, the Singapore government has announced some proposed changes to the electoral system which would increase the minimum number of opposition MPs in parliament to nine (this done by the device of the NCMP). This is intended to increase the range of views heard in parliament.

Would this measure work? Indeed, it seems that the number of alternative views presented would be greatly increased- this from a purely statistical viewpoint, since it is obvious that nine is greater than the number of opposition MPs, elected or otherwise, currently in parliament. And, since opposition MPs tend to be more active in parliamentry debates, one can't help but think that things are likely to be more vibrant.

What's the catch, then? Well, the catch is that the knife cuts both ways. Recall the effective "by-election strategy" employed in the 1991 elections, which resulted in great success for the opposition parties. That success was possible by contesting less than half the seats, and focusing the role of the opposition to be that of a watchdog and a provider of alternative views.

By legislating a significant amount of opposition voices into parliament, one can't help but think that the persuasiveness of the watchdog/alternative views electoral platform is somewhat weakened. However, I doubt that many would find the situation of having 2 elected opposition MPs as being significantly more preferable than the situation of having 9 NCMPs, even considering the reduced powers of a NCMP.

The real question is whether the opposition would lose ground in the next election. Possibly, due to the forementioned weakening of the watchdog/alternative views platform, though I think this might not be such a bad thing. I've always felt a bit ambivalent about the by-election strategy; it is the equivalent of aiming to come in second in a race just to win the second prize. It's not a reliable strategy, and it gives the mixed message of "we are not good enough to run the country, only enough to point out a few weaknesses in policy". The strategy really discounts some of the good work and thought that some parties have put into becoming a viable alternative for the PAP.

Though I suspect that it might be a moment premature, perhaps it's time for opposition parties to step up to the mantle, and present themselves as fully valid alternatives rather than mere complements to the PAP.

Tuesday, May 26, 2009

Weird Google Searches

Google has a suggestion feature that gives a list of possible searches that you might be looking for; this list is basically compiled from the most common searches. I've been typing random stuff into the Google, trying to see what I'll get. The conclusion: people are weird, sometimes scary.

First up: People are scared of Chinese people. Amusing.
Second tip: One man's meat is another's poison. I'll never eat mold, for sure. But a big red candle !? Seems like Google is available to ghosts as well.
Lastly, I think too many people have iphones. Making the poor assumption that result frequency is related to actual phone ownership rates, about 33% of phones are iphones.

Thursday, May 21, 2009

Secret to Happiness

The secret to happiness is rather simple. It requires a bit of brainwashing and/or mind-altering with drugs. The aim is to make you content, regardless of the actual circumstances.


The potential downside is the failure of the mind-altering regime. THIS MUST NEVER HAPPEN! YOU CAN'T HANDLE THE TRUTH!

Sunday, May 17, 2009

Secret Research Project 4: N Queens Problem with GA

Over the last couple of days I had an idea and nothing to do, so I implemented a genetic algorithm search for the N Queens problem. The N Queens problem is a toy problem in chess, where you are given N queens and a N x N chessboard, and where you are supposed to place the queens such that they do not attack each other.

The idea behind the GA search is simple; each individual in the population represents one configuration of the board. Better solutions can breed, thus (hopefully) conserving better positions. The details of the GA I used are as in the standard literature, employing uniform crossover and mutation with no elitism. The fitness function employed is the number of non-mutually-attacking queen pairs.

I tested the performance of the GA search algorithm on the N queen problem for N=4,6,8,10,12. Each problem was run 20 times, resulting in the following results:

Average Generations2.0184.5195.4838.0396.2
Median Generations11938.5320.5295.5
Average* Generations1.695.275.2521.9349.4
Solution Density128116641.8E61.4E7

*Average after discarding the 2 highest and lowest extremes.
Solution Density is the number of board configurations divided by number of distinct solutions; hence representing the number of random searches before a solution is found.
Efficiency is the solution density divided by average number of GA searches.

The results of the GA search are not too bad, though I was expecting better performance. However, the scaling seems a bit haphazard; I am unable to explain why N = 12 runs better than N = 10. Another point which is unreflected in this report is that for N = 15 and beyond, this GA search will require considerable time to run. More improvements are necessary.

Lastly, here are some of the solutions found by the GA search. A solution each for the N = 8 and N = 12 cases are shown.

N = 8 Solution

N = 12 Solution

Thursday, May 14, 2009

True Hair Loss Products

In the future, there will be true hair loss products. No, not products that treat hair loss, but products that cause hair loss.

It seems stupid, true. Who would want to buy true hair loss products? It doesn't seem to make sense. Well, many things don't make sense either; why people smoke, or drive dangerously, or buy expensive but useless luxury goods.

It's the handicap principle, really. Agents, whether humans or animals, may adopt useless handicaps to signal their superior fitness. Whether it is the fancy tail of a peacock or the stotting of a gazelle, the message is basically "Hey, I have this really dumb thing and yet I'll still alive and kicking. If I'm not great then I would have been long dead!".

So, in the future there will be true hair loss products. People who use them are more macho than people who do not. They are in turn more macho than those who use hair gain products.

Unless of course you are balding. Then you have adopted a handicap and failed miserably.

Sunday, May 10, 2009

Children and Daughters

Here are two interesting problems for you.

Problem 1:

I have 100 children. The oldest 99 are girls. What is the chance that I have 100 daughters?

Show Answer
The answer is 1/2. Quite obvious, really.

Simple, no? Now for the next problem.

Problem 2:

I have 100 children. At least 99 of them are girls. What is the chance that I have 100 daughters?

Show Hint 1
No, the answer is not 1/2. Try again.
Show Hint 2
Use conditional probability to solve the problem.
Show Answer
The answer is 1/101. Compute this by finding P(A|B), where event A is having 100 daughters, and event B is having at least 99 daughters.

A fun problem, though I didn't really get it right instantly too.