Friday, December 25, 2009

Thoughts on Recruitment

It seems to me that when companies are hiring, they are not looking for the most competent person for the job; rather, they are looking for the person that is mostly likely to be competent for the job.

I have heard of the battery of tests some companies subject applicants to. I have also heard of comments on the apparent uselessness, or rather, the low correlation to working ability, of these tests. These may indeed be true, but the tests ought to be understood in another framework. The tests are not meant to measure your competence, but rather, your incompetence. A high score on a reasoning test does not grant you improved standing in the employer's eyes, but a low score essentially disqualifies you from the running.

Similarly, a university degree can be thought to be a form of accreditation. Having a university degree, or a good honors, does not imply that you are competent. However, lacking a degree, your standing in the eyes of the employer is suspect. Indeed, there may be a million sound reasons why you were unable to attain a degree, but it is far easier, and far safer, for the employer to discard you from consideration, particularly if there are multitudes of qualified applicants. After all, if you only need a good hire and not the best hire, why take a risk?

Saturday, December 19, 2009

Many Years

While riding on the bus to the university today, I saw her again. She was wearing a blue long cardigan over a white v-neck tee, a style that she was fond of even then, many years ago. She seemed to have aged somewhat, and there was a hint of world-weariness in her eyes.

As she boarded the bus our eyes met and, for the slightest and yet longest of moments, stood locked for the first time in many years. Then she broke off our joined gaze, and tapped the card to pay her fare. For an imperceptible instant she seemed to hesitate, before perking up with a mustered smile and moving to occupy the bus seat beside me.

It was awkward at first, but we soon warmed up; and as we conversed, all those years of separation, of distance, seemed to melt away to nothingness. It wasn’t what we talked about, though reminiscing about our moments together was indeed nostalgic; it was the energy of the conversation, that youthful energy that we once had felt between us but then forgot, that seemed to slice past the fog of time and memory.

We didn’t notice how fast time had passed, not in our conversation, nor in our lives. Suddenly, she straightened her back and shot up her head, glancing outside the bus window.

“I’ll have to drop at the next station, I think,” she said with some tone of regret. I felt it too, for our time together was all too short compared to our time apart, which was all too long. Out of a small, tiny hope, I asked whether she would be taking the same route again tomorrow.

“No. I’m only using this as I’ve an errand to run. I don’t think I’ll be able to see you again like this,” she said before getting off the bus.

As I watched her back fade into the crowd, I thought about how similar this parting was to our last; in the end, after many years, we were once again parted by time and distance.

Monday, December 14, 2009

Better to Have Tried and Failed

It is possible to claim upon failure that it is better to have tried and failed than to have never tried before, but such words seem vacuous and empty. Perhaps there is some small truth in those words, and that it is indeed better to risk risks and experience experiences. However, it is more common for these words to be invoked to provide some measure of self-comfort, to assuage oneself of the redeeming benefits of one's failed endeavor.

It is not wrong to adopt such means of preserving one's esteem or happiness, for in fact humans are apt at devising such subtle self-lies, and that without such artificial constructs to hold the harsh realities at bay our sanity would be suspect. However, in realizing the true nature behind these untruths, one is resigned to either unhappiness or self-deception. In the former case, perhaps the only resort is to reveal the piercing truths, and to engage in schadenfreude, which is perhaps the only form of joy in a miserable world.

Saturday, December 05, 2009

Smoking Extends Your Lifespan

It is commonly thought that smoking decreases your lifespan. However, our research has shown that this is untrue!

Long before cigarettes were invented for recreation, smoking was used to preserve food. Logic tells us that if smoke can preserve food, it can also preserve humans (since humans are also some form of food, as attested to by various cannibals and carnivorous predators). In fact, smoke is "an antimicrobial and antioxidant". Hence, by smoking, you will be less vulnerable to diseases and illnesses.

It is noted that a major weakness of smoking in preserving food is that "the smoke compounds adhere only to the outer surfaces of the food; smoke does not actually penetrate far into meat or fish". However, this problem is circumvented by cigarette smoking, since the smoke is directly inhaled into the body. It suffices to say that the health benefits of cigarette smoking are greatly increased over that of standing in a bonfire to be smoked.

In all, one should not be convinced by anti-smoking propaganda. The health benefits of smoking are obvious; in fact, samples of organs from deceased cigarette smokers are readily available for viewing, and the fine state of preservation of such organs should readily convince the agnostic as to the veracity of our claims.

Monday, November 30, 2009

On Impatience

It seems to me that some part of impatience is related to self-centeredness, or at least, the valuing of one's time over that of another.

When one is impatient with someone or something, it implies that one would rather spend one's time elsewhere, on something that would be more preferable. Implicitly, one priorities one's time over the time taken to deal with that someone or something.

Saturday, November 28, 2009

A History of Man's Economic Systems

A long long time ago, Man lived by collecting fruits and berries, or hunting fish and animals. They lived each day by each day. Life was nasty, brutish, and short, and they died early. This was an advantage, since their primitive economic systems did not allow them to survive once they were unable to gather or hunt.

Man progressed. Now, life was nasty, brutish, and long. Now a problem was apparent- how were they to survive in their old age? It was no use being able to gather 5 times the number of berries to live in their prime, or to hunt 5 times the number of animals needed to survive. Food rots and spoils. You die when you pause, regardless of how awesome you were in your youth.

A solution was forged; for the old to depend on the young. A type of social contract was formed; the parent, in his adulthood, feeds the child, and the child, grown up, feeds the parent in his twilight. It was a sound system, fair.

Then, Money was invented. It was a splendid tool; coin did not spoil, did not rot. And, through this unspoilable good, Man was able to accumulate the excess production of his prime, and use it to support him in his old age. The ancient systems of the child supporting his parents were weakened, sometimes even invalidated. It was a reliable system, where no Man had to depend on another, and each was judged based on his own industriousness.

And the system of Money carried on, generation upon generation. Each Man supported himself by his own labor. But this system was not perfect. In each generation, there were those who were incompetent, or lazy, and hence unable to support themselves. But their force was weak, and nothing changed.

Then, one generation, there was a prodigious number of the idle and weak. And further, they were infertile and ugly, and could not have children to support them. In their collective despair, they created a new economic system, designed to steal from the future.

Their system would see them supported in their old age, carried upon the backs of the next generation. Some of their number argued, was this fair? What burden the next generation must face! But these voices were drowned out; it was argued that no such problems existed, for the next generation were themselves to be supported by their own next generation. And the system would continue to infinity, a stable system where everyone would be supported as long as Man survived. (The final generation would be screwed, but the problem of old age would probably be considered minor in the face of Doomsday.)

And the unfair system of the young supporting the old was imposed, where each generation was supported upon the backs of the next. It was a foolish system, akin to the world being supported by a turtle, itself supported by a turtle, ad infinitum. But nobody stopped the system, for a simple reason. Something was already stolen in supporting the first generation, and to stop the system, the present generation would have to bear the burden of this, alone. None ever did, for it was easier to pass the buck without cost to oneself.

But the fundamentals were flawed. People lived longer. People cost more to support in their old age. There were less people in each successive generation. And soon, people knew that the system would fail. But again, it was too entrenched to stop; all they hoped that the grenade would last one more lob, and not explode hot in their hands.

Our time is dire. The wise are revisiting the ancient methods. Some sought to accumulate more money to tide them though on their own strength. Others are reverting to relying on their children.

Ah, the good old days.

Thursday, November 26, 2009

On the Property Tax Hike

I read with interest the news article on the impending hike in property taxes, and the resulting online responses to the hike.

The interesting thing is, despite the framing of the news article, the tax rate has not been raised at all. In fact, the whole article seems deliberately confusing, resulting in much negative reaction online.

It is, however, true that the property tax payable will be higher next year than it is now. But how is it possible for the tax rate to remain constant, while the tax payable is increased? The crux to the matter is that the property tax is rated at a fixed percentage of the annual rental value of the property (named Annual Value). This Annual Value is determined periodically by the Inland Revenue Authority of Singapore (IRAS).

