Monday, May 24, 2010

A Letter to the Wise Man

"Gott wuerfelt nur."

God only plays dice.

An answer to the famous quote from Einstein - "Gott wuerfelt nicht". In my opinion, the universe is only made of stochastic functions and any deterministic ones are only an approximation to it.

Or even, the universe might be made of deterministic equations, but we are cursed with a limited precision in our sensors (biological or not) that we will never see it the way it is.

That can be extended to problems, that is, if you happen to solve a problem in all situations, it might only be that your samples are limited.

It is very human to try and adopt systems where the certainty is 100%, or in other words, it is easier to develop and understand systems where the functionality is not under some noise conditions, where mistakes could not occur internally or externally and when the results expected are clear and not under a great number of trade offs and unclear multi-modal complex functions.

However, the real world seems to prefer the systems that are more adaptive rather than the ones that solves everything 100% correctly, under some precise conditions.

It might only be that our understanding of the world, as of today, is a bit ankward and much attention is paid into developing the certain than discovering the uncertain, leading to very few progress. It is no wonder, even Einstein that could figure relativity could not accept a probabilistic model of our world. It is that hard and it might be our big unability.

I would even say that stochastic systems are the evolution of mathematics, but given its high complexity, it is underused.

Though, things are changing, mathematics is not the same as it was before, it was reinvented by the advance of technology and nowadays it might even be easier to understand and tame stochastic systems as it once was with the deterministic field.

I will go further and give an example, if you would like to calculate the pi, there is a very easy to understand way of doing it using a simple stochastic system. Imagine that you have a square and a circle inside of it. If you get a random variable x,y and put it inside the square, there is a chance it falls inside of the circle. This chance is directly proportional to the area of the circle that is pi*R^2.

Now if you divide the number of samples from x,y that falls inside the circle by the total number of samples, you will get an approximation to the following: pi*R^2/((2*R)^2). That is, the result is proportional to pi/4.

The more you collect samples the near the result and it is very easy to program and understand. No complex at all, but try this without a computer and you will see how difficult it is to imagine the result.

I dare say, if mathematics is the deepest science of the world from which every other science depends, computer science is the tool to understand mathematics and therefore the base of science in a technological world.

But changes are not easily accepted in the cultural world, it is even harder to occur in a educational system. Though some guys are luckily experimenting programming before mathematics and things are getting much easier and clear. No wonder they are called sometimes as geniuses, hackers, and so on. But truth be said, the wheel is invented, it is here and there, they are just the unique humans that use the wheel appropriately.

I am sure you know Mathematics was once a forbidden and secret society, that people were once afraid of using a vehicle that travels more than 100km/h, and etc. Therefore, it was the same with mathematics, other sciences and discoveries, no reason to be different now.

Tuesday, March 16, 2010

A thing about C portability, or why you do not need to leave the C side when someone says they work with Java, Python or anything

I am not used to write about programming here, but this fact really got my attention nowadays at work.

I was required to pass my algorithm to Java and a bit reluctant about the intensive workload which would result in two codes with twice the maintenance time. So I decided to challenge myself again and try a different solution, that is, why not interface the C code to Java?

Well I have nothing against programming in Java or anything. But porting code is a terrible straightforward thing that should never be done by humans, or at least, not by myself.

So I found a challenging, entertaining, useful and much better solution. To interface!

My task was a little difficult from only calling a library and so on, because my library must use a function defined by the user and this way Callbacks are a must. I was a bit scary at first if all this would end up nice, because JNI (Java Native Interface) did not seem to have much followers on the net and if it was CNI I would have dropped the subject, because it would be certainly lack either documentation or efficacy... but Java is another world, not better not worse, just another. And most of the things done in Java, although too complicated, they are not done by third parties.

And at the end, I just got a pretty system working well under Java and using the C++ shared library :).

Most people would probably port code and would end up with duplicate maintenance. I am really happy to have worked until now with 2 managers that really understand and accept better solutions. I know there are a bunch that only wants simple and fast solution.

All this happened once before when I worked in Nokia and they used scripts in a proprietary system, I just needed to compile a DLL from my C code and it all end up nice as well :). But I should say, that time things was much easier than this time around.

Wednesday, January 27, 2010

The Idiosyncrasy of our Languages

Here goes myself with the English language again. But what if I wrote this sentence in German, would this phrase retain its meaning?

I think most people would answer yes, it is just logical if we think in phrases as a code or mathematical formula ready to be transmitted. And we clearly know our logical analysis is the same in all remote places.

