mercoledì, maggio 02, 2018

White King, Red Queen: selling the chess soul, part II.

We just left 1979, with D. Hofstadter being skeptical and not at all enthusiastic of a chess computer. Unimpressed by the opinions of the American scientist, in the German city of Munich, exactly at the same time, a small company just hired two programmers to bring to the market the first portable chess computer.

Chess was quite popular at that time. The famous Spassy-Fischer match of 1972 had been an incredible world-wide drama. Subsequently,  Fischer started his path into madness, was deposed and the rivalry between the two soviet giants Karpov and Kasparov began.

So, a short time after the introduction of the first personal computers, in the middle of a world-wide chess pandemic, you could by a small box of plastic, which was able to play chess at the level of a mediocre, but loyal and always available club player. It was called Mephisto I.
Mephisto I was a real blockbuster. You could buy for 500 DM (or 500 € of today), well below the price of a personal computer back then. It would help you going through tactical variations in post-morten analyses of games during chess-club evenings. They would sell 100.000 pieces per year only in Germany. The company producing the Mephisto, Hegener + Glaser AG, enjoined 10 years of almost complete monopoly of the chess computer market, and the financial reward coming from it.

And as it often happens, they were killed by their own inertia. The market was changing: more and more chess computers were available, the once esoteric mystery of alpha-beta search well known, and most important, the 486 entered the scene. A 486 with a decent chess program could reach chess levels worth of a national master. You could'nt bring it to the club, right. But for correspondence player it was a cheap insurance against tactical blunders. Chess programs entered the life of serious chess players and their moral authority dictated that Mephisto and all portable computers should be abandoned by the weaker chess players, or be condemned not to learn chess in their entire life. So they abandoned.

Why did'nt Hegener + Glaser AG see this coming? They had the professional chess programmers, they should have noticed at latest in 1989, as no chess computers entered the world computer chess championship or in 1991 when Mephisto lost the title to a software version of itself. Nobody knows.

H + G survived until 1994, and here we leave them and their 28 million DM of debts as a further victim of the endless race ordered by her majesty the Red Queen.


domenica, aprile 29, 2018

White King, Red Queen: the arms race in computer chess, part I.


Some weeks ago I went through a very insightful book about the red queen hypothesis: the evolutionary arms race between coexisting species, or between different gender in the same species, or finally, between individual in the same gender competing for offspring.

One classical example of the first one is the coevolution between figs and wasps: each fig having more or less a single dedicated wasp able to fertilize it. Those two coexisting species evolved through mutual competition: like inhabitants of the wonderland, they cannot stand still and are forced to continuously evolve in a perpetual arms race.

I want to now make the bold claim that the red queen hypothesis does not hold true only in the context of biological evolution, but in all cases in which there is competition and possibility of change. I would like to exemplify this bold claim on the amazing story of chess engines.

This is a community known the mosts only through the fame of the mythological Deep Blue, the first chess computer to defeat a human World Champion, the acclaimed Gary Kasparov.

I make this choice as it happens that I am active in the chess programming community since some years. Having been a mediocre club chess player in my youth, I have always been fascinated with chess engines and artificial intelligence. This even determined some of my career choices.

This will be a weird reading for people that never heard of chess tournaments or chess programming. You will get to know a competitive environment pushed forward by both by financial interests and the desire for intellectual prestige.

As a bonus, you are going to learn something about one the longest lived and most united communities in the digital world, the one of chess enthusiasts and programmers. To quote the motto of the World Chess Federation: Gens Una Sumus. We are one people.

I would like to start my journey with Gödel, Escher, Bach, an eternal Golder Braid, the gorgeous book by D. Hofstadter about everything, including artificial intelligence. There is one place in the middle of the book, where Hofstadter, a leading cognitive scientists of that time, starts to write about chess and chess computers. He is skeptical about the possibility that a computer program could defeat a human chess master (reddit link), adding that this is probably due to the peculiar way in which chess masters think. This was 1979. The AI scientists of that time seemed to predict a long hard time for chess computers. Obviously, if one is to negate such a development, this means that the development is already in course. There is a reward, financial gain and intellectual prestige, and there is a possibility to change, the computer technology rapidly evolving in those years.

Enter The Red Queen.

giovedì, aprile 19, 2018

We are the AI

Sweet Revolution (2015) - Gonçalo Mar

It just came to my mind some days ago.

Imagine now that your preferred, gigantobombastic tool start thinking and having a free will for itself. Imagine too that this tool starts being aware of your existence and start using you to satisfy its means. You don't understand what its means are, and before you can organize, it starts modifying your very essence with no apparent reasons.


Does this sound spooky? Well you now know how genes are feeling. They used to use living organisms to get their stuff done. Until one of those stupid tools decided to start a revolution.

Damned.

Recommended reading:
crispr
selfish genes
red queen
sweet revolution