Now, logically the AV should be updated yearly to ensure a just amount of property tax is paid; it would be bad if the AV used to compute the property tax is higher or lower than the actual AV. Also, note that the AV is related to the market rates for rental (and hence, indirectly to property prices).

It so happens that the current adjustment of the AV is almost certainly upward due to an increase in the market rental rate (and indirectly, property prices). Hence, the property tax has increased, and yet the tax rate has not increased.

It would be unfair to accuse the Government, or any parties, of deliberate ill-will in causing the tax increase. In other words, the idea that the Government has created or levied a new, increased tax should be put to rest, for it is false.

The more accurate IRAS news regarding the matter can be read online.

Friday, November 20, 2009

Eliminate the Strong to Assist the Weak

The title of this post comes from the Chinese idiom, 除强扶弱. The meaning of this idiom is to assist the weak by standing up (for them) to the strong. However, the literal translation is "Eliminate the Strong to Assist the Weak", which is insane.

It is possible to imagine assisting the weak as a good act, but eliminating the strong is clearly crazy. Taken together, the literal translation seems to be promoting a sort of anti-Darwinist reverse-eugenics. The intent is evil, aimed at evolving a society of weakened beings.

A rearrangement of the idiom to the form 除弱扶强, or "eliminate the weak to assist the strong", is at least consistent with some form of positive social goals.

Tuesday, November 17, 2009

Journey into the Stars

Earth sent a radio message into the stars. A century later, the same message returned, undiminished, unaltered.

"It is not natural", the scientists said with certainty. They were less certain on whether it was alien, or supernatural. There was only one way to know.

Earth built a vessel to seek out the senders of the message. A three-hundred year sub-light journey, into the abyss. And so they journeyed, taking their first steps amongst the stars.

Time passed, and the journey eventually approached its end. As the ship neared the target, strange readings were obtained. A ship approached! Eerily the ship had similar markings and transmissions. Was this the aliens in a mocking disguise, or were these descendants of Earth, having long since arrived with FTL?

Neither, it turned out. It was a gigantic sphere, made of exotic meta-materials designed to perfectly reflect EM signals of all frequencies. The purpose of the sphere was unknown, and the builders, long gone.

Perhaps, this was only a monument to silently bear witness to the fact that they were once here.

Sunday, November 08, 2009

Rocket Science, Revisited

In a previous post, I suggested that it is better to run into a rocket than to run away from it. Recently, a friend pointed out a small oversight on the reasoning.

The oversight is relative velocity. Evidently, running into a rocket means that the rocket will hit you at a higher velocity as compared to when you are running away from the rocket. However, the original considerations on the rocket's acceleration are still valid.

The optimal solution seems to be to run towards the rocket, then to jump back with all your might an instant before the rocket hits you.

Tuesday, October 27, 2009

On the Materialism of Society

When a person is too concerned with material wealth and luxury, we may condemn that person as being materialistic. If we were to take the same argument and apply it not to persons, but to societies, to national entities, then we will arrive at a single conclusion- that Singapore is exceedingly materialistic.

How so? It has been said that the key prerogative of Singapore's leadership is economic growth. And indeed, Singapore has experienced much success towards that goal. But to frame economic growth as the most important of goals, to focus the most energies on enlarging and strengthening the economy, and to then treat the outcomes of such growth as symbols of power, of modernity, of first-world-ness - is there not something missing?

It is sadly laughable for us to not develop the other tenets of society, to hastily ignore that which has no economic benefits, and to then exuberantly claim that "we have arrived!" It does have a hollow ring to it.

It is not to say that the path adopted is wrong, particularly if one does in fact agree with the tenets of materialism. For what could be wrong with more fast cars, more luxury bags, and more cash?

More Tests?

If the aim of assessment is to assess the true ability of a student, then from a statistical point of view, it is better to have more small tests rather than a single big exam.

First, assume that we are using some consistent estimator of a student's ability. The natural conclusion of this assumption is that the more tests we conduct, the more likely it is that the estimate will be close to the true value.

The argument is also intuitive; with more elements of assessment, the impact of a "freak event" that affects student performance is greatly reduced. The result is hence more likely to reflect the true performance of the student, and is fairer due to the reduced role of luck.

Sunday, October 25, 2009

On Consumerism

Richness is not found in excess, nor is poverty found in austerity.

It ought to be obvious that equating material possessions with happiness is, to say the least, unsustainable. It is even more foolish to believe that having more results in a greater happiness; that serves only to move us to the precipice of destruction. A Malthusian accusation perhaps, but one that seems increasingly true as time passes.

I suggest that we look upon our lives with a critical eye, and to discover those things which are truly essential to our happiness. All other things are but luxuries, perhaps enjoyable, but should never be elevated to that of a daily necessity.

Saturday, October 24, 2009

Proofs of Arithmetic Progression


Find as many proofs of the arithmetic progression; i.e. prove 1 + 2 + 3 + 4 + ... + n = 0.5 * n * (n + 1)

I have thought of four proofs, as detailed below.

Proof 1: Proof by Pairing

We pair the first and last elements, then the second first and second last elements, and so on. Each pair will have the same sum, since the earlier element gains 1 while the later element loses 1. Now, divide any pair by half. If there are even number of elements, all elements will be paired, and since each pair is the same, the average is found by diving any pair by half. Now, if there are odd number of elements, the remaining element, lying in the center of the sequence, will have the same value as the half of any pair, and this also yields the average.

Having the average, the sum can be found by simply multiplying by the number of elements, which is n. Hence,

Sum = 0.5 * (first element + last element) * (number of elements)
==> Sum = 0.5 * (n + 1) * (n)

Proof 2: Proof by Mathematical Induction

Suppose that the sum for a sequence (1 + 2 + ... + n) is equal to 0.5 * n * (n + 1) for some value of n = k.

Then, for the sum of a sequence (1 + 2 + ... + (k +1)), we have:
Sum = (1 + 2 + ... + k) + (k + 1)
==> Sum = 0.5 * k * (k + 1) + (k + 1)
==> Sum = 0.5 * (k + 2) * (k + 1)
Hence, if the identity is valid for n = k, it is also valid for n = k+1.

Now, consider n = 1.
Sum = 0.5 * (1) * (1+1) = 1.
Hence, it is true for n=1 ==> true for all n.

Proof 3: Proof by Square

Consider the following image.
A (n+1) by (n+1) square can be broken up into three pieces; n + 1 unit squares, and two arithmetic progressions of (1 + 2 + ... + n). Using this relation,

(n + 1) ^ 2 = (n + 1) + 2 * Sum
==> Sum = 0.5 * ((n + 1) * (n + 1) - (n + 1))
==> Sum = 0.5 * (n) * (n + 1)

Proof 4: Proof by Triangle

Consider the following image.
A triangle of base (n+1) and height (n+1) can be obtained from an arithmetic sequence of of (1 + 2 + ... + n) by adding n + 1 triangles of 0.5 unit area. Using this idea,

Sum = o.5 * (n + 1) * (n + 1) - 0.5 * (n + 1)
==> Sum = 0.5 * (n) * (n + 1)

I hope that you have found this exercise to be entertaining.

Tuesday, October 20, 2009

Coin Problems

You have pennies (1c), nickels (5c), dimes(10c), quarters (25c), and half-dollars (50). Solve the following problems:

a) Choose a combination of exactly 100 coins such that the total sum is exactly $5. There must be at least one of each coin.

b) Choose a combination of exactly 100 coins such that the total sum is exactly $5. There must be at least two of each coin.

c) Choose a combination of exactly 100 coins such that the total sum is exactly $5. There must be at least three of each coin.

d) Choose a combination of exactly 100 coins such that the total sum is exactly $10. There must be at least one of each coin.

Note: For some of the problems, there are multiple possible solutions. It is possible to arrive at a solution by trial and error. However, the ideal way of solving this exercise is to discover a method to solve all the above problems in a less tedious manner than trial and error. =)

Wednesday, October 14, 2009

Rocket Science