But are we only propagating logical expressions? I think there is more than meet the eyes, much more.

You may be thinking about feelings and all the related expressions of social relationship. Because you probably noticed that people are passing information with a clear social objective. For example, to cause fear or to create compassion.
And this could of course be passed in all languages, although in different ways, right?

Wrong! There are expressions that could not be translated and I dare say, most of them are not. For example, if you say God in a catholic country you have one meaning, but try saying this word in a atheist country or in a country with a different prominent religion. They have very different meanings and feelings related and you will certainly get different results.

There are numerous funny situations related, but what I want to write here is about what we don't usually perceive. For example, you might translate from the German "mir fehlt das DDR" to the English "I miss the DDR".

This is almost the same, but if you take a deep look, we are missing lot of German culture in the English phrase. What is DDR? Ok, lets translate this to: German Democratic Republic. Hmm, but the Germans know how it was there, so we can put... and this goes on and on. Sometimes it just means lot more than what it is written.

You may think it is a classic example of historic culture differences only, so let me get to one more example: German: "Das gibt es gar nicht!" could be translated to English: "I can't believe it". Or in other words, it cannot be translated to English, it is an expression of something surprising or very wrong. I got this example because the idea of right and wrong in German is clear, strong and very natural. But there is not the case in Portuguese, Spanish and English.

The problem is that all words, though similar, have different meanings. Fight in American english is more about violence, and in German "Kampf" is more about perseverance to achieve an objective. I know some of the people understands what I am talking and even know this already. But have they thought the consequences?

One side of the consequences is the conflict. There is a strong conflict from countries trying to understand each other and trying to reach diplomatic positions. People judging other countries on pre assumptions based on their own culture.

Iraq is a good example of sourveignity problem, that is really hard to understand. And yet, we want to solve their problems. Is not it?

Making things simple, there are hundreds of interpretations for each phrase we write, but those hundred interpretations, if this phrase is translated, would differ a lot from language to language probabilistically.

But at the other side, the languages also create islands of culture and permit the survival of plenty of cultures at the same time. Ideologies alive that coevolve together.

And what is really interesting about those cultures is that we can somehow understand the evolution of culture by analysing the expansion and evolution of the languages. The graph of Indo-Europeian languages for example.


This graph teachs alone an intense europe history. The civilizations who died and the ones that survived, along to the ones that let a legacy.

I would say that this graph does a good job in separating the similarity in cultures. And it also goes deep in our day to day life, because who ever thought we were using a legacy of our ancestors, something that tells so much about ourselves as a civilization and country.

Something so precious and delicate that we would hide if we could, but we unconsciously speak.

Friday, December 4, 2009

Exchanging of Culture

Hello people,

I would like to write now the first chapter of Cyclus, but my head did not find a way to begin the story yet. And I need to read more and practice a bit my writing before writing something bigger than 5 pages long. I must finish Dracula, Terry Pratchet's Guards and Charles Dickens's Great Expectations.

Btw, Charles Dickens is the best writer I can think of. I was always averse to reading his books, but I overcame my aversion to my great satisfaction. If you like adventure or stories that really drag you into it, read it. Mostly because each character is realistic, you can feel them and they seem alive. Sometimes more alive than you wanted them to be.

Great Expectations is the first novel to feature 2 endings... I will not go into details, read it if you will!

Sometimes I am asked of how my time in Germany was and I give some random answer not really worth the question. I thought some of you might be interested in my deep and official answer to the question, hosted by the Universitaet Ulm:

http://www.uni-ulm.de/fileadmin/website_uni_ulm/io/INC_Exchange_Reports/Informatik/BR_Sao-Paulo_U-de-Sao-Paulo_2007_DV.pdf

Tuesday, August 18, 2009

The Cyclop's Disease

Long ago, was sometimes heard that someone got the Cyclop's disease. Some books relate about people being brought outside of cities and condemned to remain in exile.

But details about the circunstances had always been hidden since then. Some people used to believe that this disease appears very suddenly and brings its host to madness and that was also the cause of panic in cities by that time when someone was caught. People just thought it might be contagious.

With the time, people with that disease was painted with one big eye and a monstruous body, meaning that its host was indeed transformed in some strange creature. But although this interpretation got mainstream, it is not likely to be true, because books before that date had never cited any mention of a transformed body. And such ocurrences should not be possibly hidden from people that easy.

What was really interesting was that although different, the stories agreed that these people lived alone and that they were different from the most common ones, although they failed to provide a common justification for that fact.