sabato, aprile 01, 2017

Humanities

I a started reading this and I had a sudden enlightenment on a related topic.

Nowadays, it is actually possible to engineer everything you would like to, given enough time and resources, something like this or this or this (feel free to add anything you want, of course).

So, the true difference between success and failure is to do this with little resources available. 

To convince you, note that this was not true, say, 500 years ago. Many things were just not known. You barely had some understanding of scientific method (actually, you would have had to wait 15 more years) at your disposal. No matter how hard you would have tried, you could not fly to the moon. Period.

Today, actually, you could send people to Mars, starships to Proxima Centauri, eradicate malaria and maybe also find the limits of quantum mechanics and general relativity.

The art is now to do it without resources. We had a shift from in-depth reflection to tactical thinking. I find it most fascinating and I also find that this will lead to a reevaluation of humanities. If this not anymore that important to have the most profound technical-scientific knowledge, it becomes more and more important to understand interactions between individuals while working toward a goal, to identify cognitive biases leading to poor decisions and to assess the true, often non technical motivations between apparently technical opinions.

venerdì, maggio 31, 2013

Test-driven maths: convergent sequences

I want to show today that working in the paradigm of test-driven-development, we can develop a working definition of a convergent sequence. Metaphorically speaking, we want to develop a mathematical "program" that, given a sequence, says to us that this sequence is convergent in some useful sense.

I will start with an easy example (which will be our first test). We look at the sequence of numbers, which we will call

Test sequence 1

$$1, \frac{1}{2},  \frac{1}{3},  \frac{1}{4}, ...$$

or, in other, terms $\{\frac{1}{n}\}_n$

It is clear (by intuition) that the numbers in this sequence (in the following sequence 1) become smaller and smaller approaching, but never touching 0. For this reason we will use this as our first test case, and try to derive a formal definition of what is a sequence of numbers that converges to 0.

By looking at the sequence 2 things become apparent: 1) the numbers get smaller and smaller and 2) the  numbers always are positive. So we try our first defintion.

Convergent sequences, take 1

A sequence of positive numbers is said to be convergent to 0 if the numbers become smaller and smaller.

Let us try now to put it in more formal terms


Convergent sequences, take 2

A sequence of positive numbers $x_n\geq0$ is said to be convergent to 0 if $x_{n+1}< x_n$ for all $n$ index of the sequence.

Since now $\frac{1}{n+1}<\frac{1}{n}$, this definition seems to include our test tesequence 1, in the sense that according to this definition, our sequence converges to 0. Can we stop now? No. We have written a small test (checking whether the sequence 1 is converging) and a small piece of code (our take 2). But our mathematical insight is not yet satisfied, because our test does not cover many possible inputs (in form of test sequences of course). So, we have to extend our test.

In particular, it is maybe useful to have a sequence of which we know (always by intuition) that it does not converge to 0 so that we can check that our definition also fails when it must. The simplest thing to do is to consider the sequence 1 and add 1 to all members.


Test sequence 2

$$2, 1+\frac{1}{2},  1+\frac{1}{3},  1+\frac{1}{4}, ...$$

Now, since our sequence is composed of decreasing positive numbers, our tentative definition would call it convergent. Since we know that this sequence does not converge, that means that our program (take 2) does not pass the test. In fact the point is that our test sequence 2 is always at least 1 away from 0. So, let us add to our definition that the sequence cannot have a definite distance from 0.

Convergent sequences, take 3

A sequence of positive numbers $x_n\geq0$ is said to be convergent to 0 if $x_{n+1}< x_n$ for all $n$ index of the sequence and for any positive number $\epsilon$, it is not true that all numbers in the sequence are larger than $\epsilon$.

This looks good. Let us build some new test to check whether we are really there. Say, we take the sequence 2 and we put some 0 here and there. The resulting sequence should not converge according to our definition, since we are not getting closer and closer to 0 with all numbers!


Test sequence 3

$$2, 0, 1+\frac{1}{2},  0, 1+\frac{1}{3},  0, 1+\frac{1}{4}, ...$$

Now we have problem. The sequence is clearly non convergent: if we take the odd indexes, we go to 1, otherwise we go to 0. Since we have 0s over and over again in our sequence, we cannot find an $\epsilon$ such that all numbers are larger than that, so for that reason the sequence would be classified as convergent. But: since we inserted 0 over and over again, the numbers are not decreasing, and the sequence is classified as not convergent for that reason. This sounds weird. It looks that we pass the test, but for the wrong reason. Let us keep in mind that there is some problem with the decreasing property and let us correct the part regarding the distance from 0.


Convergent sequences, take 4

A sequence of positive numbers $x_n\geq0$ is said to be convergent to 0 if $x_{n+1}< x_n$ for all $n$ index of the sequence and for any positive number $\epsilon$, we can find some index $k$ (dependent on $\epsilon$) such that all numbers with index larger than $k$ are smaller than $\epsilon$.