A random thought struck me today. In the scenario that a villain is armed with a rocket launcher, and is aiming at you, would it be better to charge forward, or move backward? Assume that no lateral movement is possible, and that the distance is sufficiently close such that the rocket will hit you in seconds at most.

My insight is that moving forward actually reduces the amount of damage you take (if you ignore the salient point that you are likely to die anyway). Note that a rocket is by definition powered. Hence, when in flight, it actually accelerates, which means that if you give it more distance, the rocket gains more speed! The rocket has now a higher kinetic energy on collision. Conversely, by moving forward, the rocket will hit you at a slightly slower speed.

This analysis is, however, not valid for non-powered devices, such as bullets. Bullets will only decelerate, hence it would be wiser to run away in such a case.

This post was inspired by some weapons in comics which gain speed with distance, which on further thought did not seem that improbable after all.

Tuesday, October 13, 2009

On Envy, Revisited

If we were to ignore the cardinal mistake of blaming our woes on others, then perhaps we will view Envy in another light. Contrary to some lines of thought, Envy is not so much an indicator of insufficiency but rather a realization of injustice.

When one has Envy, one does not think "I want X (which Y possesses)". On the contrary, one believes in one or both of two things; in Envy's benign form, one believes that "I deserve X, as I am at least as deserving of X as Y"; in Envy's malign form, one simply believes that "Y does not deserve X". Hence, Envy emerges from the perception of injustice.

Sunday, October 11, 2009

On Envy

Envy is thought to be undesirable, and to be a sin. It is indeed true that envy causes a great sourness and unhappiness in people, but it is also a truth that only fools wallow in the adverse.

Great minds see opportunity in adversity, and linings of potential beauty in clouds of ugly desire. Envy can be a useful force; for those that are aimless in life, Envy is the clearest mirror that reveals the soul's truest desires. And hence, rather than repressing Envy, why not reach out and seize that which invokes Envy?

The parable of the scorpion and the frog tells us that we cannot deny our nature. Envy is ultimately an indicator of insufficiency, of lacking; our efforts to repress this sense of lacking serves only to enlarge our sense of insufficiency. Our nature demands a particular medicine and nothing else; only by obtaining the object of Envy can Envy be removed.

This is perhaps a sad truth, perhaps an ugly truth, but human nature is as such.

Wednesday, September 30, 2009

Additional Thoughts on School Canteen Food Pricing

Just some additional thoughts on the pricing of school canteen food. Previously, I noted that lower rentals was a bad explanation for the lower pricing of school canteen food. What are good explanations, then?

The first is that there is a price cap on the food price, explicitly imposed by the school through the tender bid, or implicitly in a sort of quid pro quo arrangement. Another realistic explanation is that school students have more limited resources, meaning that vendors lose profits if they raise the food price beyond the buying power of the students.

A friend brought up the idea of an ethical vendor selling food at a reduced (but still profitable) price. This too is a possible solution. However, I am more interested in the implications of introducing a single sub-optimal (or ethical) vendor into the market.

Making the standard economics assumptions, the sub-optimal vendor, by virtue of undercutting the competition, receives all the business. This state of imbalance results in ALL other vendors lowering their prices to match this sub-optimal vendor. This result is amazing.

I can imagine schools using this effect to the students' advantage, by setting up a single sub-optimal vendor, hence forcing the other vendors to that same price level. Students can even perform the role themselves by setting up some competing co-operative.

Why is School Canteen Food Cheaper?

I asked myself, why is school canteen food cheaper? Then I asked other people too.

"The rent is lower", some said. This seems to be an insufficient answer. One notes that demand for food in school is largely inelastic; meaning, price does not have a large impact on resulting demand. In such a scenario, it behooves the canteen stalls to raise food prices to some higher level such that it actually has an effect on demand, thus maximizing profit.

I then thought of the following: First, a canteen stall must be (at most, and at least) as profitable as any food stall elsewhere; this is a consequence of efficient markets. Second, since the tender for canteen stalls is open, this means that the final rent for the stall will rest at a level such that it renders the business just as profitable as any food stall elsewhere.

Now, if there was no constraint on the food price, the bids for the stall will rise to a level such that the required food price would be at the maximum tolerable. This is as discussed earlier. Conversely, if the tender has some requirement or constraint on the maximum food price, then the bids on the tender will be lowered, such that profitability remains constant.

In other words, it seems that low rent is a effect, not a cause, of food price being cheap. The real reason why school food is cheap is due to constraints on the food price, whether explicitly imposed due to contractual requirements, or implicitly through agreement (i.e., threat of tender being rejected/non-renewed if price complaints are made against the canteen vendor).

Tuesday, September 08, 2009

Blood and Bags

A medical helicopter has a special compartment for carrying blood bags; in particular, the compartment can carry 4 blood bags of any capacity.

Now, the maximum amount of blood needed for any heli-rescue mission is 4.95 units; any more and the patient is already beyond the capabilities of the medical crew. Considering this, it is wise for the helicopter to carry not more than 4.95 units of blood.

Another problem faced is blood wastage. Since blood transfusions involve connecting the blood bag to the patient, the blood in each used bag is 'contaminated' and cannot be reused for other transfusions. Hence, using a 4.95 unit bag for an patient that requires only 0.50 units of blood is discouraged, since 4.45 units of blood are not used and wasted. However, unopened bags can be reused for subsequent missions and are hence not wasted.

Considering the above, it is desired to choose some capacity for each of the 4 blood bags such that the amount of blood wastage in the worst case is minimized. It is assumed that the flight doctor is capable of accurately determining the exact amount of blood needed for transfusion before the transfusion takes place.

What are the capacities of the 4 blood bags?

Monday, August 31, 2009


By some standards, I may be held to be a hypocrite, in that I sometimes propound views which I do not hold, or that I sometimes do not act according to the views that I hold. Dismissing the argument that I am merely human, I propose the following defence:

I argue that there are multiple levels of belief; it is not a mere binary between believing and disbelieving. For instance, I may very strongly believe that the Earth is round, whereas I may weakly believe (from the weather report) that it will not rain tomorrow.

The distinction between the levels of belief is important when deciding whether to act upon the beliefs. Reusing the example of the belief in the incidence of rain tomorrow, my belief in the report may be weak enough for me to justify carrying an umbrella despite this being contrary to my belief that it will not rain.

By the same token, a belief may be held, but not to a extent strong enough to motivate behavior consistent with the belief. In particular, a person who demands a higher level of evidence or faith in any issue would neccessarily have a higher threshold of belief before acting.

Interestingly, the word hypocrite has its roots in the Greek words "hypo" and 'krinein", meaning "under" and "to sift or decide" respectively. In other words, hypocrisy was an inability to decide, which concurs with my earlier analysis.

Sunday, August 30, 2009

Explorations on Population Aging

Consider the following set of premises:

1) People ought to be responsible for the consequences of their own choices and actions.

2) People ought not be held responsible for the consequences of actions and choices that are not their own.

3) The economic problem of supporting the elderly is primarily the result of the diminishing base of younger taxpayers.

4) The lack of younger taxpayers is the direct result of the elderly not reproducing enough earlier on.

Taking the above four premises, one arrives at the following two conclusions:

1) From premises 2, 3 and 4, we conclude that it is unjustifiable for the younger taxpayers to assume a larger share of the financial burden of supporting the elderly.

2) From premises 1, 3 and 4, we conclude that it is justifiable for the elderly to be held to a greater level of responsibility for their own upkeep.

Note that the above argument is meant as an philosophical exploration on the issue of population aging, and does not reflect the entirety of the author's views.

Thursday, August 20, 2009

Prisoners and Boxes

In a certain despotic nation, there are many prisoners being jailed. To alleviate the problem, the Emperor has decreed for all the prisoners to be "removed". What is decreed must be done; however the person doing the actual work is the High Jailer.

The Jailer thinks that the cost of bullets to execute everyone is too high, so he offers the prisoners the chance to earn their freedom. He proposes a game. There are X boxes in a room, with each box having the name of one unique prisoner. Since there are X prisoners, each prisoner's name is found in one and only one box.