This was when we found the book of Geneha, because it was not a normal book. It may have the same appearance, it may have the same materials and properties. For it was written in the same manner as the others, but its writer was different in all ways. Because he was a Cyclop himself.

And I should say my reader, that what lies in this book may have passed along generations and generations whithout notice. Not because the people did not know about it, but because the myth of a monstruous Cyclops with a big eye was much more interesting than the story of our exiled friend.

A friend that was by some night captured and taken to a montain far away from the city. Without explanations, but maybe not without reasons. Because the eyes may be the same of ours, but they can see much wider and far away.

His vision may be compared to the vision of kings, but people are not supposed to view with an eyes of a king, my reader. He writted that he could see every social mistake and could tell easily the future, his eye had the hability of seeing relations.

But his eye, he had written, was at the same time a curse. And he was not talking about his social situation, but about the power of a wild beast out of control. Because he saw the mistakes hidden in everything all the time, even when he does not want to. But nothing was more terrifying than being able to hide his own mistakes from himself. There is nowhere to run away from the eyes that sees everything.

And for one thing he agreed with all other histories, that is the fact of the disease being countagious. Because the Cyclop's Disease could be taught.

(this story is fictional for all purposes)

Tuesday, August 11, 2009

The big problem we are all solving and we do not know

Last week I was traveling to meet my coordinator in another city, well it was just another day of sun and I was kind of sleepy, but something interesting occurred to me.

No, it was not another idea, it was a perception. Maybe one of the simplest ones, and the one that you just ignore after some days. You know, it is simple, so it is also simple to forget. But it may be very interesting and outstanding if took to the limits...

So let me tell what it was... I was trying to solve a artificial intelligence puzzle, just like I do everyday, hehe. But the problem was about an area of optimization (In fact I can prove that optimization and learning are very similar, but I will not do it today, it is boring and most of you guys should also think it is obvious), so I was just thinking in this direction and so on. Trying to figure out how to improve the minimal functions that are supposed to deal with creating a model of dependencies of variables. Ok I should have lost you know, but do not care about the exact meaning of those words, try to think what it represents for you. Something like "how does it feel" instead of "how does it work".

But in a minute I noticed that a minimal function of the optimization algorithm was a clustering algorithm, ok. No, wait! Clustering of pixels of images? No, of variables.

Ah, well seems the same... and it is. But wait... I was talking about optimization, and that lead me to use dependency of variables , what on the other hand need to have a clustering algorithm, what we can guess needs a... ? optimization? no... deliciously yes! =D

A recursive solution, nice, but this goes much far away, much more than I can understand now. There are places on social sciences talking about clustering and interpreting probabilistic models. Sometimes I am talking with a guy and I just realize that everything we were talking could be transferred in some simple logic puzzles. I know someday I will look at this post and dislike my ingenuity, but I will post this here anyway.

How far away it goes? Well, phylogenetic networks try to create groups that are minimally distant, what does it mean? Clustering! Learning is just an optimization of the minimum of errors. And it goes on my friend, not just with these algorithms, but with others. We are using things here, others are using things there. We are not related, but the things we use are.

What I mean is that we might be confronting, not only with a big theory of everything of the physics, we might have also a big theory of everything of the logic world.

And this logic world could be composed of simpler functions that builds everything. If that is not the case, at least it would help us a lot having a better system of integrating logic in science than the article's system do. You know, it might just be the case that we are stucked in a local optimum of development. Nah, too drastic. With all these people around we might get enough samples and we are developing faster than ever! But better?

What does I mean, well we might all be thinking that we are making better solutions, but we are in fact just limited by a interpretation of our problems. And the things that we solve today could just never be solved at all in these space of solutions of the functions we are using. Yes I am talking about Space of functions, not solutions. Reminds you the computational complexity theory? But I am talking about other similarities of the functions in logical terms not their complexity.

Distance between functions? Well... yes! Maybe it is not possible, maybe it is... who knows? Wait I think I know how... shit this is gonna be difficult to justify...

See you in the next monthly post (it seems to be following this rhythm really strict, hehe)

Friday, July 10, 2009

If people got high with Science...

If people got high with science, we would not have to build schools. Parties would be named and divided by their intellectual personality.

Hospitals would make campaigns to decrease overwork cases. Which indeed would not be named overwork, but overdose.

Well, all this would last until the next generation grow and think it is outdated to live this way. And so, science would be forgotten and school would have to be build to force people to learn.

And that is when nobody would ever learn anymore.