Statistical simulation of FIFA World Cup
Source file: worldcup.R
You need R to run
> s <- simulations(100)
 "simulating 1 / 100"
 "simulating 100 / 100"
> length(s[s == 1])
Here, team 1 (which is set to win each match with
probability 0.9), became champion in 65 out of 100
The programming language R is in many ways similar
to APL. Check out UnicAPL to
write APL with Emacs.
Statistics and probability theory are closely related
For an interesting tournament scheduling task, check
out the Social Golfer Problem.