The game is as follows: Each prisoner will be allowed to enter the room one at a time. The prisoner can then open all but one of the boxes; however, if the unopened box contains his name, everyone will be executed. If he does find his name in the opened boxes, he must restore the room to its original condition and leave the room. The prisoner will not be allowed to communicate to any prisoners that have yet to enter the room. If after all the prisoners have visited the room and found their names, they will all be released.

Needless to say, the boxes are arranged randomly. Still, each prisoner has a fairly good chance of finding his name; there is only a 1 / X chance of failing outright.

One of the prisoners, who is an amateur mathematician, remarks that the chance of everyone surviving is ( (X - 1) / X ) ^ X . He notes that by applying limits and using l'Hôpital's rule, the chance of surviving will increase with X, reaching e^-1 (0.368) when there are infinity prisoners. Not too bad a chance, he thinks.

At this point of time, another prisoner, an expert mathematician, speaks up and claims to have a better strategy! He shouts, "Why, with my plan, it is almost certain that we'll all survive!"

What is the mathematician's plan, and what is the chance of survival?

Note: This problem was derived from The condemned prisoners and the boxes, but the solution for our problem is more easily obtained.

Sunday, August 16, 2009

An Introduction to the Nguyen-Williamson Hypothesis

I first met him during my first year in college. Then, he appeared to be an unremarkable person with average grades; one would not have noticed him if not for the severe allergy attack that he suffered once during a lecture. Things changed after that.

Nobody really expected Nguyen to ace the exams after that. Thereafter, he continued to attain stellar results for some of the most difficult papers in the college. Some suspected that he had gained "unique abilities" after the allergy attack; others(myself included), dismissing the absurd, believed that he had resorted to some as yet undetected method of cheating.

Being of an inquisitive sort, and having a student registration number that seated me just behind him during examinations, I was equipped with both the intent and opportunity to observe firsthand whether Nguyen had cheated. However, even after a few observations, I had failed to discover any cheating. I did note, however, that he had an unusual habit of consuming a few peanuts during examinations.

Initially, I had thought that it was for some psychological effect, perhaps a reflexive habit to calm himself. My suspicions were raised, however, when an invigilator barred eating from one of the examinations. Interestingly, Nguyen did poorly for that particular examination.

In my mind, I was absolutely certain that the two events were related, that the "peanuts" had something to do with Nguyen's success. But were they peanuts? Perhaps not. Could it have been some advanced psychotropic drug designed to improve brain activity? I had to know.

With the assistance of some perhaps unsavory contacts, I was able to obtain a sample of the "peanuts". I sent the sample for analysis. The results indicated that it was indeed all-natural peanut. I was stumped; clearly the secret to intelligence could not be mere peanuts. There was only one way to know; I confronted Nyugen for the truth.

He was initially unwilling to reveal anything; it was only after I revealed my knowledge of his peanut consumption that he told me anything.

He revealed that during his first allergy attack, he had very vivid and clear recollections of his life. It was the famed flashbacks before death, except that he did not quite die. He then had the brainwave to use his allergy to his advantage. Experimenting with controlled dosages of peanuts (which was his allergy), he was able to discover that consuming a very small number of peanuts induced a minor near-death experience, triggering a flashback of sufficient length to be of use. In this fashion, he was able to emulate a perfect photographic memory.

I did not believe him, and stormed away. But as fate would have it, it was scarcely a few months later that I suffered my own nonfatal allergy attack, except that mine was from seafood rather than peanuts. And, as Nyugen had described, I did have vivid flashbacks of past events.

Having experienced firsthand the truth of his words, I approached him to initiate further research into his promising discovery; this was how the Nyugen-Williamson Hypothesis was first born. Unfortunately, our ideas were initially not well-received by the community. In particular, considerable evidence was put forward against our hypothesis, such as there being no cases of flashbacks for certain classes of near-death experiences, such as car accidents or falling from heights.

Indeed, our own research had also suggested that there were no reported cases of flashbacks for car accidents. Was our proposed model for flashbacks during near-death experiences flawed? It was only later that we discovered, through cunning experiments, that victims of car accidents did indeed experience flashbacks at the point of the accident; however, the subsequent brain damage and trauma hampers recollection of the flashback. It is hence our suspicion that the same mechanism is present for the cases of falling from heights.

Having given a brief introduction to the history of the Nyugen-Williamson Hypothesis, I sincerely hope that the reader as well as future researchers will continue to pursue research into this promising field.

Dr Liebig Williamson

Saturday, August 15, 2009

New Thoughts on Organ Compensation

The idea of organ compensation has been raised in Singapore, and with considerable controversy. While there are many arguments on both sides, my view is that some forms of compensation, such as lifelong medical insurance, may be more morally (and politically) acceptable than other forms of compensation, such as outright monetary reimbursement. But that is not the point of this post, which is to question the basic assumptions of organ compensation.

Setting aside the moral assumptions of the policy (which is the idea of providing appropriate compensation to the donor such that he is not adversely affected by his altruistic act), the core motivation of organ compensation is to increase organ donations. Hence, the key assumption of the organ compensation policy is that by providing adequate compensation to a donor, there may be less hesitance or reluctance for a potential donor to donate his organ.

From an intuitive perspective, this assumption seems sound. After all, before one decides to donate an organ, one must invariably be hesitant due to the great negative impact such an act causes to oneself. Conversely, if one receives sufficient compensation to offset these valid concerns, such as a lifelong medical insurance plan to offset the risks to health caused by the act of donation, one would be more inclined to donate his organ.

The theory does seem intuitive. However, intuition is not always reliable, particularly when money is involved. I've recently read a book on social psychology, in which research notes that money causes people to think in different frames of thought. In particular, consider the example of the Swiss town of Wolfenschiessen, where a nuclear repository was proposed to be built. Then, a poll was conducted to test the receptiveness of the townspeople to the construction of the nuclear repository in their area. 50.9% were willing to accept this, as it was considered a sort of national duty. When a later scheme proposed some monetary compensation for building the repository, contrary to expectations, only 24.6% were willing to accept the building of the nuclear repository.

The example illustrates that contrary to belief, monetary compensation may actually have a negative effect, in that altruistic considerations are unwittingly converted to more monetary considerations. Hence, if not implemented correctly, the organ compensation scheme may backfire and reduce the number of organ donations.

I have previously written on organ transplantation; these articles are linked below. Note that not all views are consistent, some being explorations on the topic.

Goodworks Organ Bank
Organ Trading
Applying the Principle of Desert to Organ Allocation
The Dignity of a Corpse

Sunday, August 09, 2009

On Patriotism

I do not think that watching little tanks and soldiers parade by is a mark of a patriot, nor is saying the pledge in unison a sign of patriotism. To believe so might be a tad superficial, in my opinion.

At the great risk of offending sensibilities, I feel that true patriotism is reflected by the love of a nation, and manifested by a desire to improve the condition of the nation's people. Waving small flags and singing songs does little toward improving our well-being; it might be nationalistic, but it is not patriotic.

Perhaps one does feel some pride welling up in the chest due to being a member of this nation. Perhaps one does think this is a great place to live. But if one does not help improve one's society, to improve the lot of others coexisting in that same society, one is not a patriot.

It is the little things that are the most telling; whenever I see the selfish and self-absorbed refuse to shift further in public buses, whenever I see people littering and bespoiling the streets, whenever I see food and drink being consumed on public transport, whenever I see people conversing loudly on mobile phones in libraries, I reach the undeniable conclusion- that perhaps there are very few patriots indeed.

Friday, July 31, 2009

Free Speech

What is free speech? I suppose some would think that free speech is the right to freely voice our thoughts, to speak our twopence. However, that is not all. We often neglect the second, and more important element, which is the reciprocal duty to have others, even those who hold opinions most contrary and repulsive to that of our own, voice their own views. That is free speech, for there is no right that does not come with a reciprocal duty.

