## Facebook hacker cup: Power Overwhelming

You are to inflict maximum damage to the zerg army. There are two types of units - Warrior and Shield. Warriors do damage every second, while a shield protects your entire army for one second.…

## Gotcha with fitness function design

Typically, a genetic algorithm works by the notion of maximizing the fitness. Consider a function $$y = x$$, which is to be minimized in the interval $$[-5, 5]$$. One approach is use $$\frac{1}{x}$$ as…

## Facebook hacker cup: Geometric approach to double squares problem

Given an integer $$N$$, we need to find the number of integral pairs $$(x, y) \mid x^2 + y^2 = N$$, $$N \in [0, 2147483647]$$, with a maximum of 100 such numbers in a file.…

## Kleiber's Law

Last week, I happened to read about Kleiber’s law while browsing through literature on natural evolution. The implications are really fascinating. It establishes a relationship between mass and metabolism as: \(metabolism = mass^{\frac{…

## Predicting hand position on the keyboard by observing random text

Today, I happened to type some random text and noticed interesting. This is a random sample of what i typed: gh jgh jg hjg hjg hjg hjg hjg hkg hjg hg jg hjg hjg hg…