Federico Lebrón

Generalized rock-paper-scissors, best-of-3

Categories: Game Theory, Mathematics

I found this problem on a programming competition website, and decided to analyze it a bit. The problem involves two players playing Rock-Paper-Scissors until one player has won 2 rounds (this is called "best-of-3", even if there may be more than 3 rounds played, due to ties). This can be generalized in at least two ways:

  • The game is generalized to include more than 3 possible moves, such as Rock-Paper-Scissors-Lizard-Spock.
  • Players play until one of them has won $k$ rounds, with $k \in \mathbb{N}$.

In this post I explore both generalizations, finding solutions to them.

A categorical view of covariance and contravariance in C++

Categories: Programming, Mathematics, Computer Science

I had often heard the expression "C++ now has covariant return types". To be honest, I vaguely knew covariance was a mathematical term, and I was also pretty sure it had nothing to do with statistical covariance.

Now that I understand a bit more about category theory, I feel I can clarify some things about this usage of the word "covariance" in programming languages. Surprisingly, it is not a terrible bastardization of the mathematical term, as C++ and Java have done to the word "functor".

Braess's paradox and the price of anarchy

Categories: Game Theory, Mathematics

A few days ago I attended a series of lectures on graph theory and optimization at the National University of Rosario, Santa Fe. I'd like to discuss one of the topics presented there by Nicolás Stier-Moses, from Columbia University. This topic is selfish routing, Braess's paradox, and the price of anarchy, in the field of algorithmic game theory.

I'll give a brief overview of these points in his talk, and present one of his results, a short proof of the $33\%$ upper bound on the price of anarchy in linear path cost congestion routing problems.