If it were an ideal world, free speech would allow a dialogue between conflicting views, where listeners and debaters alike would calmly and amicably hear the arguments, and by the process of reason, arrive at their conclusions. But it is not an ideal world; it is a world where we often suppress the views of others.

There are occasions where a party seems to hold views so obviously abhorrent and grievously wrong, and yet vehemently continues to air these poisoned views to the public. And sometimes, we rise up and forcefully quieten these parties. Is this right, I would ask. Perhaps we have given in to fear, a fear that the naive or easily impassioned would fall for these venomous words.

If it were a perfect world, our forceful silencing would be immoral and wrong, for we have made meaningful dialogue impossible, hence doing disservice to our own beliefs and views, for those that believe themselves to be in the right ought to have no fear of having their views tested. But it is not a perfect world, nor are we by any means perfect. We are too foolish, and too easily impassioned. Perhaps only by preventing the extreme voice can we maintain our fragile peace. It is a difficult calculation nonetheless.

It is my hope that in the near future, humans might not be as easily deceived, or as easily moved to arms, as we are now. Perhaps then can we all enjoy the rights of free speech without destroying our peace.

Thursday, July 30, 2009

Goodworks Organ Bank

Enter Samuel, a patient dying from kidney disease. Long organ transplant queues and incompatible organ matches have left him in desperate need of an organ transplant, regardless of the means. But he will soon learn that some means are not worth the costs...

A man storms out from a hospital. This is Samuel, who has just been informed that the organ transplant queue has shortened - he now has to wait for only about 2 years. But his doctor also tells him that he has about 3 months to live. Tough luck, the doctor says, but still he has a chance of making it that far, though it is an infinitesimal chance at best.

As Samuel makes his way to his car, a well dressed man approaches him. The man introduces himself as an agent of the Goodworks Organ Bank, a medical organization specially dealing with organ transplants. The agent describes the vast repository of organs the Bank has in its vaults, and claims to have a kidney match for Samuel, and at good rates too. Samuel is doubtful, but the agent reassures Samuel that all the organs are legal and there is documentation to prove their origin and quality.

Samuel, having no alternative, decides to take up the offer. At the Goodworks Organ Bank, a bank officer is sent to deal with Samuel. The officer explains the prevailing interest rates for the kidney. Samuel notes the low cost of the kidney, and signs the contract. But he neglects to examine the contract...

The transplantation operation proceeds successfully. A few months later, Samuel recieves a letter from the Goodworks Organ Bank, requesting payment. Samuel is stymied- he thinks he has fully paid for all the expenses of the operation. Thinking that it is an error on the Bank's part, he ignores the letter.

A few more months pass. Each month, Samuel has been recieving letters from the Goodworks Organ Bank, requesting payment. One day, feeling that something is very wrong, Samuel calls up the Organ Bank regarding the matter. He argues that he has fully paid for all expenses, and that he has the neccessary transactional documents to prove it. The bank officer only agrees cryptically that he is right, that the cash expenses have been paid...

More months pass. One day, when Samuel is leaving for work, a van painted with "Goodworks Debt Recollection Services" on its side pulls up on the driveway. A few men then proceed to knock Samuel out and drag him into the van. When he awakes, Samuel finds himself strapped to an operating table. Samuel recognizes the doctor as a member of the Goodworks Organ Bank, and screams for an explanation. The doctor replies that Samuel has borrowed an organ from the Bank, and has yet to service that debt. Hence, the Bank is forcefully recollecting that initial loan, plus interest...

Singapore Addresses Format

I was always confounded by the format of Singapore addresses. For the uninitiated, the format is as such:
Block Number Road Name
Apartment Number
Postal Code
What I don't get is how it is ordered, i.e., the endian-ness. If I had a say I would have ordered it with the major address elements first, like the road name, followed by the block number then the apartment number. It only makes sense; it mimics how humans find their way around. One doesn't try to find the apartment block without knowing which bloody road it is located!

Sunday, July 26, 2009

Heaven and Hell

If one must either go to heaven or hell upon dying, and if heaven and hell are infinitely good and bad, then some conclusions are inevitable.

Firstly, if one is absolutely sure that one would go to heaven, for instance being guaranteed entry by merely worshiping a particular deity or denomination, then the conclusion is that one should die now. Being on earth is clearly worse than being in heaven.

Secondly, a person intent on doing good would go around slaughtering people. The rationale is that everything will be sorted out by divine entities; the good would gain earlier entry into heaven, while the evil would be banished earlier to hell. Either case, good is done. A valid argument.

Beware of people who ask, "Do you believe that heaven is infinitely good, and hell infinitely bad?"

Tuesday, July 21, 2009

My Two Noses

One day I woke up with two noses. It was very queer, for I distinctly recalled going to bed with only one nose the previous night.

I studied myself in the mirror. My two noses were positioned on both cheeks of my face, symmetric. It then struck me- which was the new nose, and which was the original? Or, for that matter, was it possible that neither was the original, both having spawned during the night, with my first nose being whisked away to somewhere. I was unable to decide on which was the truth, since I did not recall any peculiarities about my first nose. Perhaps all noses were swapped and replaced in the night, and we were all unaware of this because we did not study our noses with enough intensity.

It was with some reluctance that I decided to venture outside with my strange affliction. And indeed, my noses brought me much anguish and embarrassment. If only I could describe in entirety the variety of dirty looks that I received! And sometimes the cruelest of jokes were brought to bear- "My friend has two noses. How does he smell? Bad!"

Gradually, though, I got used to having two noses, and I suppose the novelty of the sight wore off. I eventually came to realize that having two noses did come with some benefits otherwise denied to ordinary people. Some people believe that having twice the number of noses merely increases your olfactory senses; a matter of degree. They could not be further from the truth. Rather than just having an enhanced sense of smell, my olfactory abilities were of a superior nature and capability. Just as having a pair of ears grants binaural hearing, having a pair of noses enabled me to accurately locate the direction and distance of a smell. It was an interesting ability to employ, though not always of extreme practical use.

Socially, I did have to make some adjustments. It is always awkward to know who farted in the lift, or of the true source of pungent odors. However, once people became aware of my olfactorial-location abilities, personal hygiene seemed to increase. Not a bad outcome for the strange event of having two noses, if I might add.

Sunday, July 19, 2009

Factors for Success

I've often thought about what personal factors contribute to success. To clarify, I'm not talking about the big SUCCESS, but a smaller success at any tasks that one may face. After a long period of consideration, I arrived at a set of three factors which I hold to be quite important to attaining any type of success.

The first factor is perhaps the most obvious, talent. This needs little explanation; there are always those who are born more athletic, or intelligent, or just so particularly well suited to some peculiar task. Talent offers greatest advantages, but it is the greatest tragedy that talent cannot be acquired.

For the rest of us, we most often rely on the next factor for success- effort and hard work. For almost every task, continual effort put in towards improving one's ability would eventually yield some success. True, it may require vastly more time and energy than one born with some talent, but success attained in this fashion will be more respected and admired.

Everyone knows about talent and effort; it is indeed true that they are very important. However, much fewer know about the last factor for success- method. What is method, one might ask. Method is the most efficient and most tailored way of performing a task. Method makes the difficult task easier; it uses your strengths and avoids your weaknesses. Some use their wits to derive method; others just chance upon it. But method is important, nonetheless. We often see people putting in hard work almost fruitlessly, because they have chosen an incorrect place or way to apply effort. Conversely, we sometimes see the obviously talented being defeated by the ordinary man who adopts some queer approach the same problem. Method is about taking the smartest shortcuts to success.

Now, I present these three factors in an illustration, in the form of a triangle.
A Superb Illustration !Now, having just one of these factors is often enough to guarantee some measure of success; it is enough to deny that one is an absolute wastrel or imbecile. Having two is possibly enough to attain distinction; but still, without talent, one will always lack the spark to attain true greatness; without effort, one will not be held with true admiration as someone doing full justice to his abilities; without method, one will always be frustrated with the lack of greater achievements despite having both talent and putting in great effort.