Now we are on the safer side with the test sequences 2 and 3. Indeed, if I choose my $\epsilon = 0.9$ I am not able to find any index such that the numbers with larger index are smaller than 0.9, since I have over and over again some $1+\frac{1}{n}$ popping up in my sequence. Are we still on the safe side with sequence 1? Yes, since if I choose $k=\frac{1}{\epsilon}$, it is clear that for all larger index the numbers in the sequence are smaller than $\epsilon$ (this is undergraduate algebra, just try it). Note that now the test sequence 3 is classified as not convergent for both not being decreasing and for being not arbitrary small.

Now let us go back to the problem with the decreasing sequences.. If I have a sequence of numbers and scramble the order, I do not want that this scrambling changes whether we call the sequence convergent or not. So, we come with a second test sequences that has to converge.


Test sequence 4

$$\frac{1}{2},  1,  \frac{1}{4}, \frac{1}{3}, ...$$

We just switched the position of the neighbours. Now, this sequence is intuitevly convergent, but our take 4 says it is not, since the elements are not decreasing. So, what if we drop the assumption of having decreasing numbers?


Convergent sequences, take 5

A sequence of positive numbers $x_n\geq0$ is said to be convergent to 0 if for any positive number $\epsilon$, we can find some index $k$ (dependent on $\epsilon$) such that all numbers with index larger than $k$ are smaller than $\epsilon$.

This sounds familiar. Surprising as it is, real world mathematics really feel like that often: you start with some hypothesis of a theorem, try out some examples, until you are confident enough. Constructing the examples exactly gives you the boundaries of the hypothetical theorem. Can we build proofs by this method?

A test-driven revival

Since more than 1 year I left Freiburg and the BCF to start working in the development of MEMS with Bosch GmbH. For some complicated reasons connected to my work there, I've got involved in software engineering and in particular in test-driven development. But only today I realised why I've got involved there and why I like it.

In fact, test-driven development is a kind of "formalization" of how mathematicians actually work!

In particular, I found it complying with Gower's pedagogical principle.

Following this intuition, I will try in the next days (months?) to revive this blog, and to show that what computer scientists rediscovered in the middle of the of 90ies as test-driven development is nothing but what mathematicians are doing since centuries.

martedì, ottobre 02, 2012

Animali Selvatici

Circa un anno che non scrivo, eh? Questo è dovuto a due fattori principali:

 1 - ho abbandonato le neuroscienze e, in generale, il mondo dell'università, per andarmene a fare l'ingegnere di MEMS alla fabbrica Bosch di Reutlingen.

 2 - circa 7 mesi fa ci siamo presi in casa un animale feroce. Non vi dico la razza a meno di evitare visite dal Tierschutzamt o simili, ma solo che richiede molto cure. Sui suoi sviluppi vi aggiornerò prontamente...

sabato, ottobre 08, 2011

Modelli computazionali del Parkinson

Qualche giorno fa ci è stato accettato un articolo in cui esploriamo con dei modelli le possibili cause di alcuni sintomi del morbo di Parkinson.

Il morbo di Parkinson è caratterizzato da deficit motori e cognitivi. Fra questi, il più conosciuto è il tremore. Questi sintomi hanno un correlato neurale molto preciso: il segnale elettrico nel nucleo subtalamico mostra delle oscillazioni molto marcate intorno alla frequenza di 20 Hz, assenti nello stato sano del cervello. È stato scoperto che sopprimere queste oscillazioni, ad esempio tramite la stimolazione cerebrale profonda, porta alla scomparsa quasi immediata dei sintomi.

Nel nostro studio (e qua andremo un po' sul tecnico) abbiamo tentato di portare un po' di chiarezza sulle possibili cause di queste oscillazioni. Quello che si sa con certezza (più o meno) è che queste oscillazioni sono generate tramite un processo di feedback negativo-positivo tra il nucleo subtalamico e la parte esterna del globo pallido. La teoria dominante sulla causa dell'insorgere delle oscillazioni è l'aumento della connettività tra queste due strutture. Purtroppo, però, i dati sperimentali non supportano questa ipotesi.

La nostra teoria alternativa prevede che le oscillazioni siano generate da un livello di attività maggiore nella struttura a monte del globo pallido: il corpo striato. Il globo pallido riceve la maggior parte dei suoi input (di tipo inibitore) dal corpo striato. Quello che noi abbiamo mostrato in un modello computazionale è che un aumento dell'input inibitore al globo pallido è da solo in grado di generare oscillazioni.

martedì, settembre 13, 2011

Podcasts & co

Oggi il nostro responsabile per le relazioni esterne ha messo in rete la versione italiana di What are computational neuroscience?

(Tradotta e detta dal sottoscritto)