web 2.0

Parameter Optimizer - It is Alive!

Before I tell you more about this program, let’s rewind back to the beginning of it. When I was a small curious boy, I would walk up to many people and ask them questions every day. “Pa, what created human?” He never answered it. I think he wasn’t religious enough to believe that God did it.  “Mom, did God create human?” I asked. “Yes, son. Buddha created this world and human. Now go play outside. Mom is busy.” It didn’t surprise me a bit, as most people had given me the same answers. “But then who created God?” Some replied he created himself. My cousin a few months older than me said “you silly, another God created him.” My grandma gave it her best shot: “Gods live eternally. They always exist before and after.” So by then I just didn’t know who to believe. All the answers only led to more questions. I was kind of waiting for someone to give me one ultimate answer. It hasn’t happened.

In grade twelve, I was introduced to the Darwin’s Theory of Evolution, that it could answer some of those questions, not entirely, but rationally better and with mathematics and fossils to back it up. From some molecules evolving to a single-cell bacterium, from some bacteria evolving to a complex organism, from ape to human, evolutionary process is the self-inducing force behind it all. Now I personally believe that evolution plays a vital role in making everything as we know it—maybe I’m right or maybe I’m wrong but I’m now more satisfied more than ever.

So powerful it is, yet the law behind Evolution is simple: Only the fittest survives and dominates, and they then breed and create better offspring. That’s simple right? In other words, a smarter, stronger person will beat the stupid, weaker one and gets the girl. No doubt about that. After he gets the girl, they *bleep* and give birth to some children. And the process repeats. If my children are better than yours, mines will get the girls, the scholarships, the pay rises, the promotions, etc. Yeah, the fittest survives again. In the wild, the work of evolution is no different. Bigger lions kill the smaller lions to get the females, territories and foods. In stock or forex trading, it is also no different. The more experienced trader wins the money that the less experienced loses. Evolution works the same way everywhere. In a nutshell, evolution is just a way of the nature, but it somehow forces something to be better, or else suffer.

Anyway, this software I created is for solving optimization problems quickly and painlessly. To optimize something, you want find the best inputs that produces the best output. It’s the same way a cook finds the scale of ingredients to make the most delicious disc. Typically, a person finds it by trials and errors. You cook it too sweet this time. You’ll decrease the sugar next times until it tastes just right. But if you’re a math genius, you’ll go through all the wacko numbers, integral, derivation, graphs and then come up with the best inputs—e.g. x = 1.56 gram and y = 40 gram. If you’re an analyst, you’ll create some scenarios and pick the best one. But if you’re a lazy software programmer as I am, you’ll resort to creating a software program that does the jobs for you. Right! Like this software program of mine for solving optimization problems quickly, painlessly and almost automatically.

There are many ways to create such software, just pick an optimization algorithm from the many existing ones and write it in code. Ant colony algorithm, for example, simulates some ants finding the nearest route to the food; hence the best input to result in best output. Simulated annealing algorithm uses the analogy of the cooling of metal to find best inputs. But what took my breath away was the ‘Genetic Algorithm’ which simulates the evolution of genes. Gene evolution take years and generations to see small changes. With today’s computing power, however, you can fast forward the process to just a matter of days or minutes depending on the difficulty of problem, the number of variables and the amount of data. By simulating gene evolution, my program has the very same power to filter out bad inputs (as artificial genes), and breed more of the best inputs at the same time. 'Parameter Optimizer', the software I created as my first shot, is literally breeding digital data. The offspring are better digital data. Scary or funny? You tell me. Although Parameter Optimizer lacks many features of a good optimizer, it can solve some basic problems like the following one. I hope I can find time to create an advanced optimizer and publish it.

Optimization Problem: There are 50 grape vine trees in a vineyard. Each tree produces 8,000 grapes. For each additional grape vine tree planted in the vineyard, the output per tree drops by 1 grape. How many trees should be added to the existing vineyard in order to maximize the total output of grapes?

Answer: If you want to go ahead solving this problem, then don't peek the answer before you do. To solve the problem, I simply write the equation: total output of grapes = 50 * (8000 - x0) + x0 * (8000 - x0), where x0 is the number of additional grape vine trees to be planted. I use the default settings of Genetic Algorithm. Now I simply click "Start" and the program finds the best answer in 10 seconds. It says I should plant about 3,975 additional grape vine trees, and then the vineyard will produce about 16,200,625 grapes which is the maximum. No college math needed. Now how cool is that?!

 

Tags: , ,

Artificial Intelligence | My Software

