The Emerging Revolution in Game Theory

The world of game theory is currently on fire. In May, Freeman Dyson at Princeton University and William Press at the University of Texas announced that they had discovered a previously unknown strategy for the game of prisoner’s dilemma which guarantees one player a better outcome than the other. That’s a monumental surprise. Theorists have studied Prisoner’s Dilemma for decades, using it as a model for the emergence of co-operation in nature. This work has had a profound impact on disciplines such as economics, evolutionary biology and, of course, game theory itself. The new result will have impact in all these areas and more. The game is this: imagine Alice and Bob have committed a crime and are arrested. The police offer each one a deal–snitch and you go free while your friend does 6 months in jail. If both Alice and Bob snitch, they both get 3 months in jail. If they both remain silent, they both get one month in jail for a lesser offence. What should Alice and Bob do? ...

20 de agosto de 2012 · 1 min · 175 palabras · Nacho Cano

Radix Sort Revisited

In every decent programmer’s toolbox lies a strange weapon called a Radix Sort. Where does it come from ? Who invented it ? I don’t know. As far as I can remember it was there, fast, easy, effective. Really effective. So unbelievably useful I’ve never really understood why people would want to use something else. The reasons ? Most of the time, they tell me about floats, negative values, and why their new quick-sort code rocks. Enough, I’m tired. Although the standard Radix Sort doesn’t work very well with floating point values, this is something actually very easy to fix. In this little article I will review the standard Radix Sort algorithm, and enhance it so that : it sorts negative floats as well it has reduced complexity for bytes and words it uses temporal coherence it supports sorting on multiple keys ...

5 de julio de 2012 · 1 min · 147 palabras · Nacho Cano

A Gentle Introduction to Algorithm Complexity Analysis

A lot of programmers that make some of the coolest and most useful software today, such as many of the stuff we see on the Internet or use daily, don’t have a theoretical computer science background. They’re still pretty awesome and creative programmers and we thank them for what they build. However, theoretical computer science has its uses and applications and can turn out to be quite practical. In this article, targeted at programmers who know their art but who don’t have any theoretical computer science background, I will present one of the most pragmatic tools of computer science: Big O notation and algorithm complexity analysis. As someone who has worked both in a computer science academic setting and in building production-level software in the industry, this is the tool I have found to be one of the truly useful ones in practice, so I hope after reading this article you can apply it in your own code to make it better. After reading this post, you should be able to understand all the common terms computer scientists use such as ”big O”, ”asymptotic behavior” and ”worst-case analysis”. ...

5 de julio de 2012 · 1 min · 194 palabras · Nacho Cano

El algoritmo de Dios

El algoritmo de Dios es un término que surgió en la búsqueda de aquel algoritmo que indicara los pasos mínimos que resuelven un cubo de Rubik cualquiera. El término se usa profusamente, no sólo para el cubo de Rubik. Mucho antes de conocer dicho término, cuando me encontraba con diversos tipos de problemas, ya me asaltaba recurrentemente una pregunta irrelevante (para el caso que me ocupaba), pero que espero te haga pensar un poco en la importancia de algunas cuestiones que quizás no conoces: ”¿Qué solución daría Dios si fuera él quien resolviera el problema?” Lo más sorprendente quizás, es que ”las soluciones de Dios” no sólo no están vedadas al intelecto humano, sino que son numerosas y prolíficas. Veamosló. ...

28 de junio de 2012 · 1 min · 124 palabras · Nacho Cano

Regular Expression Matching Can Be Simple And Fast

Historically, regular expressions are one of computer science’s shining examples of how using good theory leads to good programs. They were originally developed by theorists as a simple computational model, but Ken Thompson introduced them to programmers in his implementation of the text editor QED for CTSS. Dennis Ritchie followed suit in his own implementation of QED, for GE-TSS. Thompson and Ritchie would go on to create Unix, and they brought regular expressions with them. By the late 1970s, regular expressions were a key feature of the Unix landscape, in tools such as ed, sed, grep, egrep, awk, and lex. Today, regular expressions have also become a shining example of how ignoring good theory leads to bad programs. The regular expression implementations used by today’s popular tools are significantly slower than the ones used in many of those thirty-year-old Unix tools. This article reviews the good theory: regular expressions, finite automata, and a regular expression search algorithm invented by Ken Thompson in the mid-1960s. It also puts the theory into practice, describing a simple implementation of Thompson’s algorithm. That implementation, less than 400 lines of C, is the one that went head to head with Perl above. It outperforms the more complex real-world implementations used by Perl, Python, PCRE, and others. The article concludes with a discussion of how theory might yet be converted into practice in the real-world implementations. ...

21 de junio de 2012 · 2 min · 235 palabras · Nacho Cano

The 8 Queens Problem with Arduino and Adafruit 8x8 Matrix display

Using an Arduino and an 8x8 matrix display from Adafruit (with I2C backpack), we display all the solutions to the classic 8-Queens problem (see http://en.wikipedia.org/wiki/Eight_queens_puzzle ) A solution to the 8 Queen problem is where 8 queens are placed on a chess board so that no queen can take any other queen. » @stormingrobots | youtube.com

21 de junio de 2012 · 1 min · 56 palabras · Nacho Cano

Basics of Computational Number Theory

This document is a gentle introduction to computational number theory. The plan of the paper is to first give a quick overview of arithmetic in the modular integers. Throughout, we will emphasize computation and practical results rather than delving into the why. Simple programs, generally in JavaScript, are available for all of the algorithms mentioned. At the end of the paper we will introduce the Gaussian Integers and Galois Fields and compare them to the modular integers. Companion papers will examine number theory from a more advanced perspective. ...

16 de mayo de 2012 · 1 min · 90 palabras · Nacho Cano