Archive for February, 2010

Interesting Poker Article

February 26, 2010

Here is what Phil Laak has to say about Poker bankroll management .


Babel-17 for POPL 2011

February 18, 2010

I think I have the concepts of Babel-17 straight enough now to submit it to a conference. Apart from the general beauty of the language, there is the truly novel invention of locally imperative, but still side-effect-free programming via linear scope. In case it is not so novel, it is always nice to get pointers to previous work via rejection reviews 🙂 No idea yet how I will pay for the conference, but in the highly unlikely case the paper gets accepted, I am sure I will find a way.

Edit: Maybe SPLASH is a better target, it definitely sounds nice: Software for Humanity !

Netbeans 6.8 rocks!

February 15, 2010

Got a Babel-17 editor with syntax highlighting and display of lexical/parse/semantic errors up and running in no time!

Logo for Babel-17

February 14, 2010

Netbeans integration wants an icon for Babel-17 files. So I need quickly a Babel-17 logo. What do you think about this:

Babel-17 LogoYeah, I admit, it is pretty basic. But anyway, it’s the Babel-17 logo for now, if you have a better one, send it to me!

Editor Plugins for Netbeans 6.7 and beyond

February 14, 2010

It seems that now there is something close to documentation on how to integrate an editor for your own custom language into Netbeans. There is information on how to do syntax coloring, and how to report parsing errors. All of this information can be found here. There is going to be a nice Babel-17 editor after all!

The Better is the Enemy of the Good (Voltaire)

February 11, 2010

I guess different people will interpret this in many different ways.

The Kelly Criterion

February 10, 2010

Also called Fortune’s Formula …

It is the one thing every good poker player should know by heart. And, maybe even more important, act by it. How often did it happen that a great poker player got broken by a single hand, just because he thought he had an edge and therefore invested more in that hand than he could afford to? Plenty of times.

The idea of the Kelly Criterion is that you should only wager a certain percentage of your entire bankroll (= all the money you can afford to bet in a poker game in the foreseeable future). You could employ some fancy mathematics to calculate what that percentage should be. But these days it is probably easier to write a small computer program and simulate what happens to your bankroll over time.

There are three basic parameters that are important to know:

  1. How good a poker player are you?
  2. How quickly do you want to get rich?
  3. How high a risk are you willing to take to go broke?

Here is the setup for our computer experiment: Assume you have a certain bankroll R. Also assume, that you must have at least $4 to participate in a poker game. A single round of our experiment consists in you sitting down at the poker table with f*R dollars, where f is the fraction of your bankroll you are willing to risk in a single round. You play until you lost these f*R dollars, or until you doubled up, i.e. you stop the game as soon as you have at least 2*f*R dollars in front of you. You repeat these rounds until you lost your entire bankroll (i.e. until your bankroll is less than the minimum buy-in of $4), or until you have played 100 rounds. We furthermore assume that you are a great poker player. In particular, we assume that the chances of you doubling up in a round are 60%:40%. We repeat the experiment 1000000 times with a starting bankroll of R=$100. This leads to the following numbers:

f 1% 5% 10% 15% 20% 25% 30% 40% 50% 77%
chances of going broke 0.01% 0.01% 0.06% 0.49% 2.22% 6.8% 13.24% 37.86% 67.96% 100%
average bankroll if not broke $180 $255 $696 $1876 $5K $13K $38K $343K $3116K

According to these numbers, if you are risk averse, you probably should not invest more than 15% of your entire bankroll. If you are VERY risk averse, you invest only 5% of your entire bankroll. If you want to get rich quickly or otherwise die young, you may even choose to invest as much as 40% of your bankroll. All of this is better than investing your entire bankroll! Investing 77% of your bankroll will lead soon to bankruptcy.

Another factor we have not accounted for is that you might lose some of that 60%:40% edge the more money is at risk in a game (because the more money is in a game, the better the players usually are). So you might want to rerun these simulations with an 55%:45% edge etc. Here is the Java code for running the simulation:

package kelly;

public class Main {

    public static double kellytrace(double capital, double oddsOfWinning,
            double f, int rounds)
      for (int i=0; i<rounds; i++) {
        double betsize = Math.floor(capital * f);
        if (betsize < 4) betsize = 4;
        if (capital < betsize) return 0.0;
        double cashoutsize = betsize;
        double r = Math.random();
        if (r <= oddsOfWinning)
          capital = capital + cashoutsize;
          capital = capital - betsize;
        if (capital < 4.0) return 0.0;
      return capital;
    public static void kelly(double capital, double oddsOfWinning, 
            double f, int rounds, int numExperiments)
      int won = 0;
      int lost = 0;
      double won_capital = 0.0;
      for (int i=0; i<numExperiments; i++) {
        double result = kellytrace(capital, oddsOfWinning, f, rounds);
        if (result == 0.0) lost++; else won++;
        won_capital += result;
      System.out.println("Lost: "+lost);
      System.out.println("Won: "+won);
      double p = Math.ceil(10000.0*(((double) lost)/((double)won+lost)))/100.0;
      System.out.println("probability of going broke => "+p+"%");
      System.out.println("final capital on average: "+((won_capital)/won));

    public static void main(String[] args) {
      kelly (100, 0.6, 0.1, 100, 1000000);

See you at the tables!

One Day in Munich

February 9, 2010

The phlegmatic programmer met on Sunday in Munich other, not so phlegmatic, but equally talented people. One could shelf this meeting also under the title “The artistic, the entrepreneurial and the phlegmatic programmer”. It was fun, and of course, Munich is a very nice city 🙂

In Freeroll Heaven

February 5, 2010

After an epic 6-hour battle from 3 am until 9 am the phlegmaticprogrammer has qualified for the final National Heads Up Championship Qualifier on Fulltilt. He barely made it, slipping into 27th place out of over 3000 Round 1 winners. He took many bad beats, but came back again and again, even after he went all-in in the last 20 minutes with $150K holding KK, only to get called by QQ, and the lucky son of a bitch hits his queen. Only $40K left, he fought his way back playing great poker, even laying down QQ preflop (as it turned out, the opponent had AA), and JJ after a flop of 9 7 4 (as it turned out, the opponent had 99). In this form, he has a decent chance to successfully battle the other 324 poker devils who also made it to the final on February 21st.

Babel-17 v0.2 spec is out!

February 1, 2010

Finally. It took me considerable sweat to come up with it. The new Babel-17 v0.2 spec combines everything I would like to see in a modern programming language (except a foreign function interface for dealing with I/O and graphics ;-)). I think Babel-17 v0.2 is truly beautiful. There is no reference implementation yet; implementations for both Java and Objective-C are scheduled for the summer of 2010. Yes, you will hopefully be able to program parts of your iPad programs in Babel-17 soon 😀

Read the spec at .