BitFolding: Mysteries of The Ultimate Data Compressor

Late in a cold dark night, in front of a small computer screen lies this human figure, meddling with his new piece of software he has just created. His wife is asleep soundly in a soft bed nearby. He would love to turn on the lamp to brighten the darken room but he loves not to arouse a sleeping beauty more. The brightness of the computer screen is high enough to allow one to notice a strange computer program running but low enough not to wake her up. The software looks not any extraordinary than any other software, yet the concept behind it is out of this world. He formulates the secret recipe of data folding onto itself recursively. Maybe for the first time in history, it has folded a megabyte file into a mere ten-kilobyte. A large file has shrunk into a tiny file, a hundred times smaller. This is the world's first that such an amazing feat has been achieved.

From this small bedroom he calls home office, he carefully analyzes the results. The small file is successfully unfolded back into the large original file with every byte and bit fully intact. So exciting he is, for he has invented the ultimate data compression software. Such software could fetch him millions just by selling the license to some large corporations. He would buy himself, his wife and family a big house maybe on his private, heaven island. It is the last promise out of many broken ones he could keep for his girl and his family. The clock hanging low on the white-painted wall has just hit twelve midnight, somehow reminding him not to daydream while daylight was at the other side of the world. Tonight finally he gets the sweetest, good-night sleep he has ever had in his life.

The sun is now up near the horizon, casting its warm orange light into the two-doored bedroom through the open window. One door leads to the outside world; the other leads to nowhere but the lone living room of his small apartment that he rents. Dara is already awake by his bed. He would quickly jump to his workstation but today the electricity is out cold. "Maybe I forgot to pay the bill, or maybe the city is just too poor to afford electricity around the clock," he murmurs to himself. His first love is now too wide awake. Fleur-de-Lys would usually cry for him even before her eyes are fully open, for she loves to have her hubby by her side when she wakes up. Spiritually lonely she has gone through before she met Dara. With cool gentle morning breeze touching their bodies, they hug like it was the first time. "Honey, what would you do if you had one million dollar?" he whispered in a low voice. This is possibly the millionth time he asks the question that Lys has grown tired to answer. They kiss on cheeks and off they go, to their workplace five kilometers away.

It is now twelve post meridiem, a perfect time for daydreaming. Back home they are and soaked wet by the rain while traveling home on this old red second-handed motorbike imported from Korea. The two-hundred-volt electricity is back online. No wonder the city has to cut it for some hours to save the petroleum consumed by those huge generators. After all, they live in one of the poorest countries in the world. Without hesitation Dara boots up old Lucy his lone personal computer. The Pentium III central processor running at six-hundred megahertz takes her forever to boot up.

"An internet service provider could use such software to significantly reduce the traffic," he ponders about the applications of such software while Lucy's black screen is prompting same ol' jumble commands and her storage belly screaming loud. He does not need a calculator to compute how much companies would save on data storage and traffic by his software. It could save them about ninety nine percent. "Right! They could lower the price of a one-hundred-dollar internet connection to merely one dollar. Nice!"

Now that Lucy has completely booted up, he still in disbelief continues to analyze the results and double checks his new software. Apparently, it ceases to work all of a sudden. It is as if somebody sneaked in and changed the algorithm code last night while everybody was asleep. That is not the case because it is exactly the same code, same algorithm; nothing has changed. "Maybe I'm changing the variables. Maybe I accidentally did something unplanned for and now I forgot it. That can't be right!" he thought. "Or maybe, just maybe, it did work but in a dream which I don't recall having."

It wasn't long that he has listed down all possible culprits. He slowly rules them out one by one until none left. "The file did successfully decompress, and it is here in this folder as a hard proof, or maybe, just maybe, I accidentally copied it here." He was kind of confused. It is like a train has collapsed and then its track mysteriously disappeared. Maybe it was off the track for too long before it collapsed far away from its track. He will never know. He codes everything from scratch if it were for some kind of bugs. Nothing works. All that remains is the memory of an unsolved mystery.

 

Tags: ,

My Software

A Blazingly Fast CSV Splitter

It is possibly the world's most popular CSV Splitter. My CSV Splitter ranks #1 among 920,000 results in Google, Yahoo and other search engines for the search term "CSV splitter". Originally, I wroted it for my friend Gazuz. Who would have thought it was such a big hit? Now i'm maintaining it for the benefits of the world. You can download it free from FxFisherman.com. Like the title says, it runs blazingly fast! A gigabyte file could be splited under a few seconds using minimal memory.

 

Tags:

My Software