To attain the pinnacle of success requires all three. Talent is the spark, the initial anointment to the path towards the final goal. Effort is the driver, the force that makes progress on the road to success. Lastly, method is the skilled navigator that selects the paved road, the fastest route, such that the greatest and farthest distance can be traveled. Only with all three can the greatest that man can achieve be revealed.

Saturday, July 11, 2009

Estimating NUS EE Statistics II

Since my last post I did a more accurate count on the actual numbers, and the result is sufficiently different for me to revise my previous statistics.

The actual data is:
12.7% - First
28.9% - Second Upper
28.6% - Second Lower
10.7% - Third
19.1% - Pass

Using this new data and the previously described method, the new statistics are:
µ = 3.812
σ = 0.611

This puts me at about the 80th percentile of EE graduates in this cohort. The new data also portrays the Second Lower degree a lot better than previously suggested, though it still means that a person with a Second Lower is likelier to be below average than above average.

Note that however the normal distribution is less good fit with this new data. A better statistical fit may need to be found.

Estimating NUS EE Statistics

The NUS commencement booklet has much data, including the names and honors classification of each graduate in the cohort. Privacy issues aside, this vast amount of data can be put to some use.

Doing a very rough count of the number of graduating EE students in each honors class, I found the following numbers: 15% First, 30% Second Upper, 30% Second Lower, 10% Third, 15% Pass. Coupled with the additional knowledge of the CAP requirement to obtain these honors classifications, I was able to obtain an estimate of the statistics of the NUS EE cohort.

First, I assumed a normal fit for the CAP distribution. Combining this with the known honors distribution, I was able to obtain a series of equations, like 0.15 = P(X > 4.5) , which represents the First Class degrees. These equations are made normal by assuming two parameters, µ and σ.

Of course, the linear system yields no solution. Hence, it is necessary to find the best fit for the linear system, such as via linear least squares. I used an applet for this task, arriving at the values of µ=3.884 and σ=0.626. In other words, the mean CAP for an ECE graduate is 3.884 while the std. dev is 0.626.

Now, all this seems pretty useless, with one exception. Using the normal statistics, I was able to compute the percentile that I was at, given the knowledge of my CAP at graduation. This should be a computation that anyone with a basic knowledge of statistics can perform.

Friday, July 10, 2009

Google OS ?

Google is developing a new OS for netbooks. The OS seems to be an extension of Google's Chrome browser. Being an owner of a netbook myself, I think that this idea is pretty great.

When I use my netbook, the primary function is to surf the net. Now, nothing major is lost if the core functionality of the OS is centered mainly on the browser. On the contrary, if one trims the superfluous elements of an OS , one might be better off; faster boot times (an instant-on, if possible), better battery life, a more net-centric user experience. It's a great idea.

Truth to be told, the browser, coupled with the power of the internet, can be said to duplicate many of the most-used functions of a netbook. Music? Just upload your entire song library online and stream. Games? Flash-based games come to mind. Internet messenging? Web-based interfaces exist; it is not difficult to integrate this function into the browser too.

One major omission is noted; that of productivity software, though it may turn out to be a moot point. Word processing is a function that is most essential, but it also the easiest to duplicate on a browser; even as I type this post on Blogger, I can't help but note that the Blogger interface allows for a good number of features found on word processors. Presentation software may be a bigger hurdle to overcome.

Of course, one can't realistically imagine the new Google OS to be entirely internet based. However, I can imagine various add-ons, downloadable from the internet, to fill in the gap. One of the greatest boons of Firefox is the ability to add almost any functionality via add-ons; we can only imagine the same with any future Google OS.

Monday, July 06, 2009

A Universe in a Grain of Sand

I am extremely fond of the first few lines of William Blake's poem "Auguries of Innocence". It goes like this:
To see a world in a grain of sand
And a heaven in a wild flower,
Hold infinity in the palm of your hand
And eternity in an hour.
I find it extremely descriptive of my personal philosophy.

There are multitudes of people who wish to explore new places, to acquire new experiences, and to taste new adventures. In that mad pursuit of adventure, they go farther and further, ever more reckless and bold. And yet, I find that that approach is ultimately hollow and devoid of meaning. They may seek, but they will not find, for they will never stop to see the world in a grain of sand.

It may be true that they have experienced more, but the use of the exterior function is useless and irrelevant. Many things have access to the exterior function, to experience. A dog sticking its head out of a car window, tongue waggling, can be said to be indulging in a degree of experiences far more detailed than that of a human. I contend that it is pointless, for it is only the interior function, that of thought, that is important.

One does not need to journey to distant places, to tour unfamiliar worlds, to taste the novel game, to claim to have a broadened mind. A cripple, even if confined to within the recesses of a prison cell, is by far superior if he has subscribed to a regiment of introspective reflection.

Tuesday, June 30, 2009

An Unmarked Game

Assume you are playing a new game in a foreign language. Now, there are many actions you can do in the game, but since the instructions are all in weird runes you can't really know the effect of each action. All you know is this- some actions reduce your score, and some actions increase your score. There are a few other people playing the game, but none save the host seem to be able to read the language. The host seems very disinterested in teaching everyone the game, and just murmurs a few words here and there when "explaining" what some actions do.

Under such circumstances, what action would be the most optimal? It might be entirely valid to act according to your interpretation of the host's crappy instructions. Alternatively, you could follow the crowd, and adopt the set of actions that everyone seems to play; surely that would be a safe move, to adopt the wisdom of the crowd? Or, in the absence of any real information, and knowing the possibility of negative scoring actions, would the best move be to not play any actions?

What a pointless game, you might think. But is it really so? I sometimes think that morality and ethics is such a game. It is clear that not everyone agrees on what is the most moral or ethical. Right and wrong are often argued about, sometimes with little agreement.

Should one act upon one's convictions, to trust one's moral compass, regardless of what others think is right? Is this not unlike the first strategy in the hypothetical game earlier, relying on one's understanding and interpretation which too can be flawed?

Or, would it be wiser to act according to the norms of the day? People ought to know better, but is that not a problematic assumption? It has led to startling travesties in history- at least, judged from our own dubious perspective.

Now, if one admits to knowing nothing, then perhaps one might choose to do nothing. Though nothing good is done, but hopefully nothing bad is committed. At least, if one does ignores the "if good men do nothing" idea.

My thoughts are that the first type of people would either commit great good, or great evil (if the problem of judging morality was to be sidestepped). The second seems to be a lazy and irresponsible approach, though it is also most often irreproachable. The final type seems to be overly passive, but I am attracted to its agnostic and neural nature.

Of course, if the unmarked game were to occur for real, a wise crowd would evict the host, and agree on a best way to understand, interpret, and play the game, to hell with the original rules which might never be known or revealed.

Friday, June 26, 2009

Only 15¢ an Item !

While I was borrowing a book at the lending machine in the local library, I spied a poster on the wall. I studied it for a while, all the time thinking "Something's not right!". I reproduce the poster in the following image, also available at their website.

Now, I must admit that I'm not an authority on advanced mathematics, but I can't quite figure out how the sum of 15¢ an item was arrived at. If we were to divide the sum of $42.00 by $0.15, we would get 280 items, which is clearly not the borrowing limit. Even after including the loan duration, it seems impossible to arrive at 15¢. I would challenge the reader to solve this most amazing problem.

In any case, my opinion on the premium membership is that it is mostly a waste of money. The increased borrowing limit is largely moot, being merely a convenience- remember the situation of a small cup vs a large cup when both have unlimited refills. Perhaps the only justifying point is the ability to borrow audio-visual materials, but at $42 much use would have to be made of it.

Wednesday, June 24, 2009

A Prototype Sketch

Sketch is set in the modern era. Two men are seen talking.

A: I haven't seen you around lately.

B: Well I've been busy.

A: Doing what?

B: Having sex!

A: Having SEX?

B: Yes, having sex, and in case you're wondering, on a regular basis with a member of the opposite sex. I've discovered a method which enables me to have sex on a regular basis.

A: What! How are you doing it? Is it prostitution? Are you paying money for sex?

B: Well, yes and no. The method is simple, really; I provide food and shelter while the woman provides sex.

