Some fun with probability and Java, for an academic project.