Introduction to Combinatorics and Probability for Gaming (Part I)

The modern study of probability was sponsored by a French noble, the Chevalier de Mere, who employed Blaise Pascal to determine why he was consistently losing at a particular dice game. Together, they analyzed two games that the noble played:

  1. Roll a six sided die four times, and bet on whether any of the results will be a 6.
  2. Roll a pair of dice twenty-four times, betting on whether a pair of any sixes show up on any roll.

The noble had tried to compute the probabilities naively, with the following logic:

Simple evolution demo tool

My SIWOTI flared up, and while I had little hope that the Noachian creationist would give it any consideration, I wrote a simple evolution model demo thing. It's very simple, but can demonstrate simple natural selection.

To run it, you'll need Python 2.5 or 2.6.

The top of the source code contains a number of parameters that you can tweak.

Compression: Run-Length Encoding

Perhaps the simplest method of compression is run length encoding. When faced with the string "AAAAAAAAAAAAAAAAA", if asked to describe it to another person, most people's first instinct would be to count the number of As, and tell the other person "17 'A's", at which point the other person perversely writes down the string "SEVENTEEN AYES", showing up one of the problems with this approach: distinguishing talking about the data from the data itself.

Compression: Introduction

    What is compression?

A compression algorithm that maps a set of strings A to another set of strings B, with the goal of mapping strings in A that are believed to be more likely to occur to shorter strings in B. There are two important details here: "shorter", and "more common".

LJ Post deleter

Because somebody asked for it, I modified my LJ post locker to (hopefully) delete the entries instead. Not having a journal I want erased, I haven't actually tested it myself.

Auction mechanics

Today I was pondering the character creation mechanics of the pencil and paper RPG Amber. In Amber, you play a super-human, an individual of whom all others are mere shadows. You might be the strongest person in all of existence, and your brother the smartest. That you are super-human is a given, so rather than give point values to attributes like strength, stamina, combat ability, etc., you instead bid in an auction with the other players for your ranking: strongest, second strongest, etc.

LJ Locker

A friend of mine wanted to lock all of the public entries of her LJ, but not having a paid account, she couldn't use the built-in tools. As a result, I wrote a tool that will friend lock all public entries in a Livejournal (or, with a small bit of work, any other journal supporting the LJ API), but not touch any private or existing friend-locked posts. There's no GUI for it, and it takes the username and password from the controlling terminal.

Requires Python.

Zombie infection simulator

After seeing Kevan's Zombie infection simulator, I decided to make my own. To balance the odds, I added a way for humans to fight back, arming themselves with randomly distributed chainsaws. Now the humans can sometimes, but not always, win.

LJ Friend Filter

A friend of mine wanted to view filtered set of posts by certain Friends, based on what tags they placed on the post. Rather than wait for Six Apart to implement something like that, I coded up a work-around, using each journal's RSS feed. It's not perfect---you can only see public posts---but it's better than nothing.

CSC Light levels

The Computer Science Club of the University of Waterloo has a webcam or two.
By monitoring the average brightness and the standard deviation of the brightness of the image, I try to determine when the CSC is open.

Syndicate content