web 2.0

My Genes Can Do Reverse Engineering

Nah, it’s not my biological genes that can do the reverse engineering jobs; but it’s the artificial ones that I created for the previous Genetic Algorithm experiments. Do you believe there is a machine that can automatically create just about anything you dream of? You want to make some cool computer programs, games, fashion designs, or trading strategies, but you don’t have any ideas on how to do it? Well, today is your lucky day. Your prayer is answered because this Genetic Machine can produce all of those for you. You won’t need to teach it or feed it. Just tell it what you want, click ‘Start Building’, wait twenty four hours, and there you have it, your own piece of invention without any hassles. Just one thing though. The machine, it doesn’t exist. However, there is a less advanced machine that does exist and can create some items on its own. NASA used it to automate the creation of the UHF antennas for Mars Odyssey spacecraft. Well, the machine is just a today’s computer with special genetic software installed. Well, I can’t show the NASA’s special software to you, but I have something similar to show off today. I built a software program using the same concepts and algorithms (Genetic Algorithm and Genetic Programming) that NASA used. I gave it a temporary name ‘Program Tree Evolver’.

For now, Program Tree Evolver doesn’t produce antennas. It can however reverse engineer some data fed into it to recover some hidden formulas, and these formulas can be used to reproduce the same input data. “Okay, you’ve found some formulas, so what’s the big deal?” you says. I can tell you it’s a big deal. If you know the formulas that can reproduce the data that was first fed into the software, you’ll know the process behind everything. Says, you’ve collected historical data of tornados such as the paths of tornados and the geographical pressures. Now you want to find out how the geographical pressure affects tornado’s movement. So then you feed your tornado data into the software, click “Start” and wait until it generates the formula. With such a clear formula in your hand, you’ll understand exactly how the pressures move the tornados, and ultimately you’ll be able to predict tornados, project their destructive paths, develop early warning systems and save lives. Got it yet? Here’s another interesting example. Says, you want to be able to predict the stock prices so that you can earn a living from stock trading. You want study the reasons why the price goes up and why it goes down. You have historical prices of many companies. So, you put that data into the software and wait until it generates the formula. Bingo! The formula tells you the secrets behind stock market movement, and with it, you can easily predict where companies will go to and make decent money from it. To put it briefly, the software allows you to reverse engineer data back into its original formula.

Well, I made a lot of assumptions in the examples above. You can’t always derive some formulas from data, because formulas might not be in there first place, or Genetic Algorithm simply can’t solve it. Moreover, you can’t always have the formulas in such a short duration especially by working in your comfort zone. In reality, you might have to connect many powerful computers in a big grid to form a supercomputer. You’ll have to collect much data, and before you can feed it into the software, you’ll have to code some evaluation procedures so that the software knows which solutions are better or worst. Many times, you’ll have to code data converters and simulators to the purpose. All I’m saying here is that reverse engineering for formulas is possible but much more difficult than you think.

For a short and simple demo, I fed some numbers generated from Excel using a formula. I then exported and fed the results into Program Tree Evolver. I didn’t enclose formula to the program. Let’s see if it can reverse engineer it. Soon enough, it did! It found the correct formula in ten seconds. The formula (P1 * P0) – (P1 / P2) is presented in a binary tree. See it in the screenshot below. 

Tags: , ,

Artificial Intelligence | My Software

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