Razz simulator simulation benefit advantage of typedef purpose of test case

Learning by Doing: Programming Razz Simulator

Submitted by Eus
on February 4, 2010 - 7:54pm

As a final assignment in my Languages for Scientific Computing class, I develop a Razz Simulator (http://github.com/eus/razz_simulation). Basically Razz is the inverse of Poker in which you try to come up with the worst hand (http://en.wikipedia.org/wiki/Razz_(poker)). The game is well explained in the slide for the first and second lectures and in the sixth assignment foud in http://www.cs.utexas.edu/users/pauldj/lectures.html. The first problem on Razz was at the end of the first assignment: given A, 2 and 3 to start with, what is the probability of getting a hand with rank exactly 7? Well, no one answered that correctly until the professor showed an elaborate calculation in Mathematica that resulted in 0.143008. One important message is that people don't do such an elaborate calculation in reality. Rather they use a simulation (i.e., play as many Razz games as possible with the given starting cards and count the number of times you score 7). So, the last assignment is about developing the simulator that can simulates as many games as possible in the shortest time possible. The most interesting thing about the assignment is that the program is neat enough to show some interesting software engineering principles in action beside telling you that Razz is not as simple as it seems to be.