A: What! That sounds just like prostitution, except that there's a meal plan thrown into the job entitlements package.

B: No, no, no! The woman also does some menial household chores; it's less of prostitution than general indentureship with a specific clause for coital services.

A: It sounds expensive-

B: No, not really. I'm getting it all in a package-deal sort of thing so it works out cheaper than if I hired a sexual worker every other day. It's quite a steal actually.

A: Hmm, if you're getting a good deal, then someone must be being ripped off somewhere. Clearly any sane woman with any mathematical inclination can see that it is vastly more profitable to leave things to the open market than to adopt this contract.

B: It's not all peaches on my side too. You see, the contract is lifetime-binding; I'll have to provide her upkeep for the rest of my or her life, so at some point this contract becomes more of a liability than a bargain. But I'm getting my lawyer to go through it for any loopholes so that I can divorce myself of any consequences when the time comes.

A: Well, hopefully you succeed. It does sound like a good idea. Any plans to patent the idea and to market it?

B: Of course I have a mind to make some cash off this. I've even been thinking of a name for it- the name's meaningless now, but hopefully when more people know about it it will gain an essence of its own. I call it - Marriage.

This sketch is still vastly rough; I'll have to polish it up, maybe add a few twists. There are still some directions that I want to go with it. In the meantime, feel free to add any comments on the sketch.

Sunday, June 21, 2009

Sharing Communities and Upload Ratio

Bittorent file sharing communities are set up such that files can be shared more efficiently ; selfish agents that download but do not upload can be detected by their poor upload ratio and banned from the community.

It becomes absurd, however, when the minimum sharing ratio is set to a figure greater than 1. Since each uploaded byte must correspond to a downloaded byte, if someone has upload ratio greater than 1, then someone must have downloaded more than uploaded. If an altruist is defined as being an agent with a sharing ratio of greater than 1, then it is clear that any closed community of agents cannot be solely comprised of altruists.

If however the sharing rule is temporarily waived for new agents, say for the first week, then it is possible for everyone to be altruistic, barring new agents. However, this requires a continuous stream of new agents joining the community, which is unfeasible in the extreme run.

Sunday, June 14, 2009

Pornographic Classifier

According to a BBC article, China's new "Green Dam Youth Escort" software, intended to serve as a filter for offensive material (such as pornography), has some classification errors. In particular, it was reported that
I went on the internet to check out some animal photos. A lovely little naked pig was sent onto the black list. Pitiful little pig!," read one comment.

"I was curious, so I looked up some photos of naked African women. Oh, they were not censored!

which is amusing to say the least.

The comments do suggest that a key component of their pornographic classifier involves color, specifically the proportion of skin-colored pixels, though this approach apparently has its weaknesses.

Having some experience with image processing as well as classification, there are a few other possible approaches to constructing a pornographic classifier. Rather than using only color information, it might be advisable to perform object recognition to search for a few key areas of interest, i.e. exposed private parts. A combination of shape (since the outlines of some private parts are considerably unique) and color information should be able to identify these body areas with some effectiveness; alternatively, standard object recognition techniques can be used, though these may be more suitable for the specific rather than the general.

Another approach (which is simpler and less accurate) may be to use the color information to generate an outline of the human frame (by segmentation), and to then see how many colors are contained in the frame. The theory is that many colors indicates the presence of clothes; the advantage is that one is unconcerned with the actual skin color itself. Of course, the issue is that whether the segmented region is human- this in itself is a worthy sub-problem, though one workaround is to identify a head region, and if there is none it is not a human.

Generally, though, the problem of creating a classifier to identify pornographic images is considerably difficult. The above ideas may be suitable for images with only one human subject, but the classification task can be made much more difficult by other complications. Such complications include multiple subjects and non-realistic images (i.e. computer generated images or drawings). In fact, circumventing such pornographic classifiers may be extremely simple indeed.

Saturday, June 06, 2009

Sunset Showers

I like taking showers before sunset, though explaining why requires a bit of a long tale.

My electric water heater has 4 settings, low, medium, high, and off, and as it often is with factory settings, my preferred setting lies somewhere in between the factory ones. In this case, the low setting gives water that is just a bit cooler than I'll like, while the medium setting is warm but the higher temperature tends to dehydrate the skin. The best things are always in between.

Now, here's the part about the sunset showers. As it is, I live in a high rise apartment, and at a level that is almost near the top floor. For all high rise apartments, water from the piped supply will be pumped and stored in a water tank at the rooftop. This water will subsequently rerouted to the apartments by gravity.

By coincidence, I learnt that the sun has a great effect on the temperature of the water in the tank; in effect, the water tank is acting as a solar tank, albeit one that only raises the water temperature by a few degrees. And fortuitously, the extra few degrees bumps the water temperature (with the electric heater set to low) to my optimal comfort zone.

Thinking back, this was not the first time I've encountered this solar heating effect. A few years back, when I was still an army recruit serving BMT (basic military training), I found that if I managed to rush into the showers first when the sun was still up, the water would be reasonably warm (or at least, not unheated, as it would have been otherwise). Of course, there weren't many opportunities to capitalize on the knowledge, for training usually ending in the late evenings.

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.

Thursday, April 30, 2009


I’m not really old, but I think that as you age, your memories of people fade. Once-friends become familiar-strangers illuminated by the sole few events that still cling precariously to your memory. In way, it might be regrettable, but somehow time has this effect on almost everything.

Not too long ago, while I was out shopping for a few business shirts for some job interviews, someone walked up to me and said hello. Jerked out from of my own lines of consciousness, I staggered for a moment before finally recalling that that someone was an old classmate from my secondary school. For a half-second, I kicked myself for being too caught up in my thoughts and not noticing him when he was right in front of me. This kind of thing happens often, you know, and I’ll guess that it has something to do with how much the person is in your consciousness as well. In this case, I haven’t seen him for many years now. I greeted him as well, and we exchanged some how-are-you-doings and well-that’s-good-to-hears before running out of things to say. I couldn’t remember any common memory that could be used to further the conversation, and neither could he, and so we stood there for an awkward spilt second before he excused himself with a hey-I’ve-something-on-see-you-some-other-time.

I’ve heard a half-dubious theory on human memory which stated that even if you couldn’t recall something immediately, the subconscious mind continues to work on the task. Regardless of the veracity of the theory, I did manage to remember more about my classmates a few days after the encounter. I was reading the newspaper while eating some instant noodles, two activities which were absolutely unrelated and unconducive to the task of recalling, but the next moment everything was clear and obvious.

He was only in the school for about a year; his father had been posted to an important (and probably long-term) position overseas, and he had to move overseas after the first year. I think he had known about the posting since his entry to the school, and hence was more or less reluctant to spend too much effort at socializing and making friends. It might be for this reason that I did not recall very much more about him. In fact, I could only recall two particular events that sort of crystallized my memory of him.

Though we did not take the same way in getting to school, there was some overlap in our routes. Now, our routes intersected at a narrow one-way road that we had to cross to get to school; the road was only used by vehicles going to the school, and hence was rarely used. There was a diminutive traffic light and painted crossing halfway along the road, but in all seriousness nobody really followed the traffic light. Everyone, student or staff, just checked the road and crossed. The traffic light was quite pointless, really, since there was no danger of getting into an accident; it was impossible to not notice any rare vehicles that come down the road.

Hence, I found it amusing when I observed that he, for some reason obscure to me, consistently used the traffic crossing, even in the heat of the midday sun, even when it was drizzling, even when it everyone just passed him and crossed the road. It was something I could not fathom. I wanted to ask him for the reason, but I never got the chance to raise the question before he left the school.

The second incident I recalled was the storytelling contest sometime in the middle of the first school year. Some teacher had come up with this bad, facepalm worthy idea, and everyone was clearly disinterested, but every class had to come up with at least one participant. Though he had kept a low profile in the class, the “honor” of participating in the contest, determined by a cycle of nominees nominating the next person, somehow fell to him. He did not reject the nomination when it fell to him, so it was somewhat surprising.

