Statistical simulation of FIFA World Cup


Source file: worldcup.R

You need R to run the simulation.

Example:
        > s <- simulations(100)
        [1] "simulating  1 / 100"
             :
             :
        [1] "simulating  100 / 100"

        > length(s[s == 1])
        [1] 65
    
Here, team 1 (which is set to win each match with probability 0.9), became champion in 65 out of 100 simulations.

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 to logic.

For an interesting tournament scheduling task, check out the Social Golfer Problem.


Main page