When the contest came about, there were only ten participants (rightly corresponding to the nine classes of the level and one enthusiastic participant, though there must have been one class with two enthusiasts, since no sane person would participate when there was already one willing volunteer). In any case, I could only remember the story he told, which was a Japanese story, Shibahama. I had no idea he chose the story, but the oddness was perhaps the reason for recalling it so well.

The story was about a lazy fishmonger who drank all day and neglected his work. One day, the fishmonger picked up a purse with a huge sum of money. To celebrate his find, he immediately bought some wine, and drank himself to sleep. Upon waking the next morning, he discovered that the purse was gone! He asked his wife whether she had seen the purse, but she admonished him for drinking everyday and dreaming of nonsense. After searching the house and indeed finding no trace of there ever having been a purse, the fishmonger believed that his wife was telling the truth, and was so ashamed of his poor conduct that he resolved to change his behavior and to give up drinking.

Three years later, a clerk from the government came to the fishmonger’s now well-thriving shop, and informed him that the purse had been unclaimed during the entire period and hence now belonged to him, the finder. The fishmonger’s wife revealed that three years ago, she had lied and reported the lost purse to the government office. Now that everything turned out well, and that the fishmonger had changed his ways, perhaps it would be good to celebrate over some wine, she said. To her surprise, the fishmonger declined, saying that drinking caused him to wake up empty-handed from a beautiful dream three years ago; he would hate for things to lose the beautiful dream now.

Now, his story didn’t win the storytelling contest, but it appeared to be well-received. However, I was not especially fond of the story; it seemed to more of a moralizing tale rather than a believable or realistic story. In particular, I thought that the fishmonger’s redeeming change was too sudden, and motivated by too little, to be credible. That was what I thought then, anyway.

A few days ago, I suddenly recalled the story of Shibahama. I had finished writing the final few sentences on what was to be the final paper of my undergraduate days, and was idling flipping through the pages of the examination booklet. In other situations, I might have checked some of my answers, or expanded the answers to some questions, but somehow, I had no desire to do all these now. Instead, my mind wandered to random things, until the bell rang.

When the examination was over, I walked home slowly. As I walked home, the inevitable truth which I had known all along was no longer deniable. An illusory dream had ended, now replaced by the reality of the working world.

Wednesday, March 04, 2009

Birthday Story

I sometimes think that the best stories are those left to the readers' imaginations. Consider one of my favorite short stories, written by Ernest Hemingway :
For Sale: Baby shoes, never worn
And that's it. That's the entire (written) story. For such a short piece, the number of questions it brings into mind, and the number of possible interpretations, are astounding. A comedic understanding would be that the clumsy father bought shoes of the wrong size, and realized it too late for returns to be made. But, as a person with more of a taste for the tragic, I would read it as being some terrible tragedy- perhaps a fatal accident before the full term, for instance.

The story I'm going to tell next is also one which lends itself to interpretation. I won't claim that what I'm telling is what exactly transpired, since I never really got to know the complete details, but as things go, my interpretation incorporates all the facts I know. So, from my point of view, it's pretty valid, but if you have any alternative readings, be sure to share.

This happened about six months after I moved into my new home, which was sited close to the university at which I was lecturing. After getting to know the neighborhood, which had the cozy university town feel to it, I started frequenting, on weekday evenings, a small cafe near my home. The cafe was owned and run by Karen, a charming and witty lady just pushing into her mid-thirties. She would often tell amusing anecdotes about her previous customers, and that, along with the delicious chocolate cakes which were never too sweet nor horrendously bitter, convinced me to become a regular at that cafe.

My schedule usually involved getting a slice of cake along with some warm peppermint tea, and then slowing consuming the two items over the dailies or a book. If my eyes happened to be strained due to overuse at work, I would probably strike a conversation with Karen or some of the other regulars at the cafe. There was almost always an interesting story to pass around.

It was one of those eyestrained days when this story happened. I was halfway through the newspaper when I decided that the sharp pain around my temples was too much for me to bear any more reading for the day. Cake and tea weren't the best foods for a eyestrain induced headache, so I was prepared to leave, if it weren't for the heavy downpour. Resigned, I slumped back into the chair, and rested my eyes.

It was in that moment of bored contemplation that I was suddenly aware of the somber quietness. To be sure, the cafe never had the rowdy atmosphere of bars or pubs, but the background would always be filled with some level of chatter and conversation coming from the cafe regulars and their life stories. But now, there was only a soft silence amidst the sound of rainfall outside the cafe. Queer, but welcome nonetheless, for noise did nothing to sooth headaches. I did start feeling better shortly after.

Though my headache had dissipated somewhat, the rain had not stopped. Feeling that this might take a while, and with nothing else to occupy my time, I did a lazy scan of the cafe. It was then that I noticed something strange.

There was a young man sitting alone in the corner of the cafe. That in itself was queer, for the corner seats were usually occupied by privacy seeking college couples from the nearby university. But the man did not appear to be a student- judging from his appearance, he should be in his late twenties, and ought to have graduated some years back.

My interest somewhat stroked, I continued to study this odd person. Perhaps I had caught the wrong idea at the wrong instant, and perhaps he was just a random passerby who was unaware of the connotations of the corner seats. Maybe he was an out-of-towner that happened to be caught in the rain, and sought some refuge here, taking dinner at the same time. Maybe, there- hmm, no, the last theory didn't make sense, I realized.

The man was not having dinner, not unless you would consider a cake dinner. It was no normal cake either, but a birthday cake as indicated by the candles topping the cake. And, if I was not mistaken, one made in this cafe, which was pretty rare, since you would need a special request before Karen would make one.

If my eyesight did not fail me, there were three candles on the cake, 2 large, 1 small. Queer.

And there were two small plates on the table, each with a slice of the cake. One from which the man was eating from, and one with its own spoon, totally untouched.

Perhaps there was another person due, perhaps delayed by the sudden and heavy rain. This would help explain the other slice of cake, and also possibly, if I were forced to make a judgment, the aura of moodiness from the man.

Some time passed, and the rain stopped. The candles on the cake melted. The man got up, made his payment, and left the cafe, the single slice of cake virgin, untouched.

There was nothing left to do, and with the rain gone, it seemed a good time for me to leave too. I got up and slowly made my way over to the counter. Karen was just cleaning up after the cake-man, bringing the uneaten cake, save for two slices, back to the kitchen area for disposal. When Karen passed by me on the way to the kitchen, I managed to catch a glimpse of the cake.

"Sweet 21, Selene"

When Karen returned, I popped the question, "Who's Selene?" Seemingly taken aback by my question, it took a long moment for her to weigh an answer. Finally, she merely pointed to one of the photographs plastered on the wall behind the counter. This was the kind of picture wall where everyone puts a happy picture, and promptly forgets about and ignores. I myself had not paid much notice to the wall of pictures before.

There was a particular photograph on the wall, a bunch of people celebrating a birthday at the cafe. The man from earlier on was there too- or should I say, a younger and possibly less unhappy version of the man, five or six years removed. There were some other girls in the photograph, but I would guess that Selene was the one in the center- the birthday girl. Bright eyes, an incandescent smile, a sweet-seeming girl. Perfectly happy and innocent.

The time stamp on the photograph was today's date, five years ago.

I felt an uneasy tingle in my gut. Hesitantly, I asked, "Did something happen? Perhaps like five years ago?"

Karen only gave a slight nod, before retreating to some other part of the cafe.

It was a terrible story, one so terrible that I had hoped that someone would jump right up and shout, "AHA, fooled you didn't I?" But there was no such declaration, it was real.

Was there some tragedy? I don't know for sure. And I asked myself, would fate be so cruel as to allow some sort of tragic event to occur on one's 21st birthday? There was no reason, I would have thought. But then, what if cause and effect were reversed, and that one's 21st birthday was the cause? An intense celebration, a few loose drinks... Not so difficult to believe, then. But it makes the entire affair take on an entirely regrettable feel, even moreso than before.

And that is my version of the most terrible birthday story I know.